Inject SDK & environment variables but do not autoinstrument with init container #2681
Labels
area:auto-instrumentation
Issues for auto-instrumentation
enhancement
New feature or request
needs-info
Component(s)
instrumentation
Is your feature request related to a problem? Please describe.
I have a use case whereby developers want to manually instrument their applications from within the code, however they also want OTEL environment variables to be autoconfigured depending on the environment/k8s cluster they are running. Currently this is not fully supported, I could use
instrumentation.opentelemetry.io/inject-sdk: "true"
, however it does not configure language specific env vars, e.g. for Python we additionally need setting up traces and metrics protocols and would be nice to avoid hardcoding these values and instead rely on OTEL operator for setting these.Describe the solution you'd like
Have an annotation with the default value of autoinstrumentation with init containers set to
true
and when set tofalse
, perform all the usual steps if injecting the SDK (e.g.injectPythonSDK()
) but without appending an init container.Describe alternatives you've considered
Another option would be to modify
areContainerNamesConfiguredForMultipleInstrumentations
to allow configurations with0
configurations.I could also potentially set the init container to some dummy no-op image conforming to filesystem structure as in autoinstrumentation images, however this seems a bit hacky.
Additional context
I can create a PR if this issue makes sense.
The text was updated successfully, but these errors were encountered: