sttp icon indicating copy to clipboard operation
sttp copied to clipboard

Add OpenTelemetry attributes to the metrics backend

Open adamw opened this issue 1 year ago • 5 comments

Currently the OpenTelemetryMetricsBackend reports a number of metrics, following the naming conventions of OpenTelemetry.

However, we only report raw metric values, without any of the attributes as defined here.

The goal of this issue is to report the metrics along with the required attributes. Optionally, we might include other attributes, if this is feasible and "makes sense".

The abstractions currently present in OpenTelemetryMetricsBackend might need updating/extending/refactoring; since this targets version 4 (yet unreleased), there are no compatibility requirements.

adamw avatar Sep 23 '24 08:09 adamw

/bounty $500

adamw avatar Oct 16 '24 10:10 adamw

💎 $500 bounty • SoftwareMill

Steps to solve:

  1. Start working: Comment /attempt #2292 with your implementation plan
  2. Submit work: Create a pull request including /claim #2292 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to softwaremill/sttp!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🟢 @varshith257 Oct 16, 2024, 1:10:58 PM #2327

algora-pbc[bot] avatar Oct 16 '24 10:10 algora-pbc[bot]

@adamw I have experience with OTEL and my experience through an internship and contributions to OTEL and Jaeger. I am throwing my hat to crack this /attempt #2292

Algora profile Completed bounties Tech Active attempts Options
@varshith257 16 bounties from 8 projects
Scala, Rust,
TypeScript & more
Cancel attempt

varshith257 avatar Oct 16 '24 13:10 varshith257

The goal of this issue is to report the metrics along with the required attributes

(copy-paste from https://github.com/softwaremill/tapir/issues/4057).

You can use OpenTelemetry semantic conventions to generate specs and use them in tests to ensure all required attributes are in place.

Here are a few examples:

  • https://github.com/typelevel/otel4s/pull/773 - metric specs generator in otel4s
  • https://github.com/typelevel/otel4s/blob/main/semconv/metrics/stable/src/main/scala/org/typelevel/otel4s/semconv/metrics/HttpMetrics.scala - generated spec
  • https://github.com/http4s/http4s-otel4s-middleware/pull/129/files#diff-3f8cb430fb564f7ac7cc04d5658720b1566be69f3dddaac00721f7a69955cb3aR156-R182 - the test itself

iRevive avatar Oct 16 '24 13:10 iRevive

@iRevive thanks, this looks interesting. @varshith257 if we could use this somehow to simplify / automate the testing, that would be great

adamw avatar Oct 16 '24 19:10 adamw

As we are getting first PRs for the bounties, I've published our "How to prepare a good PR" guide. I should have probably done this right away, sorry! :)

adamw avatar Oct 21 '24 10:10 adamw

💡 @varshith257 submitted a pull request that claims the bounty. You can visit your bounty board to reward.

algora-pbc[bot] avatar Oct 25 '24 14:10 algora-pbc[bot]

🎉🎈 @varshith257 has been awarded $500! 🎈🎊

algora-pbc[bot] avatar Oct 30 '24 11:10 algora-pbc[bot]