Open
Description
Component(s)
receiver/redis
What happened?
Description
The Redis receiver has multiple duration metrics that don't comply with OpenTelemetry semantic conventions for units. According to OTel guidelines: "When instruments are measuring durations, seconds (i.e. s) SHOULD be used."
Affected metrics:
redis.cmd.usec
- usesus
instead ofs
redis.latest_fork
- usesus
instead ofs
redis.db.avg_ttl
- usesms
instead ofs
Was checking out this PR when I saw @dmitryax's comment here and I found out some issues that we need to fix.
Steps to Reproduce
NA
Expected Result
All duration metrics should use seconds (s
) as the unit according to OTel guidelines:
redis.cmd.usec
should report command execution time in secondsredis.latest_fork
should report fork duration in secondsredis.db.avg_ttl
should report average TTL in seconds
Actual Result
Duration metrics report in non-standard units that don't follow OTel conventions:
redis.cmd.usec
reports in microseconds (us
)redis.latest_fork
reports in microseconds (us
)redis.db.avg_ttl
reports in milliseconds (ms
)
From metadata.yml
:
redis.cmd.usec:
enabled: false
description: Total time for all executions of this command
unit: us
sum:
value_type: int
monotonic: true
aggregation_temporality: cumulative
attributes: [cmd]
redis.latest_fork:
enabled: true
description: Duration of the latest fork operation in microseconds
unit: us
gauge:
value_type: int
redis.db.avg_ttl:
enabled: true
description: "Average keyspace keys TTL"
unit: ms
gauge:
value_type: int
attributes: [db]
Collector version
v0.128.0
Environment information
Environment
OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")
OpenTelemetry Collector configuration
Log output
NA
Additional context
NA