Skip to content

Commit

Permalink
fix: deprecated kafka-avro (#1337)
Browse files Browse the repository at this point in the history
  • Loading branch information
kirrg001 authored and aryamohanan committed Oct 22, 2024
1 parent 8efdd2f commit dfd562b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion currencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@
"isBeta": false,
"ignoreUpdates": false,
"note": "",
"deprecated": false,
"deprecated": true,
"core": false
},
{
Expand Down
14 changes: 13 additions & 1 deletion packages/core/src/tracing/instrumentation/messaging/rdkafka.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,20 @@ const constants = require('../../constants');
const cls = require('../../cls');
const shimmer = require('../../shimmer');
const { getFunctionArguments } = require('../../../util/function_arguments');
let traceCorrelationEnabled = constants.kafkaTraceCorrelationDefault;
let logger;
logger = require('../../../logger').getLogger('tracing/rdkafka', newLogger => {
logger = newLogger;
});

let traceCorrelationEnabled = constants.kafkaTraceCorrelationDefault;
let isActive = false;

exports.init = function init(config) {
hook.onFileLoad(/\/node-rdkafka\/lib\/producer\.js/, instrumentProducer);
hook.onFileLoad(/\/node-rdkafka\/lib\/kafka-consumer-stream\.js/, instrumentConsumerAsStream);
hook.onModuleLoad('node-rdkafka', instrumentConsumer);

hook.onModuleLoad('kafka-avro', logDeprecationKafkaAvroMessage);
traceCorrelationEnabled = config.tracing.kafka.traceCorrelation;
};

Expand Down Expand Up @@ -359,3 +364,10 @@ function findInstanaHeaderValues(instanaHeadersAsObject) {

return { level, traceId, longTraceId, parentSpanId };
}

function logDeprecationKafkaAvroMessage() {
logger.warn(
// eslint-disable-next-line max-len
'[Deprecation Warning] The support for kafka-avro library is deprecated and might be removed in the next major release. See https://github.com/waldophotos/kafka-avro/issues/120'
);
}

0 comments on commit dfd562b

Please sign in to comment.