-
Notifications
You must be signed in to change notification settings - Fork 440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the ability to expose a port on a collector container #1011
Comments
I don't know, perhaps if the pod monitor uses port names. Could you please report back if you played with this? I think it's worth fixing this. |
I investigated this more - I set up a pod monitor for the collector while running the collecter as a statefulset. The ports for the operator could be found in service discovery labels, but there weren't any ports with the collectors' labels. I tried with |
Stupid question, but can't you use a ServiceMonitor instead? From what I remember, we create a service explicitly meant to be used with the ServiceMonitor. |
I believe this is a problem for both ServiceMonitor and PodMonitor but will try a ServiceMonitor scenario. 🙂 |
@kevinearls will be working on this sortly. |
Hi @kristinapathak Do you have an example CR I can use while working on this? I don't have much experience working with prometheus and none with a collector instance that is using it. Thanks. |
Hi @kevinearls, My setup is not public, but below is information on how I verified that the lack of ports is a problem. I've attached my servicemonitor and podmonitor configurations as well as the helm chart and configuration files for prometheus. I am running the collector as a statefulset, using the following images.
As long as prometheus and a collector are running, the pod monitor and service monitor can be applied. Once everything is up, I port forward the prometheus UI (hosted at This can be easily seen using prometheus, but the targetallocator has the same issue when prometheusCR is enabled. I find it easier to troubleshoot with the prometheus UI. I can work on making a kubernetes setup that I can share, but at least this will hopefully give you a better idea of what I'm doing. |
Hi @kevinearls, were you able to get prometheus and a pod/service monitor set up? If not, would you rather I work on this issue? |
Hi @kristinapathak Sorry, I have been tied up with other things this week. Yes, please go ahead and work on it. Thanks. |
collector.Container()
returns aContainer
that doesn't includePort
information.opentelemetry-operator/pkg/collector/container.go
Lines 88 to 98 in 7ce297d
Will this prevent the Prometheus PodMonitor from finding the collector? How can we add the port information? Are the container ports the same as
otelcol.Spec.Ports
?opentelemetry-operator/apis/v1alpha1/opentelemetrycollector_types.go
Line 98 in 7ce297d
The text was updated successfully, but these errors were encountered: