-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Adds a client tag to the default micrometer observation #2333
Adds a client tag to the default micrometer observation #2333
Conversation
micrometer/src/main/java/feign/micrometer/FeignObservationDocumentation.java
Outdated
Show resolved
Hide resolved
private void assertTags() { | ||
Id requestsId = meterRegistry.get(METER_NAME).meter().getId(); | ||
|
||
assertMetricIdIncludesMethod(requestsId); | ||
assertMetricIdIncludesURI(requestsId); | ||
assertMetricIdIncludesStatus(requestsId); | ||
assertsMetricIdIncludesClient(requestsId); | ||
} |
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.
This might not be the right place for these tests, however since they're only applicable to the micrometer observation meters adding to AbstractMetricsTestBase.java would require some changes to the dropwizard 4/5 and MicrometerCapability tests too so I've avoided that for now.
4401f37
to
3d0621b
Compare
@@ -48,14 +49,16 @@ public String getContextualName(FeignContext context) { | |||
|
|||
@Override | |||
public KeyValues getLowCardinalityKeyValues(FeignContext context) { | |||
String templatedUrl = context.getCarrier().requestTemplate().methodMetadata().template().url(); | |||
RequestTemplate requestTemplate = context.getCarrier().requestTemplate(); |
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.
Hey guys, just came across this PR, as I needed to include the client name and was writing a similar implementation, but noticed something in this change. Isn't context.getCarrier()
nullable and shouldn't we check for null
like it is done in getMethodString(@Nullable Request request)
a bit further down?
* Add client tag to default micrometer observation * Update license headers * Update tag name to clientName
* Add client tag to default micrometer observation * Update license headers * Update tag name to clientName
Include a client tag on the default feign micrometer observation, so it's added to the
http.client.requests
meters, in the same way it's added to thefeign.*
meters.This is useful for applications with more than one feign client, to avoid merging unrelated metrics, and improve observability of multiple downstreams which may have different latency etc
Opened to address #2332