softwaremill / sttp

The Scala HTTP client you always wanted!
https://sttp.softwaremill.com
Apache License 2.0
1.46k stars 309 forks source link

Add OpenTelemetry attributes to the metrics backend #2292

Closed adamw closed 1 month ago

adamw commented 2 months ago

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 commented 1 month ago

/bounty $500

algora-pbc[bot] commented 1 month ago

💎 $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 bounty • Share on socials

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

@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
iRevive commented 1 month ago

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:

adamw commented 1 month ago

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

adamw commented 1 month ago

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! :)

algora-pbc[bot] commented 1 month ago

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

algora-pbc[bot] commented 1 month ago

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