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

What to do with instrumentation-api Config #6250

Closed
trask opened this issue Jul 1, 2022 · 4 comments · Fixed by #6360
Closed

What to do with instrumentation-api Config #6250

trask opened this issue Jul 1, 2022 · 4 comments · Fixed by #6360

Comments

@trask
Copy link
Member

trask commented Jul 1, 2022

follow-up from open-telemetry/opentelemetry-java#4563 (comment)

some options

  • only allow programmatic configuration in library instrumentation for now, and move Config to javaagent-extension-api
  • keep Config in instrumentation-api as-is
  • move Config to an internal package

(+ maybe renaming Config to InstrumentationConfig to help clarify it's only used for instrumentation configuration and not for sdk configuration)

@mateuszrzeszutek
Copy link
Member

  • only allow programmatic configuration in library instrumentation for now, and move Config to javaagent-extension-api

That would be my preferred solution (maybe even combined with making InstrumentationConfig internal) if weren't for the fact that we're still using Config internally in the instrumenter API: like here or here.
Maybe we could replace these internal usages with a very simple getSysPropOrEnvVar internal utility method in instrumentation-api? With the exception of the suppression strategy, all other config options are debugging utilities, and I think we don't really need to care about the SPI or file config for these.

@anuragagarwal561994
Copy link
Contributor

@trask how to use and get the configurations within extension InstrumentationModule?

@mateuszrzeszutek
Copy link
Member

You can use InstrumentationConfig -- it offers roughly the same functionality as Config, but it's only available in the javaagent instrumentations. It's still in an internal package, so we cannot commit to its stability, but I believe that accessing the configuration in javaagent instrumentations will always be a necessary feature, so I don't think it's ever going away -- we probably might rename it at some point in the future (although we have no such plans right now).

@anuragagarwal561994
Copy link
Contributor

Yes I thought for the same. Just because it had internal packaging I thought if it would be right to use the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants