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

Add http.client|server.request|response.size metrics #6376

Merged
merged 1 commit into from
Jul 27, 2022

Conversation

jack-berg
Copy link
Member

Implementation of newly added metric semantic conventions for http size.

Relies on HttpCommonAttributesGetter implementations returning non-null for requestContentLength and responseContentLength. Only a few implementations provide this data at the moment, but should be able to implement reasonably in more instrumentations by retrieving the Content-Length header value.

@jack-berg jack-berg requested a review from a team as a code owner July 26, 2022 21:22
@@ -68,14 +68,16 @@ private static Set<AttributeKey> buildActiveRequestsView() {
return view;
}

static Attributes applyClientDurationView(Attributes startAttributes, Attributes endAttributes) {
static Attributes applyClientDurationAndSizeView(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open to suggestions for better names 🙂

@mateuszrzeszutek
Copy link
Member

Only a few implementations provide this data at the moment, but should be able to implement reasonably in more instrumentations by retrieving the Content-Length header value.

We could even make that the default behavior -- the HTTP getters already expose the requestHeader() and responseHeader() methods, and we're already using it to calculate the http.host attribute.

What's interesting, I've checked all the implementations of these two methods, and the only instrumentation that extracts request/response sized and doesn't get them straight from the Content-Length header (at least on the first glance) is Armeria. I think I'd be fine with just dropping these methods altogether and just relying on the headers for everything.

@trask trask merged commit c518bf8 into open-telemetry:main Jul 27, 2022
LironKS pushed a commit to helios/opentelemetry-java-instrumentation that referenced this pull request Oct 23, 2022
LironKS pushed a commit to helios/opentelemetry-java-instrumentation that referenced this pull request Oct 31, 2022
LironKS pushed a commit to helios/opentelemetry-java-instrumentation that referenced this pull request Dec 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants