-
Notifications
You must be signed in to change notification settings - Fork 897
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
Add redis metrics semantic conventions #2547
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Instrumenting Redis | ||
|
||
**Status**: [Experimental](../../../document-status.md) | ||
|
||
This document defines how to apply semantic conventions when instrumenting Redis. | ||
|
||
<!-- toc --> | ||
|
||
- [Redis Metrics](#redis-metrics) | ||
|
||
<!-- tocstop --> | ||
|
||
## Redis Metrics | ||
|
||
**Description:** General Redis metrics. | ||
|
||
| Name | Instrument | Value type | Unit | Unit ([UCUM](../README.md#instrument-units)) | Description | Attribute Key | Attribute Values | | ||
| ---------------------------------------------- | ------------- | ---------- | ------------ | -------------------------------------------- | --------------------------------------------------------------------- | ------------- | ---------------- | | ||
| db.redis.uptime | Counter | Int64 | seconds | `{s}` | Number of seconds since Redis server start | | | | ||
| db.redis.cpu.time | Counter | Double | seconds | `{s}` | System CPU consumed by the Redis server in seconds since server start | `state` | | | ||
| db.redis.clients.connected | UpDownCounter | Int64 | clients | `{clients}` | Number of client connections (excluding connections from replicas) | | | | ||
| db.redis.clients.max_input_buffer | Gauge | Int64 | | | Biggest input buffer among current client connections | | | | ||
| db.redis.clients.max_output_buffer | Gauge | Int64 | | | Longest output list among current client connections | | | | ||
| db.redis.clients.blocked | UpDownCounter | Int64 | clients | `{clients}` | Number of clients pending on a blocking call | | | | ||
| db.redis.keys.expired | Counter | Int64 | keys | `{keys}` | Total number of key expiration events | | | | ||
| db.redis.keys.evicted | Counter | Int64 | keys | `{keys}` | Number of evicted keys due to maxmemory limit | | | | ||
| db.redis.connections.received | Counter | Int64 | connections | `{connections}` | Total number of connections accepted by the server | | | | ||
| db.redis.connections.rejected | Counter | Int64 | connections | `{connections}` | Number of connections rejected because of maxclients limit | | | | ||
| db.redis.memory.used | Gauge | Int64 | bytes | `{by}` | Total number of bytes allocated by Redis using its allocator | | | | ||
codeboten marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| db.redis.memory.peak | Gauge | Int64 | bytes | `{by}` | Peak memory consumed by Redis | | | | ||
codeboten marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| db.redis.memory.rss | Gauge | Int64 | bytes | `{by}` | Number of bytes that Redis allocated as seen by the operating system | | | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe this could be a more generic metric ie. |
||
| db.redis.memory.lua | Gauge | Int64 | bytes | `{by}` | Number of bytes used by the Lua engine | | | | ||
| db.redis.memory.fragmentation_ratio | Gauge | Double | | | Ratio between used_memory_rss and used_memory | | | | ||
| db.redis.rdb.changes_since_last_save | UpDownCounter | Int64 | changes | `{changes}` | Number of changes since the last dump | | | | ||
| db.redis.commands | Gauge | Int64 | operations | `{ops}/s` | Number of commands processed per second | | | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no need to have this when we have the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, the rate could be calculated from the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. then why not removing it? |
||
| db.redis.commands.processed | Counter | Int64 | operations | `{ops}` | Total number of commands processed by the server | | | | ||
| db.redis.net.input | Counter | Int64 | bytes | `{by}` | The total number of bytes read from the network | | | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. net input/output could be generalized as process metrics. |
||
| db.redis.net.output | Counter | Int64 | bytes | `{by}` | The total number of bytes written to the network | | | | ||
| db.redis.keyspace.hits | Counter | Int64 | operations | `{ops}` | The total number of successful lookup of keys in the main dictionary | | | | ||
| db.redis.keyspace.misses | Counter | Int64 | operations | `{ops}` | The total number of failed lookup of keys in the main dictionary | | | | ||
| db.redis.latest_fork | Gauge | Int64 | microseconds | `{us}` | Duration of the latest fork operation | | | | ||
| db.redis.replicas.connected | Gauge | Int64 | replicas | `{replicas}` | Number of connected replicas | | | | ||
| db.redis.replication.backlog_first_byte_offset | Gauge | Int64 | | | The master offset of the replication backlog buffer | | | | ||
| db.redis.replication.offset | Gauge | Int64 | | | The server's current replication offset | | | | ||
| db.redis.db.keys | Gauge | Int64 | keys | `{keys}` | Number of keyspace keys | `db` | | | ||
| db.redis.db.expires | Gauge | Int64 | keys | `{keys}` | Number of keyspace keys with an expiration | `db` | | | ||
| db.redis.db.avg_ttl | Gauge | Int64 | milliseconds | `{ms}` | Average keyspace keys TTL | | `db` | |
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.
Why having another metric for "cpu.time" rather than "process.cpu.time" with a "db.system" attribute on the resource?
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.
@bogdandrutu is there a guideline around when to add a new metric vs when to add a label to an existing metric? Just want to get some clarity on what other metrics we should be considering this with.
For example the connections received/rejected, uptime and all memory metrics feel like they may fall into this category as well.
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 would go this path anytime is possible :) Maybe we need some documentation about this?