Skip to content
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

Help needed: Is there a way to supply instrumentation kwargs when using auto instrumentation? #1687

Closed
danw-mpl opened this issue Feb 22, 2023 · 4 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed instrumentation

Comments

@danw-mpl
Copy link

I'm using opentelemetry-instrument.

I want to be able to set a kwarg to enable Redis sanitisation: #1572

Is there any way to supply kwargs to opentelemetry-instrument? Environment variables would be a huge bonus.

@srikanthccv
Copy link
Member

Not possible currently. Feel free to send a PR for adding support with env OTEL_PYTHON_INSTRUMENTATION_SANITIZE_REDIS.

@srikanthccv srikanthccv added good first issue Good for newcomers help wanted Extra attention is needed instrumentation labels Feb 23, 2023
@danw-mpl
Copy link
Author

No worries, just checking!

@iTaybb
Copy link

iTaybb commented Jul 6, 2023

I'm thinking about writing some generic solution for that.
So OTEL_PYTHON_{INSTRUMENT}_{ARG} will be passed automatically.
That way we won't have to implement ENV solution for each and each argument.

For example, OTEL_PYTHON_PYMONGO_CAPTURE_STATEMENT=true will instrument the pymongo instrumentation with {'capture_statement': True}.

@srikanthccv What do you say? Should I open a PR for that?

@srikanthccv
Copy link
Member

It may work sometimes, but I think any attempt at a generic solution will likely fail when the args are diverse and non-trivial. A configuration schema is in progress to solve this kind of problem: https://github.com/open-telemetry/opentelemetry-configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed instrumentation
Projects
None yet
Development

No branches or pull requests

3 participants