opentelemetry-dotnet-contrib
opentelemetry-dotnet-contrib copied to clipboard
[Instrumentation.StackExchangeRedis] Metrics support
Fixes #1742 Design discussion issue #
Changes
Add the StackExchangeRedis Meter
Merge requirement checklist
- [x] CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
- [x] Unit tests added/updated
- [x] Appropriate
CHANGELOG.mdfiles updated for non-trivial changes - [ ] Changes in public API reviewed (if applicable)
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: tiagodaraujo / name: Tiago Araujo (45816c4440e0fea31b056c32baf899bd2d80a9be, 59264cfec63cf06b50ae4ecd1e6d5eea739ea74b, b1662bba05be85f83435ee4eb979eed59c25de6f, d343c6c14798c5224c222f7ea4d042849c716dfd, f3b1d3e869d000c67f2540dae74f20b9d32c87a3, 8d4befa5067be0734b7c910a25a9d0579163213f, eedaf7ceccb2a35ee31eb29bcbb6268c6e82403c, 254211afed9df773cd6f733ca2f77a35dec0eb72)
- :white_check_mark: login: Coelho04 / name: Pedro Miguel Almeida Coelho (b0ae03ba6d99d07db47feea851b63d816a00e475, 2fa5346b3e372b1b204f38cba0038be1a090c4c4)
New database metric semantic conventions are being worked on and should be stabilized soon. It doesn't look what was proposed in open-telemetry/opentelemetry-specification#2070 made it to the spec
You can see the current progress in the semantic convention repo: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/database/database-metrics.md
It's been requested to not implement the new metrics until they are marked as stable.
That being said, the work here is useful, as converting redis.client.request.duration to the new db.client.operation.duration looks straightforward.
Codecov Report
Attention: Patch coverage is 94.16667% with 7 lines in your changes missing coverage. Please review.
Project coverage is 70.83%. Comparing base (
71655ce) to head (067ae78). Report is 453 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #1982 +/- ##
==========================================
- Coverage 73.91% 70.83% -3.09%
==========================================
Files 267 338 +71
Lines 9615 12587 +2972
==========================================
+ Hits 7107 8916 +1809
- Misses 2508 3671 +1163
Flags with carried forward coverage won't be shown. Click here to find out more.
| Files with missing lines | Coverage Δ | |
|---|---|---|
| ...dis/StackExchangeRedisConnectionInstrumentation.cs | 98.57% <100.00%> (+1.51%) |
:arrow_up: |
| ...ExchangeRedis/StackExchangeRedisInstrumentation.cs | 100.00% <100.00%> (ø) |
|
| ...ackExchangeRedisTracerProviderBuilderExtensions.cs | 66.66% <100.00%> (ø) |
|
| ...s/Implementation/RedisProfilerEntryInstrumenter.cs | 43.97% <97.56%> (ø) |
|
| ...dis/StackExchangeRedisInstrumentationExtensions.cs | 97.22% <97.22%> (ø) |
|
| ....StackExchangeRedis/Implementation/RedisMetrics.cs | 87.50% <87.50%> (ø) |
|
| ...tackExchangeRedisMeterProviderBuilderExtensions.cs | 72.72% <72.72%> (ø) |
@matt-hensley, like you said, at least the redis.client.request.duration follows the convention.
I changed all the attributes, including the tracing ones, paying attention to the 1.26.0 db convention.
There is nothing in the convention for the queue and server time, so I suggest redis.client.queue.duration and redis.client.network.duration. They may be useful in understanding redis.client.request.duration better as it can fluctuate depending on the queue time or the waiting time for the server.
A chart to try to show the request, queue and network timeline.
client.request |---------------------------|
client.queue |----|
client.network |-------------------|
We could have the processing time on the client which would be: client.processing = client.request - client.queue - client.network. But I'll leave this one aside for discussion if you think it's relevant.
What do you think about this and what can we do next?
Thanks in advance
@tiagodaraujo, for future changes, could you please add additional commits to the PR instead of force upgrades? It is a bit easier to follow. While merging we are squashing everything to one commit.
@tiagodaraujo Thanks for working on this. Can you ensure this PR focuses on one aspect only? If the goal is add metrics support, then leave out all other changes to Activity, as that is making it hard to review. Its totally okay (and encouraged) to send those as separate, smaller PRs, so its easier to focus on this PR with just metrics only
This PR was marked stale due to lack of activity. It will be closed in 7 days.
This PR was marked stale due to lack of activity. It will be closed in 7 days.
This PR was marked stale due to lack of activity. It will be closed in 7 days.
This PR was marked stale due to lack of activity. It will be closed in 7 days.
This PR was marked stale due to lack of activity. It will be closed in 7 days.
Closed as inactive. Feel free to reopen if this PR is still being worked on.
@tiagodaraujo do you plan to proceed with this MR? This is great work! Can I help?
@POnakS unfortunately I don't have a plan to proceed. I've had a lot of difficulty moving forward with this. I hope someone will catch on to this one day. You can copy and paste, as long as it helps the community for the common interest of all.