@opentelemetry/instrumentation-kafkajs
Advanced tools
Comparing version 0.2.0 to 0.3.0
import { KafkaJsInstrumentationConfig } from './types'; | ||
import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation'; | ||
export declare class KafkaJsInstrumentation extends InstrumentationBase { | ||
protected _config: KafkaJsInstrumentationConfig; | ||
export declare class KafkaJsInstrumentation extends InstrumentationBase<KafkaJsInstrumentationConfig> { | ||
constructor(config?: KafkaJsInstrumentationConfig); | ||
@@ -6,0 +5,0 @@ protected init(): InstrumentationNodeModuleDefinition; |
@@ -187,3 +187,2 @@ "use strict"; | ||
_startConsumerSpan(topic, message, operation, context, link) { | ||
var _a; | ||
const span = this.tracer.startSpan(topic, { | ||
@@ -198,4 +197,5 @@ kind: api_1.SpanKind.CONSUMER, | ||
}, context); | ||
if (((_a = this._config) === null || _a === void 0 ? void 0 : _a.consumerHook) && message) { | ||
(0, instrumentation_1.safeExecuteInTheMiddle)(() => this._config.consumerHook(span, { topic, message }), e => { | ||
const { consumerHook } = this.getConfig(); | ||
if (consumerHook && message) { | ||
(0, instrumentation_1.safeExecuteInTheMiddle)(() => consumerHook(span, { topic, message }), e => { | ||
if (e) | ||
@@ -208,3 +208,3 @@ this._diag.error('consumerHook error', e); | ||
_startProducerSpan(topic, message) { | ||
var _a, _b; | ||
var _a; | ||
const span = this.tracer.startSpan(topic, { | ||
@@ -219,4 +219,5 @@ kind: api_1.SpanKind.PRODUCER, | ||
api_1.propagation.inject(api_1.trace.setSpan(api_1.context.active(), span), message.headers); | ||
if ((_b = this._config) === null || _b === void 0 ? void 0 : _b.producerHook) { | ||
(0, instrumentation_1.safeExecuteInTheMiddle)(() => this._config.producerHook(span, { topic, message }), e => { | ||
const { producerHook } = this.getConfig(); | ||
if (producerHook) { | ||
(0, instrumentation_1.safeExecuteInTheMiddle)(() => producerHook(span, { topic, message }), e => { | ||
if (e) | ||
@@ -223,0 +224,0 @@ this._diag.error('producerHook error', e); |
@@ -1,3 +0,3 @@ | ||
export declare const PACKAGE_VERSION = "0.2.0"; | ||
export declare const PACKAGE_VERSION = "0.3.0"; | ||
export declare const PACKAGE_NAME = "@opentelemetry/instrumentation-kafkajs"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -20,4 +20,4 @@ "use strict"; | ||
// this is autogenerated file, see scripts/version-update.js | ||
exports.PACKAGE_VERSION = '0.2.0'; | ||
exports.PACKAGE_VERSION = '0.3.0'; | ||
exports.PACKAGE_NAME = '@opentelemetry/instrumentation-kafkajs'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@opentelemetry/instrumentation-kafkajs", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "OpenTelemetry instrumentation for `kafkajs` messaging client for Apache Kafka", | ||
@@ -47,3 +47,3 @@ "main": "build/src/index.js", | ||
"@opentelemetry/api": "^1.3.0", | ||
"@opentelemetry/contrib-test-utils": "^0.40.0", | ||
"@opentelemetry/contrib-test-utils": "^0.41.0", | ||
"@opentelemetry/sdk-trace-base": "^1.24.0", | ||
@@ -56,3 +56,3 @@ "@types/mocha": "7.0.2", | ||
"nyc": "15.1.0", | ||
"rimraf": "5.0.5", | ||
"rimraf": "5.0.10", | ||
"sinon": "15.2.0", | ||
@@ -63,7 +63,7 @@ "ts-mocha": "10.0.0", | ||
"dependencies": { | ||
"@opentelemetry/instrumentation": "^0.52.0", | ||
"@opentelemetry/semantic-conventions": "^1.24.0" | ||
"@opentelemetry/instrumentation": "^0.53.0", | ||
"@opentelemetry/semantic-conventions": "^1.27.0" | ||
}, | ||
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/instrumentation-kafkajs#readme", | ||
"gitHead": "ad8436d6a4174f2288cb939080cd4e74da94b0d7" | ||
"gitHead": "9dc58afed8134f95908331bcff35c5d9ec46fe9a" | ||
} |
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
60157
+ Added@opentelemetry/api-logs@0.53.0(transitive)
+ Added@opentelemetry/instrumentation@0.53.0(transitive)
- Removed@opentelemetry/api-logs@0.52.1(transitive)
- Removed@opentelemetry/instrumentation@0.52.1(transitive)