-
Notifications
You must be signed in to change notification settings - Fork 459
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
OpenTelemetryCollector ClusterIP and Headless Service are indistinguishable to a LabelSelector #898
Comments
I've got the same problem :
Resources created :
|
I plan to work on this. I'm not sure if the headless service is always needed? Regardless, I think we still need to add a label. |
I think the headless service is there because there's (I read somewhere) an advantage to using gRPC's load-balancing over k8s' load balancing when using the the gRPC exporter to feed the collector. See #595 for discussion/proposed documentation of this, but note that it didn't actually achieve consensus. For the record, the workaround we used was to change the Prometheus exporter to use port 8888, (and moved the internal Prometheus feed to 8889 which doesn't need to be exposed because we scrape that in the same collector to include it in our general metrics feed), and then pointed the ServiceMonitor at the |
+1 to this. A simple fix would be just changing the |
Our use-case is running the Prometheus metrics exporter in the OpenTelemetry Operator-created OpenTelemetry Collector Deployment.
To activate this, we expected to create an
OpenTelemetryCollector
object, which comes with aService
, and then we create aServiceMonitor
which uses aLabelSelector
to match thatService
; then Prometheus Operator extracts theEndpoints
from the selected Service, and configures Prometheus to scrape them.However, OpenTelemetry Operator is creating two Services (ClusterIP and headless) and there are no distinctions in the labels, only the name and one extra annotation. This causes Prometheus to see two scrape targets for each Pod in the Deployment, distinguished only by the resulting
job
andservice
labels (and hence distinct metrics with duplicate data).The simplest solution I see is if the headless service gets an extra specific label, e.g.,
operator.opentelemetry.io/collector-headless-service
then that could be matched usingExists
orDoesNotExist
to distinguish the two services.Edit: We were exploring using
PodMonitor
to work around this, but a colleague pointed out to me that the Pods created by OpenTelemetry Operator do not actually declare their ports, and thePodMonitor
requires a named port to scrape. So that's a no-go.The text was updated successfully, but these errors were encountered: