From 260d1e62746e61fa6b6f00afba5a67fb6fb4e928 Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Tue, 17 May 2022 14:39:35 -0700 Subject: [PATCH 1/3] Add redis metrics semantic conventions The following adds semantic conventions for redis metrics. --- .../instrumentation/redis.md | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 specification/metrics/semantic_conventions/instrumentation/redis.md diff --git a/specification/metrics/semantic_conventions/instrumentation/redis.md b/specification/metrics/semantic_conventions/instrumentation/redis.md new file mode 100644 index 00000000000..2d960ffee28 --- /dev/null +++ b/specification/metrics/semantic_conventions/instrumentation/redis.md @@ -0,0 +1,47 @@ +# Instrumenting Redis + +**Status**: [Experimental](../../../document-status.md) + +This document defines how to apply semantic conventions when instrumenting Redis. + + + +- [Redis Metrics](#redis-metrics) + + + +## 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 | | | +| db.redis.memory.peak | Gauge | Int64 | bytes | `{by}` | Peak memory consumed by Redis | | | +| db.redis.memory.rss | Gauge | Int64 | bytes | `{by}` | Number of bytes that Redis allocated as seen by the operating system | | | +| 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 | | | +| 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 | | | +| 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` | From 740a8f349ec25bf638368ce278280827a0cbeb48 Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Tue, 17 May 2022 14:44:18 -0700 Subject: [PATCH 2/3] update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d036a5afaad..adeb2636c02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,8 @@ release. ([#2273](https://github.com/open-telemetry/opentelemetry-specification/pull/2273)). - Specify optional support for an Exponential Histogram Aggregation. ([#2252](https://github.com/open-telemetry/opentelemetry-specification/pull/2252)) +- Add Redis metrics semantic conventions + ([#2547](https://github.com/open-telemetry/opentelemetry-specification/pull/2547)). ### Logs From eb02c4c99e16de4f22bcd853dcb341fded93dd32 Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Tue, 31 May 2022 08:27:47 -0700 Subject: [PATCH 3/3] applying review feedback --- specification/metrics/semantic_conventions/process-metrics.md | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/metrics/semantic_conventions/process-metrics.md b/specification/metrics/semantic_conventions/process-metrics.md index 2358c16aca3..aa3e2b7ebae 100644 --- a/specification/metrics/semantic_conventions/process-metrics.md +++ b/specification/metrics/semantic_conventions/process-metrics.md @@ -33,6 +33,7 @@ Below is a table of Process metric instruments. | `process.cpu.utilization` | Gauge | s | Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process. | `state`, if specified, SHOULD be one of: `system`, `user`, `wait`. A process SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels. | | `process.memory.usage` | UpDownCounter | By | The amount of physical memory in use. | | | `process.memory.virtual` | UpDownCounter | By | The amount of committed virtual memory. | | +| `process.memory.rss` | UpDownCounter | By | The resident state size of the process. | | | `process.disk.io` | Counter | By | Disk bytes transferred. | `direction` SHOULD be one of: `read`, `write` | ## Attributes