You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been looking through source code and issues to try to understand how to use the sidecar injection. It looks like the annotation can be either "true" or an OpenTelemetryCollector instance name. I haven't been able to get it working yet, but I'm not sure if that's because the operator is misconfigured or my annotations are incorrect.
Here's what I've gathered from the source code and the CRD yaml
Annotations
sidecar.opentelemetry.io/inject can be one of true, false, or an instance name. I take this to mean that it can refer to a specific instance of an OpenTelemetryCollector.
Collector configuration
spec.mode can be one of
daemonset
deployment
sidecar
If set to sidecar mode it will only create an instance if it's referenced by an annotation on a Deployment.
In my case I want a custom configuration for a specific Deployment so it appears I have to create an instance of an OpelTelemetryCollector and reference it by name in the Deployment's sidecar.opentelemetry.io/inject` annotation. However, no sidecars are injected and I don't see anything interesting in the logs for the opentelemetry controller manager.
I found the problem with your example: the annotation should be part of the PodTemplate, not the Deployment. I opened a PR adding some doc about the sidecars, along with an e2e test for it.
That was indeed the problem and now my actual service is working. Thanks for the operator, it's going to make things much easier and cleaner to manage!
I've been looking through source code and issues to try to understand how to use the sidecar injection. It looks like the annotation can be either "true" or an OpenTelemetryCollector instance name. I haven't been able to get it working yet, but I'm not sure if that's because the operator is misconfigured or my annotations are incorrect.
Here's what I've gathered from the source code and the CRD yaml
Annotations
sidecar.opentelemetry.io/inject
can be one oftrue
,false
, or an instance name. I take this to mean that it can refer to a specific instance of an OpenTelemetryCollector.Collector configuration
spec.mode
can be one ofIf set to sidecar mode it will only create an instance if it's referenced by an annotation on a Deployment.
In my case I want a custom configuration for a specific Deployment so it appears I have to create an instance of an OpelTelemetryCollector and reference it by name in the Deployment's sidecar.opentelemetry.io/inject` annotation. However, no sidecars are injected and I don't see anything interesting in the logs for the opentelemetry controller manager.
Should the following work?
The text was updated successfully, but these errors were encountered: