-
Notifications
You must be signed in to change notification settings - Fork 986
add method to retrieve instrumentation configuration by name #7927
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
Changes from 11 commits
18d7b03
cefce5d
afdc866
ef36c5f
4cb9863
588f9b6
1ebb4ce
5d9701c
4719add
e3a8d54
2fe03f0
3084268
3abc73e
0344ee7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,29 @@ public interface ConfigProvider { | |
| */ | ||
| DeclarativeConfigProperties getInstrumentationConfig(); | ||
|
|
||
| /** | ||
| * Returns the {@link DeclarativeConfigProperties} for a specific instrumentation by name. If no | ||
| * configuration is available for the given name, an empty {@link DeclarativeConfigProperties} is | ||
| * returned. | ||
| * | ||
| * @param name the name of the instrumentation | ||
| * @return the {@link DeclarativeConfigProperties} for the given instrumentation name | ||
| */ | ||
| default DeclarativeConfigProperties getInstrumentationConfig(String name) { | ||
| return getInstrumentationConfig().get("java").get(name); | ||
| } | ||
|
|
||
| /** | ||
| * Returns the {@link DeclarativeConfigProperties} for general instrumentation configuration. If | ||
| * the general configuration is not available, an empty {@link DeclarativeConfigProperties} is | ||
| * returned. | ||
| * | ||
| * @return the {@link DeclarativeConfigProperties} for the general instrumentation configuration | ||
| */ | ||
| default DeclarativeConfigProperties getGeneralInstrumentationConfig() { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would we be comfortable with something shorter, e.g.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about "getGeneralInstrumentation"?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I like this for general, but symmetric naming yields Not that
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe
with the idea that the "Java" is redundant for the Java SDK
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is getInstrumentation(name) too close to getInstrumentationConfig() given the difference in function?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there a way we could remove getInstrumentationConfig()? what if we added something like
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not particularly attached to it, but there's the bit about it being part of the spec. Of course the spec can be changed. But the path of least resistance for the short term is to find method names that jive with the current spec and which can be characterized as syntactic sugar. The spec doesn't prohibit syntactic sugar so it's the sweet spot where we can improve usability quickly.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I went for
now based on the feedback. Let me know what you think. |
||
| return getInstrumentationConfig().get("general"); | ||
| } | ||
|
|
||
| /** Returns a no-op {@link ConfigProvider}. */ | ||
| static ConfigProvider noop() { | ||
| return DeclarativeConfigProperties::empty; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.