-
Notifications
You must be signed in to change notification settings - Fork 3k
[redisreceiver] Fix duration unit inconsistencies to comply with OTel guidelines #40847
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
base: main
Are you sure you want to change the base?
Conversation
…ith OTel guidelines
@dmitryax / @hughesjj / @edmocosta Did you get a chance to look at this? |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Following up on this — let me know if you need anything from my side. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, few nits and one concern
recordDataPoint(ts, val) | ||
if infoKey == "latest_fork_usec" { | ||
val /= 1e6 // Convert us to s | ||
recordDataPoint(ts, val) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: given we're doing recordDataPoint
regardless, let's move the call outside of the conditional
attributes: [db] | ||
# below are all disabled by default | ||
redis.replication.replica_offset: | ||
enabled: false | ||
description: "Offset for redis replica" | ||
description: Offset for redis replica |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could we add the quotes for all these descriptions back, as they're unrelated to the change? Probably better to have quotes regardless when working with yaml, not that we lint it at all.
|
||
| Unit | Metric Type | Value Type | | ||
| ---- | ----------- | ---------- | | ||
| us | Gauge | Int | | ||
| s | Gauge | Double | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a wary of changing int into float. Is there any reason we could not floor, truncate, or round-nearest while maintaining an int instead?
@dmitryax I'll defer to you on this one. IIRC there could be some downstream issues in languages using these metrics given the type change.
I'd note the guidelines use SHOULD
and not MUST
When instruments are measuring durations, seconds (i.e. s) SHOULD be used.
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Description
Fix unit conversions for duration-based metrics to properly convert from microseconds/milliseconds to seconds
redis.cmd.usec
toredis.cmd.sec
with proper microsecond to second conversionredis.db.avg_ttl
from milliseconds to secondsredis.latest_fork
from microseconds to secondsLink to tracking issue
Fixes #40826
Testing
Documentation
CL added and config.md also updated (not autogenerated)