Skip to content
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 database semantic convention section and redis server metrics #2070

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions specification/metrics/semantic_conventions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
The following semantic conventions surrounding metrics are defined:

* [HTTP](http-metrics.md): For HTTP client and server metrics.
* [Database](database-metrics.md): For SQL and NoSQL metrics.
* [System](system-metrics.md): For standard system metrics.
* [Process](process-metrics.md): For standard process metrics.
* [Runtime Environment](runtime-environment-metrics.md): For runtime environment metrics.
Expand Down
44 changes: 44 additions & 0 deletions specification/metrics/semantic_conventions/database-metrics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Semantic conventions for database metrics

**Status**: [Experimental](../../document-status.md)

<!-- Re-generate TOC with `markdown-toc --no-first-h1 -i` -->

<!-- toc -->

- [Redis](#redis)

<!-- tocstop -->

## Redis

The following describes the recommended metric names, instruments and units used to describe Redis server metrics.

| Name | Instrument | Units | Description | Attribute Keys | Attributes |
|-------------------------------|----------------------------|--------------|-------------|-|-|
|`redis.uptime`|Asynchronous Counter|seconds|Number of seconds since Redis server start|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an OTEP about uptime monitoring with active debate, see
. open-telemetry/oteps#185

|`redis.cpu.time`|Asynchronous Counter|seconds|CPU consumed by the Redis server in seconds since server start| `state` | `system`, `user`, `children`|
|`redis.clients.connected`|Asynchronous UpDownCounter||Number of client connections (excluding connections from replicas)| | |
|`redis.clients.max_input_buffer`|Asynchronous Gauge||Biggest input buffer among current client connections| | |
|`redis.clients.max_output_buffer`|Asynchronous Gauge||Biggest output list among current client connections| | |
Comment on lines +21 to +23
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These three lines are begging us to finish a specification for what Prometheus calls GaugeHistogram. There would be two asynchronous histograms for input and output buffer sizes, their counts == number of connections, their sums == total input/output size, their min and max describing the smallest and largest input/output buffers, and so on.

Since that's unlikely to happy soon, this is fine.

|`redis.clients.blocked`|Asynchronous Counter||Number of clients pending on a blocking call| | |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like UpDownCounter.

|`redis.keys.expired`|Asynchronous Counter||Total number of key expiration events| | |
|`redis.keys.evicted`|Asynchronous Counter||Total number of evicted keys due to maxmemory limit| | |
|`redis.connections.received`|Asynchronous Counter||Total number of connections accepted by the server| | |
|`redis.connections.rejected`|Asynchronous Counter||Total number of connections rejected because of maxclients limit| | |
|`redis.memory.used`|Asynchronous Gauge|bytes|Total number of bytes allocated by Redis using its allocator| | |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like UpDownCounter.

|`redis.memory.peak`|Asynchronous Gauge|bytes|Peak memory consumed| | |
|`redis.memory.rss`|Asynchronous Gauge|bytes|Number of bytes that Redis allocated as seen by the operating system| | |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like UpDownCounter.

|`redis.memory.lua`|Asynchronous Gauge|bytes|Number of bytes used by the Lua engine| | |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like UpDownCounter.

|`redis.memory.fragmentation_ratio`|Asynchronous Gauge||Ratio between used_memory_rss and used_memory| | |
|`redis.rdb.changes_since_last_save`|Asynchronous UpDownCounter||Number of changes since the last dump| | |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like Synchronous UpDownCounter.

|`redis.commands`|Asynchronous Gauge|operations per second|Number of commands processed per second| | |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest removing this, it's defined by the rate of redis.commands.processed.

|`redis.commands.processed`|Asynchronous Counter||Total number of commands processed by the server| | |
|`redis.net.input`|Asynchronous Counter|bytes|The total number of bytes read from the network| | |
|`redis.net.output`|Asynchronous Counter|bytes|The total number of bytes written to the network| | |
Comment on lines +37 to +38
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

|`redis.keyspace.hits`|Asynchronous Counter||Number of successful lookup of keys in the main dictionary| | |
|`redis.keyspace.misses`|Asynchronous Counter||Number of failed lookup of keys in the main dictionary| | |
|`redis.latest_fork`|Asynchronous Gauge|microseconds|Duration of the latest fork operation| | |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be redis.latest_fork.duration?

|`redis.slaves.connected`|Asynchronous UpDownCounter||Number of connected replicas| | |
|`redis.replication.backlog_first_byte_offset`|Asynchronous Gauge||The master offset of the replication backlog buffer| | |
|`redis.replication.offset`|Asynchronous Gauge||The server's current replication offset| | |