Skip to content

Commit

Permalink
Merge pull request #148 from osstotalsoft/feature/ContradictoryOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
DCosti authored Nov 8, 2024
2 parents 9183c68 + f6786c7 commit e15ee54
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const messagingEnvelopeHeaderSpanTagPrefix = "pubSub_header";
const { trace, context, propagation, SpanKind, SpanStatusCode } = require("@opentelemetry/api");
const { correlationManager } = require("@totalsoft/correlation");
<%_ if(withMultiTenancy){ _%>
const { tenantContextAccessor } = require("@totalsoft/multitenancy-core");
<%_}_%>
const attributeNames = require("../../constants/tracingAttributes");
const { SemanticAttributes } = require("@opentelemetry/semantic-conventions");

Expand All @@ -12,8 +14,10 @@ const tracingPublish = async (ctx, next) => {
const span = tracer.startSpan(`${ctx.clientTopic} send`, {
attributes: {
[SemanticAttributes.MESSAGE_BUS_DESTINATION]: ctx.topic,
[attributeNames.correlationId]: correlationManager.getCorrelationId(),
[attributeNames.correlationId]: correlationManager.getCorrelationId()
<%_ if(withMultiTenancy){ _%>,
[attributeNames.tenantId]: tenantContextAccessor.getTenantContext()?.tenant?.id
<%_}_%>
},
kind: SpanKind.PRODUCER
});
Expand Down

0 comments on commit e15ee54

Please sign in to comment.