-
Notifications
You must be signed in to change notification settings - Fork 944
Spans produced by OkHttp integration can include the route as part of their name #10952
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
Comments
hi @dmedinag! can you add a bit more detail on how we can get |
I'm not sure exactly how they do it, but it must be possible since Datadog does this with their java agent 🤔 |
@tylerbenson do you have any knowledge about this. Does dd really do this in the agent or perhaps is it done in the backend? |
I'm not aware of this being done for OkHttp, only for server spans with an instrumented routing framework. Like Trask, I'd be curious to learn more about how this is expected to work. I think it would also be helpful to get a code snippet of how it looks like on the OkHttp side of things. |
I've received confirmation from a dev at Datadog that they don't do this. They do have simple URL normalizers that fill the sections in question with
|
Yes this is what I meant. It's certainly not as powerful as what we can do at the server side spans, but it still opens up an important feature set IMO. Having a span with name |
Background
First off, starting from the context of the OTel specification for HTTP spans, I must say that the current OkHttp spans do adhere to it. Quoting it,
On the other hand, it's my understanding that the premise under which the standard is founded, i.e.
does not apply for OkHttp in particular, given that OkHttp interceptors provide direct access to the route before making the request.
Proposal
So my proposal here is: let's enrich the span name of client-side OkHttp spans so that they include the path group. Some examples:
GET
request to/banana
GET
GET /banana
POST
request to/customer/123
POST
POST /customer/{id}
Notes on adherence to the standard
Describe alternatives you've considered
An obvious alternative to monitoring the client-side observed latency of a target API per endpoint is to issue the metrics directly as a histogram from the client side. This is what my company's doing at the moment as an alternative and it works fine, but requires app-level instrumentation that can't be centralised (at the scale of an organisation) as easily as the collector configuration.
Why?
Other than more complete span names, the proposed solution enables granular (per endpoint) client-side latency monitoring when combined with trace-derived metrics, as generated by connectors like
spanmetrics
ordatadog
.Without this information in the span name, these metrics aggregate the data for all clients within an app, to all resources, which renders RED data useless.
The text was updated successfully, but these errors were encountered: