Socket
Socket
Sign inDemoInstall

@opentelemetry/plugin-ioredis

Package Overview
Dependencies
5
Maintainers
4
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.8.0 to 0.9.0

15

build/src/enums.d.ts

@@ -1,16 +0,1 @@

/*!
* Copyright 2019, OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export declare enum AttributeNames {

@@ -17,0 +2,0 @@ COMPONENT = "component",

5

build/src/enums.js
"use strict";
/*!
* Copyright 2019, OpenTelemetry Authors
/*
* Copyright The OpenTelemetry Authors
*

@@ -18,2 +18,3 @@ * Licensed under the Apache License, Version 2.0 (the "License");

Object.defineProperty(exports, "__esModule", { value: true });
exports.AttributeNames = void 0;
var AttributeNames;

@@ -20,0 +21,0 @@ (function (AttributeNames) {

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

/*!
* Copyright 2019, OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './ioredis';
//# sourceMappingURL=index.d.ts.map

19

build/src/index.js
"use strict";
/*!
* Copyright 2019, OpenTelemetry Authors
/*
* Copyright The OpenTelemetry Authors
*

@@ -17,7 +17,14 @@ * Licensed under the Apache License, Version 2.0 (the "License");

*/
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./ioredis"));
__exportStar(require("./ioredis"), exports);
//# sourceMappingURL=index.js.map

@@ -1,19 +0,4 @@

/*!
* Copyright 2019, OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { BasePlugin } from '@opentelemetry/core';
import * as ioredisTypes from 'ioredis';
import { IORedisPluginConfig } from './types';
import { IoredisPluginConfig } from './types';
export declare class IORedisPlugin extends BasePlugin<typeof ioredisTypes> {

@@ -24,3 +9,3 @@ readonly moduleName: string;

readonly supportedVersions: string[];
protected _config: IORedisPluginConfig;
protected _config: IoredisPluginConfig;
constructor(moduleName: string);

@@ -27,0 +12,0 @@ protected patch(): typeof ioredisTypes;

"use strict";
/*!
* Copyright 2019, OpenTelemetry Authors
/*
* Copyright The OpenTelemetry Authors
*

@@ -18,2 +18,3 @@ * Licensed under the Apache License, Version 2.0 (the "License");

Object.defineProperty(exports, "__esModule", { value: true });
exports.plugin = exports.IORedisPlugin = void 0;
const core_1 = require("@opentelemetry/core");

@@ -20,0 +21,0 @@ const shimmer = require("shimmer");

@@ -1,20 +0,5 @@

/*!
* Copyright 2019, OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/// <reference types="node" />
import * as ioredisTypes from 'ioredis';
import { PluginConfig } from '@opentelemetry/api';
export interface IORedisCommand {
export interface IoredisCommand {
reject: (err: Error) => void;

@@ -27,3 +12,3 @@ resolve: (result: {}) => void;

}
export interface IORedisPluginClientTypes {
export interface IoredisPluginClientTypes {
options: ioredisTypes.RedisOptions;

@@ -38,7 +23,7 @@ }

*/
export declare type DbStatementSerializer = (cmdName: IORedisCommand['name'], cmdArgs: IORedisCommand['args']) => string;
export declare type DbStatementSerializer = (cmdName: IoredisCommand['name'], cmdArgs: IoredisCommand['args']) => string;
/**
* Options available for the IORedis Plugin (see [documentation](https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-plugin-ioredis#ioredis-plugin-options))
*/
export interface IORedisPluginConfig extends PluginConfig {
export interface IoredisPluginConfig extends PluginConfig {
/** Custom serializer function for the db.statement tag */

@@ -45,0 +30,0 @@ dbStatementSerializer?: DbStatementSerializer;

"use strict";
/*!
* Copyright 2019, OpenTelemetry Authors
/*
* Copyright The OpenTelemetry Authors
*

@@ -5,0 +5,0 @@ * Licensed under the Apache License, Version 2.0 (the "License");

@@ -1,21 +0,6 @@

/*!
* Copyright 2019, OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as ioredisTypes from 'ioredis';
import { Tracer } from '@opentelemetry/api';
import { IORedisPluginClientTypes, IORedisCommand, IORedisPluginConfig } from './types';
export declare const traceConnection: (tracer: Tracer, original: Function) => (this: ioredisTypes.Redis & IORedisPluginClientTypes) => any;
export declare const traceSendCommand: (tracer: Tracer, original: Function, config?: IORedisPluginConfig | undefined) => (this: ioredisTypes.Redis & IORedisPluginClientTypes, cmd?: IORedisCommand | undefined) => any;
import { IoredisPluginClientTypes, IoredisCommand, IoredisPluginConfig } from './types';
export declare const traceConnection: (tracer: Tracer, original: Function) => (this: ioredisTypes.Redis & IoredisPluginClientTypes) => any;
export declare const traceSendCommand: (tracer: Tracer, original: Function, config?: IoredisPluginConfig | undefined) => (this: ioredisTypes.Redis & IoredisPluginClientTypes, cmd?: IoredisCommand | undefined) => any;
//# sourceMappingURL=utils.d.ts.map
"use strict";
/*!
* Copyright 2019, OpenTelemetry Authors
/*
* Copyright The OpenTelemetry Authors
*

@@ -18,2 +18,3 @@ * Licensed under the Apache License, Version 2.0 (the "License");

Object.defineProperty(exports, "__esModule", { value: true });
exports.traceSendCommand = exports.traceConnection = void 0;
const api_1 = require("@opentelemetry/api");

@@ -65,34 +66,36 @@ const ioredis_1 = require("./ioredis");

exports.traceSendCommand = (tracer, original, config) => {
var _a;
const dbStatementSerializer = ((_a = config) === null || _a === void 0 ? void 0 : _a.dbStatementSerializer) || defaultDbStatementSerializer;
const dbStatementSerializer = (config === null || config === void 0 ? void 0 : config.dbStatementSerializer) || defaultDbStatementSerializer;
return function (cmd) {
if (arguments.length >= 1 && typeof cmd === 'object') {
const span = tracer.startSpan(cmd.name, {
kind: api_1.SpanKind.CLIENT,
attributes: {
[enums_1.AttributeNames.COMPONENT]: ioredis_1.IORedisPlugin.COMPONENT,
[enums_1.AttributeNames.DB_TYPE]: ioredis_1.IORedisPlugin.DB_TYPE,
[enums_1.AttributeNames.DB_STATEMENT]: dbStatementSerializer(cmd.name, cmd.args),
},
});
const { host, port } = this.options;
span.setAttributes({
[enums_1.AttributeNames.PEER_HOSTNAME]: host,
[enums_1.AttributeNames.PEER_PORT]: port,
[enums_1.AttributeNames.PEER_ADDRESS]: `redis://${host}:${port}`,
});
try {
const result = original.apply(this, arguments);
endSpan(span, null);
return result;
}
catch (error) {
endSpan(span, error);
throw error;
}
if (arguments.length < 1 || typeof cmd !== 'object') {
return original.apply(this, arguments);
}
else
// Do not trace if there is not parent span
if (tracer.getCurrentSpan() === undefined) {
return original.apply(this, arguments);
}
const span = tracer.startSpan(cmd.name, {
kind: api_1.SpanKind.CLIENT,
attributes: {
[enums_1.AttributeNames.COMPONENT]: ioredis_1.IORedisPlugin.COMPONENT,
[enums_1.AttributeNames.DB_TYPE]: ioredis_1.IORedisPlugin.DB_TYPE,
[enums_1.AttributeNames.DB_STATEMENT]: dbStatementSerializer(cmd.name, cmd.args),
},
});
const { host, port } = this.options;
span.setAttributes({
[enums_1.AttributeNames.PEER_HOSTNAME]: host,
[enums_1.AttributeNames.PEER_PORT]: port,
[enums_1.AttributeNames.PEER_ADDRESS]: `redis://${host}:${port}`,
});
try {
const result = original.apply(this, arguments);
endSpan(span, null);
return result;
}
catch (error) {
endSpan(span, error);
throw error;
}
};
};
//# sourceMappingURL=utils.js.map

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

/*!
* Copyright 2019, OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export declare const VERSION = "0.8.0";
export declare const VERSION = "0.9.0";
//# sourceMappingURL=version.d.ts.map
"use strict";
/*!
* Copyright 2019, OpenTelemetry Authors
/*
* Copyright The OpenTelemetry Authors
*

@@ -18,4 +18,5 @@ * Licensed under the Apache License, Version 2.0 (the "License");

Object.defineProperty(exports, "__esModule", { value: true });
exports.VERSION = void 0;
// this is autogenerated file, see scripts/version-update.js
exports.VERSION = '0.8.0';
exports.VERSION = '0.9.0';
//# sourceMappingURL=version.js.map
{
"name": "@opentelemetry/plugin-ioredis",
"version": "0.8.0",
"version": "0.9.0",
"description": "OpenTelemetry ioredis automatic instrumentation package.",

@@ -14,4 +14,4 @@ "main": "build/src/index.js",

"clean": "rimraf build/*",
"lint": "gts check",
"lint:fix": "gts fix",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"precompile": "tsc --version",

@@ -48,28 +48,29 @@ "version:update": "node ../../../scripts/version-update.js",

"devDependencies": {
"@opentelemetry/context-async-hooks": "^0.8.3",
"@opentelemetry/node": "^0.8.3",
"@opentelemetry/test-utils": "^0.8.0",
"@opentelemetry/tracing": "^0.8.3",
"@types/ioredis": "^4.14.3",
"@types/mocha": "^7.0.0",
"@types/node": "^13.1.0",
"@types/shimmer": "^1.0.1",
"codecov": "^3.6.1",
"cross-env": "^6.0.3",
"gts": "^1.1.2",
"ioredis": "^4.14.1",
"mocha": "^7.1.2",
"nyc": "^15.0.0",
"rimraf": "^3.0.0",
"ts-mocha": "^7.0.0",
"ts-node": "^8.5.4",
"tslint-consistent-codestyle": "^1.16.0",
"tslint-microsoft-contrib": "^6.2.0",
"typescript": "3.7.4"
"@opentelemetry/context-async-hooks": "0.10.1",
"@opentelemetry/node": "0.10.1",
"@opentelemetry/test-utils": "^0.9.0",
"@opentelemetry/tracing": "0.10.1",
"@types/ioredis": "4.17.2",
"@types/mocha": "7.0.2",
"@types/node": "13.13.14",
"@types/shimmer": "1.0.1",
"codecov": "3.7.1",
"cross-env": "7.0.2",
"gts": "2.0.2",
"ioredis": "4.17.3",
"mocha": "7.2.0",
"nyc": "15.1.0",
"rimraf": "3.0.2",
"ts-mocha": "7.0.0",
"ts-node": "8.10.2",
"tslint-consistent-codestyle": "1.16.0",
"tslint-microsoft-contrib": "6.2.0",
"typescript": "3.9.6"
},
"dependencies": {
"@opentelemetry/api": "^0.8.3",
"@opentelemetry/core": "^0.8.3",
"@opentelemetry/api": "^0.10.1",
"@opentelemetry/core": "^0.10.1",
"shimmer": "^1.2.1"
}
},
"gitHead": "44dbe5bfb07e16380a297935a36c9bef109bf42e"
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc