Skip to content

Commit

Permalink
fix: fixing merge
Browse files Browse the repository at this point in the history
  • Loading branch information
InesNi committed Feb 28, 2024
1 parent fa55049 commit 087a1c3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

const debug = require('debug')('plugin:publish-metrics:open-telemetry');
const { vendorTranslators } = require('./translators/vendor-otel');
const {
diag,
Expand Down Expand Up @@ -119,6 +118,22 @@ class OTelReporter {
}
}
}
debug(msg) {
if (this.traceDebug) {
this.traceDebug(msg);
}
if (this.metricDebug) {
this.metricDebug(msg);
}
}
warnIfDuplicateTracesConfigured(configList) {
const tracesConfigs = configList.filter((config) => config.traces);
if (tracesConfigs.length > 1) {
console.warn(
'WARNING: Multiple reporters configured for traces. Currently, you can only use one reporter at a time for reporting traces. Only the first reporter will be used.'
);
}
}
translateToOtel(config) {
return vendorTranslators[config.type](config);
}
Expand All @@ -138,7 +153,7 @@ class OTelReporter {
}

// Waiting for flush period to complete here rather than in trace/metric reporters
debug('Waiting for flush period to end');
this.debug('Waiting for flush period to end');
await new Promise((resolve) => setTimeout(resolve, 10000));

if (this.metricReporter) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,6 @@ class OTelTraceBase {
}

this.debug('Pending traces done');
this.debug('Waiting for flush period to complete');
await sleep(5000);
}
}

Expand Down

0 comments on commit 087a1c3

Please sign in to comment.