-
Notifications
You must be signed in to change notification settings - Fork 10
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
Use metric-schema for instrumentation metrics #1962
Conversation
Generate changelog in
|
String serviceName = Strings.isNullOrEmpty(prefix) ? interfaceClass.getName() : prefix; | ||
this.handlers.add(new TaggedMetricsServiceInvocationEventHandler(metricRegistry, serviceName)); | ||
this.handlers.add(new TaggedMetricsServiceInvocationEventHandler( | ||
metricRegistry, Strings.isNullOrEmpty(serviceName) ? interfaceClass.getSimpleName() : serviceName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've intentionally changed the default service name from interfaceClass.getName()
to interfaceClass.getSimpleName()
to more closely match the behavior of similar instrumentation elsewhere, such as the Conjure endpoint instrumentation.
|
||
@ExtendWith(SystemStubsExtension.class) | ||
@SuppressWarnings("NullAway") | ||
public class TritiumTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests seem duplicative, so I've removed them.
Directionally I'm supportive of this. @pkoenig10 do you have a sense of the migration lift for shifting from existing to new metric names & tags for monitors & queries? |
It will definitely be manual work for dashboards. I'm fairly confident that no one is using these metrics in monitors. Doing so would be fairly brittle, as the metric names could change after a refactor. Searching internally I don't see any monitor definitions that appear to be using one of these metrics. It's a bit difficult since there are a number of legacy metrics that use class names, but which aren't these instrumented metrics. I used the following Sourcegraph query (case-sensitive and regex):
|
Released 0.89.0 |
Before this PR
The tagged metrics produced by instrumented classes are cumbersome to use because each instrumented class uses a unique metric name. These metrics names are the fully qualified class names, which can be quite long making them difficult to use in metric query UIs.
It is also particularly cumbersome given our internal metrics filtering, since metrics for newly instrumented classes won't be available until they are used in a dashboard.
After this PR
Instrumentation metrics are defined in metric-schema. There is a single instrumentation metric and the interface name, method name, and result are tags.
Possible downsides?
Dashboards will need to be updated. I don't think users tend to have these instrumentation metrics on dashboards - they are more commonly used for one-off investigations.