Skip to content

Commit

Permalink
fix otel inner spans
Browse files Browse the repository at this point in the history
  • Loading branch information
rjawesome committed Dec 27, 2023
1 parent 635226e commit 829352a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/controllers/threading/taskHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const runTask = async ({ req, route, port, job: { jobId, queueName } = {} }) =>

span = opentelemetry.trace.getTracer('biothings-explorer-thread').startSpan(routeNames[route])
span.setAttribute("request", req.data.queryGraph);
Telemetry.setOtelContext(opentelemetry.trace.setSpan(opentelemetry.context.active(), span));
Telemetry.setOtelSpan(span);
} catch (error) {
debug("Sentry/OpenTelemetry transaction start error. This does not affect execution.");
debug(error);
Expand All @@ -95,7 +95,7 @@ const runTask = async ({ req, route, port, job: { jobId, queueName } = {} }) =>
try {
transaction.finish();
span.end();
Telemetry.removeOtelContext();
Telemetry.removeOtelSpan();
} catch (error) {
debug("Sentry/OpenTelemetry transaction finish error. This does not affect execution.");
debug(error);
Expand Down

0 comments on commit 829352a

Please sign in to comment.