@opentelemetry/instrumentation-redis
Advanced tools
Comparing version 0.39.0 to 0.39.1
import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation'; | ||
import { RedisInstrumentationConfig } from './types'; | ||
export declare class RedisInstrumentation extends InstrumentationBase { | ||
static readonly COMPONENT = "redis"; | ||
protected _config: RedisInstrumentationConfig; | ||
static readonly COMPONENT = "redis"; | ||
constructor(_config?: RedisInstrumentationConfig); | ||
constructor(config?: RedisInstrumentationConfig); | ||
setConfig(config?: RedisInstrumentationConfig): void; | ||
@@ -8,0 +8,0 @@ protected init(): InstrumentationNodeModuleDefinition[]; |
@@ -19,3 +19,2 @@ "use strict"; | ||
exports.RedisInstrumentation = void 0; | ||
const api_1 = require("@opentelemetry/api"); | ||
const instrumentation_1 = require("@opentelemetry/instrumentation"); | ||
@@ -28,5 +27,4 @@ const utils_1 = require("./utils"); | ||
class RedisInstrumentation extends instrumentation_1.InstrumentationBase { | ||
constructor(_config = {}) { | ||
super('@opentelemetry/instrumentation-redis', version_1.VERSION, _config); | ||
this._config = _config; | ||
constructor(config = {}) { | ||
super('@opentelemetry/instrumentation-redis', version_1.VERSION, config); | ||
} | ||
@@ -39,3 +37,2 @@ setConfig(config = {}) { | ||
new instrumentation_1.InstrumentationNodeModuleDefinition('redis', ['^2.6.0', '^3.0.0'], moduleExports => { | ||
api_1.diag.debug('Patching redis.RedisClient.internal_send_command'); | ||
if ((0, instrumentation_1.isWrapped)(moduleExports.RedisClient.prototype['internal_send_command'])) { | ||
@@ -45,3 +42,2 @@ this._unwrap(moduleExports.RedisClient.prototype, 'internal_send_command'); | ||
this._wrap(moduleExports.RedisClient.prototype, 'internal_send_command', this._getPatchInternalSendCommand()); | ||
api_1.diag.debug('patching redis.RedisClient.create_stream'); | ||
if ((0, instrumentation_1.isWrapped)(moduleExports.RedisClient.prototype['create_stream'])) { | ||
@@ -51,3 +47,2 @@ this._unwrap(moduleExports.RedisClient.prototype, 'create_stream'); | ||
this._wrap(moduleExports.RedisClient.prototype, 'create_stream', this._getPatchCreateStream()); | ||
api_1.diag.debug('patching redis.createClient'); | ||
if ((0, instrumentation_1.isWrapped)(moduleExports.createClient)) { | ||
@@ -54,0 +49,0 @@ this._unwrap(moduleExports, 'createClient'); |
export interface RedisPluginClientTypes { | ||
options?: { | ||
host: string; | ||
port: string; | ||
connection_options?: { | ||
port?: string; | ||
host?: string; | ||
}; | ||
@@ -6,0 +6,0 @@ address?: string; |
@@ -78,6 +78,6 @@ "use strict"; | ||
// Set attributes for not explicitly typed RedisPluginClientTypes | ||
if (this.options) { | ||
if (this.connection_options) { | ||
span.setAttributes({ | ||
[semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: this.options.host, | ||
[semantic_conventions_1.SEMATTRS_NET_PEER_PORT]: this.options.port, | ||
[semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: this.connection_options.host, | ||
[semantic_conventions_1.SEMATTRS_NET_PEER_PORT]: this.connection_options.port, | ||
}); | ||
@@ -84,0 +84,0 @@ } |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "0.39.0"; | ||
export declare const VERSION = "0.39.1"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -20,3 +20,3 @@ "use strict"; | ||
// this is autogenerated file, see scripts/version-update.js | ||
exports.VERSION = '0.39.0'; | ||
exports.VERSION = '0.39.1'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@opentelemetry/instrumentation-redis", | ||
"version": "0.39.0", | ||
"version": "0.39.1", | ||
"description": "Automatic OpenTelemetry instrumentation for redis package version 2 and 3", | ||
@@ -74,3 +74,3 @@ "main": "build/src/index.js", | ||
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-redis#readme", | ||
"gitHead": "96a87b48934f0afcf1fe637eed6704f35bd8e973" | ||
"gitHead": "a2e2b5a1aa2910b903829d215184c43d2107b9ac" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55521
333