Skip to content

feat(redis): add support for redis v5 #2950

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
178 changes: 173 additions & 5 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions packages/instrumentation-redis/.tav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ redis:
mode: latest-minors
commands: npm run test-v2-v3
- versions:
include: '>=4 <5'
include: '>=4 <6'
# "4.6.9" was a bad release that accidentally broke node v14 support.
exclude: "4.6.9"
mode: latest-minors
commands: npm test
commands: npm run test
15 changes: 9 additions & 6 deletions packages/instrumentation-redis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![NPM Published Version][npm-img]][npm-url]
[![Apache License][license-image]][license-image]

This module provides automatic instrumentation for the [`redis`](https://github.com/NodeRedis/node_redis) module versions `>=2.6.0 <5`, which may be loaded using the [`@opentelemetry/sdk-trace-node`](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-node) package and is included in the [`@opentelemetry/auto-instrumentations-node`](https://www.npmjs.com/package/@opentelemetry/auto-instrumentations-node) bundle.
This module provides automatic instrumentation for the [`redis`](https://github.com/NodeRedis/node_redis) module versions `>=2.6.0 <6`, which may be loaded using the [`@opentelemetry/sdk-trace-node`](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-node) package and is included in the [`@opentelemetry/auto-instrumentations-node`](https://www.npmjs.com/package/@opentelemetry/auto-instrumentations-node) bundle.

If total installation size is not constrained, it is recommended to use the [`@opentelemetry/auto-instrumentations-node`](https://www.npmjs.com/package/@opentelemetry/auto-instrumentations-node) bundle with [@opentelemetry/sdk-node](`https://www.npmjs.com/package/@opentelemetry/sdk-node`) for the most seamless instrumentation experience.

Expand All @@ -17,7 +17,7 @@ npm install --save @opentelemetry/instrumentation-redis

### Supported Versions

- [`redis`](https://www.npmjs.com/package/redis) versions `>=2.6.0 <5`
- [`redis`](https://www.npmjs.com/package/redis) versions `>=2.6.0 <6`

## Usage

Expand Down Expand Up @@ -82,10 +82,13 @@ Attributes collected:
| Attribute | Short Description |
|------------------------|--------------------------------------------------------------|
| `db.connection_string` | URL to Redis server address, of the form `redis://host:port` |
| `db.statement` | Executed Redis statement |
| `db.system` | Database identifier; always `redis` |
| `net.peer.name` | Hostname or IP of the connected Redis server |
| `net.peer.port` | Port of the connected Redis server |
| `db.operation.name` | Redis command name |
| `db.operation.batch.size` | Number of commands in a Redis `MULTI/EXEC` transaction |
| `db.query.text` | The database query being executed |
| `db.system.name` | Database identifier; always `redis` |
| `server.address` | Hostname or IP of the connected Redis server |
| `server.port` | Port of the connected Redis server |


## Useful links

Expand Down
Loading
Loading