open-telemetry / opentelemetry-dotnet-contrib

This repository contains set of components extending functionality of the OpenTelemetry .NET SDK. Instrumentation libraries, exporters, and other components can find their home here.
https://opentelemetry.io
Apache License 2.0
449 stars 273 forks source link

Support for HTTP Client Request/Response Body Size Metrics #1760

Open ilhesam opened 6 months ago

ilhesam commented 6 months ago

Hi dears, I'm proposing the addition of instrumentation to measure HTTP client request and response body sizes, as outlined in the OpenTelemetry semantic conventions for HTTP metrics. These metrics are crucial for understanding the data volume being transferred, aiding in performance optimization and monitoring.

Is this feature aligned with the project's roadmap? Any specific implementation preferences or requirements from the maintainers?

I am eager to contribute to the development of this feature. With experience in .NET and open-source contributions, I'm ready to collaborate to bring this to fruition.

Looking forward to your feedback and the possibility of contributing to this enhancement. Best, Hesam

martinjt commented 6 months ago

So this is currently an Experimental spec for those stats. So it's a little more interesting of a requirement.

Ultimately, those should come from runtime, but I have no idea whether they'll be doing them in .NET 9 or not since we have no timeline as to when they'll be stable in Otel.

I think it would be interesting to see what the implementation would look like, but it would need to be behind an experimental flag. There is also the issue that it could be a performance issue.

I don't see a reason we wouldn't accept it as a PR, however, I would say that the bar for performance impact on that would be very high seeing as it's critical path.

As it stands, I don't know anyone working on it, so if you wanted to give it a go, I don't see an issue with that.