Skip to content

Commit

Permalink
[receiver/redis] Add missing metric units (#23573)
Browse files Browse the repository at this point in the history
**Description:**

Metric unit is required, see:
https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/cmd/mdatagen/metadata-schema.yaml#L72-L73.

This PR adds the unit to metrics where this is missing:
- redis.role
- redis.cmd.calls
- redis.clients.connected
- redis.clients.blocked
- redis.keys.expired
- redis.keys.evicted
- redis.connections.received
- redis.connections.rejected
- redis.memory.fragmentation_ratio
- redis.rdb.changes_since_last_save
- redis.commands.processed
- redis.keyspace.hits
- redis.keyspace.misses
- redis.slaves.connected
- redis.db.keys
- redis.db.expires
  • Loading branch information
mackjmr committed Jul 18, 2023
1 parent ad11157 commit f4d0426
Show file tree
Hide file tree
Showing 6 changed files with 179 additions and 128 deletions.
38 changes: 38 additions & 0 deletions .chloggen/add-units-to-redisreceiver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Use this changelog template to create an entry for release notes.
# If your change doesn't affect end users, such as a test fix or a tooling change,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: redisreceiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Adds unit to metrics where this was missing.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [23573]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext: |
Affected metrics can be found below.
- redis.role
- redis.cmd.calls
- redis.clients.connected
- redis.clients.blocked
- redis.keys.expired
- redis.keys.evicted
- redis.connections.received
- redis.connections.rejected
- redis.memory.fragmentation_ratio
- redis.rdb.changes_since_last_save
- redis.commands.processed
- redis.keyspace.hits
- redis.keyspace.misses
- redis.slaves.connected
- redis.db.keys
- redis.db.expires
32 changes: 16 additions & 16 deletions receiver/redisreceiver/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ Number of clients pending on a blocking call

| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
| ---- | ----------- | ---------- | ----------------------- | --------- |
| | Sum | Int | Cumulative | false |
| {client} | Sum | Int | Cumulative | false |

### redis.clients.connected

Number of client connections (excluding connections from replicas)

| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
| ---- | ----------- | ---------- | ----------------------- | --------- |
| | Sum | Int | Cumulative | false |
| {client} | Sum | Int | Cumulative | false |

### redis.clients.max_input_buffer

Expand Down Expand Up @@ -58,23 +58,23 @@ Total number of commands processed by the server

| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
| ---- | ----------- | ---------- | ----------------------- | --------- |
| | Sum | Int | Cumulative | true |
| {command} | Sum | Int | Cumulative | true |

### redis.connections.received

Total number of connections accepted by the server

| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
| ---- | ----------- | ---------- | ----------------------- | --------- |
| | Sum | Int | Cumulative | true |
| {connection} | Sum | Int | Cumulative | true |

### redis.connections.rejected

Number of connections rejected because of maxclients limit

| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
| ---- | ----------- | ---------- | ----------------------- | --------- |
| | Sum | Int | Cumulative | true |
| {connection} | Sum | Int | Cumulative | true |

### redis.cpu.time

Expand Down Expand Up @@ -110,7 +110,7 @@ Number of keyspace keys with an expiration

| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| | Gauge | Int |
| {key} | Gauge | Int |

#### Attributes

Expand All @@ -124,7 +124,7 @@ Number of keyspace keys

| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| | Gauge | Int |
| {key} | Gauge | Int |

#### Attributes

Expand All @@ -138,31 +138,31 @@ Number of evicted keys due to maxmemory limit

| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
| ---- | ----------- | ---------- | ----------------------- | --------- |
| | Sum | Int | Cumulative | true |
| {key} | Sum | Int | Cumulative | true |

### redis.keys.expired

Total number of key expiration events

| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
| ---- | ----------- | ---------- | ----------------------- | --------- |
| | Sum | Int | Cumulative | true |
| {event} | Sum | Int | Cumulative | true |

### redis.keyspace.hits

Number of successful lookup of keys in the main dictionary

| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
| ---- | ----------- | ---------- | ----------------------- | --------- |
| | Sum | Int | Cumulative | true |
| {hit} | Sum | Int | Cumulative | true |

### redis.keyspace.misses

Number of failed lookup of keys in the main dictionary

| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
| ---- | ----------- | ---------- | ----------------------- | --------- |
| | Sum | Int | Cumulative | true |
| {miss} | Sum | Int | Cumulative | true |

### redis.latest_fork

Expand All @@ -178,7 +178,7 @@ Ratio between used_memory_rss and used_memory

| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| | Gauge | Double |
| 1 | Gauge | Double |

### redis.memory.lua

Expand Down Expand Up @@ -234,7 +234,7 @@ Number of changes since the last dump

| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
| ---- | ----------- | ---------- | ----------------------- | --------- |
| | Sum | Int | Cumulative | false |
| {change} | Sum | Int | Cumulative | false |

### redis.replication.backlog_first_byte_offset

Expand All @@ -258,7 +258,7 @@ Number of connected replicas

| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
| ---- | ----------- | ---------- | ----------------------- | --------- |
| | Sum | Int | Cumulative | false |
| {replica} | Sum | Int | Cumulative | false |

### redis.uptime

Expand All @@ -284,7 +284,7 @@ Total number of calls for a command

| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
| ---- | ----------- | ---------- | ----------------------- | --------- |
| | Sum | Int | Cumulative | true |
| {call} | Sum | Int | Cumulative | true |

#### Attributes

Expand Down Expand Up @@ -320,7 +320,7 @@ Redis node's role

| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
| ---- | ----------- | ---------- | ----------------------- | --------- |
| | Sum | Int | Cumulative | false |
| {role} | Sum | Int | Cumulative | false |

#### Attributes

Expand Down
32 changes: 16 additions & 16 deletions receiver/redisreceiver/internal/metadata/generated_metrics.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f4d0426

Please sign in to comment.