Socket
Socket
Sign inDemoInstall

@opentelemetry/instrumentation-redis

Package Overview
Dependencies
Maintainers
2
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/instrumentation-redis - npm Package Compare versions

Comparing version 0.30.0 to 0.31.0

2

build/src/version.d.ts

@@ -1,2 +0,2 @@

export declare const VERSION = "0.30.0";
export declare const VERSION = "0.31.0";
//# sourceMappingURL=version.d.ts.map

@@ -20,3 +20,3 @@ "use strict";

// this is autogenerated file, see scripts/version-update.js
exports.VERSION = '0.30.0';
exports.VERSION = '0.31.0';
//# sourceMappingURL=version.js.map
# Changelog
## [0.31.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-redis-v0.30.0...instrumentation-redis-v0.31.0) (2022-05-25)
### Features
* **instrumentation-redis:** add support for redis@^4.0.0 ([#982](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/982)) ([1da0216](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/1da0216180de694c15ec356d476f465811757ae4))
## [0.30.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-redis-v0.29.0...instrumentation-redis-v0.30.0) (2022-05-14)

@@ -4,0 +11,0 @@

{
"name": "@opentelemetry/instrumentation-redis",
"version": "0.30.0",
"description": "OpenTelemetry redis automatic instrumentation package.",
"version": "0.31.0",
"description": "Automatic OpenTelemetry instrumentation for redis package version 2 and 3",
"main": "build/src/index.js",

@@ -12,2 +12,4 @@ "types": "build/src/index.d.ts",

"test:local": "cross-env RUN_REDIS_TESTS_LOCAL=true npm run test",
"test:docker:run": "docker run --rm -d --name otel-redis -p 63790:6379 redis:alpine",
"test:docker:stop": "docker stop otel-redis",
"test-all-versions": "tav",

@@ -75,3 +77,3 @@ "test-all-versions:local": "cross-env RUN_REDIS_TESTS_LOCAL=true npm run test-all-versions",

},
"gitHead": "f89da7d080d2aaecacd8728d647e8eff4c9248a9"
"gitHead": "4fd73a42aed5c8831e5af5dc8887afa0c4fa5442"
}

@@ -21,3 +21,4 @@ # OpenTelemetry redis Instrumentation for Node.js

- `^2.6.0 || ^3.0.0` (version `4` is not yet supported)
This package supports `redis@^2.6.0` and `redis@^3.0.0`
For version `redis@^4.0.0`, please use `@opentelemetry/instrumentation-redis-4`

@@ -47,2 +48,33 @@ ## Usage

### Redis Instrumentation Options
Redis instrumentation has a few options available to choose from. You can set the following:
| Options | Type | Description |
| ----------------------- | ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `dbStatementSerializer` | `DbStatementSerializer` (function) | Redis instrumentation will serialize the command to the `db.statement` attribute using the specified function. |
| `responseHook` | `RedisResponseCustomAttributeFunction` (function) | Function for adding custom attributes on db response. Receives params: `span, moduleVersion, cmdName, cmdArgs` |
| `requireParentSpan` | `boolean` | Require parent to create redis span, default when unset is false. |
#### Custom `db.statement` Serializer
The instrumentation serializes the command into a Span attribute called
`db.statement`. The default serialization sets the attribute to the command
name, without the command arguments.
It is also possible to define a custom serialization function. The function
will receive the command name and arguments and must return a string.
Here is a simple example to serialize the command name and arguments:
```javascript
const { RedisInstrumentation } = require('@opentelemetry/instrumentation-redis');
const redisInstrumentation = new RedisInstrumentation({
dbStatementSerializer: function (cmdName, cmdArgs) {
return [cmdName, ...cmdArgs].join(" ");
},
});
```
## Useful links

@@ -49,0 +81,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc