Skip to content

Commit

Permalink
Merge branch 'fix-857-bte'
Browse files Browse the repository at this point in the history
  • Loading branch information
NeuralFlux committed Oct 15, 2024
2 parents cc22b21 + 17803be commit d00498c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/controllers/opentelemetry.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NodeSDK } from "@opentelemetry/sdk-node";
import { BatchSpanProcessor } from "@opentelemetry/sdk-trace-node";
import { SimpleSpanProcessor } from "@opentelemetry/sdk-trace-node";
import { HttpInstrumentation } from "@opentelemetry/instrumentation-http";
import { ExpressInstrumentation } from "@opentelemetry/instrumentation-express";
import { Resource } from "@opentelemetry/resources";
Expand All @@ -15,7 +15,7 @@ const jaegerResName = process.env.JAEGER_RES_NAME ?? '/v1/traces';
const traceExporter = new OTLPTraceExporter({
url: `http://${jaegerHost}:${jaegerPort}${jaegerResName}`
});
const spanProcessor = new BatchSpanProcessor(traceExporter);
const spanProcessor = new SimpleSpanProcessor(traceExporter);

debug("Initializing Opentelemetry instrumentation...");
const sdk = new NodeSDK({
Expand Down
3 changes: 1 addition & 2 deletions src/controllers/threading/taskHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { ProfilingIntegration } from "@sentry/profiling-node";
import { Span, trace, context, propagation, Context, Tracer } from "@opentelemetry/api";
import { Telemetry } from "@biothings-explorer/utils";
import { InnerTaskData } from "@biothings-explorer/types";
import { flushRemainingSpans } from "../opentelemetry";

// use SENTRY_DSN environment variable
try {
Expand Down Expand Up @@ -114,7 +113,7 @@ async function runTask({
transaction.finish();
span.end();
Telemetry.removeOtelSpan();
await flushRemainingSpans();
// await flushRemainingSpans(); // only needed with BatchSpanProcessor
} catch (error) {
debug("Sentry/OpenTelemetry transaction finish error. This does not affect execution.");
debug(error);
Expand Down

0 comments on commit d00498c

Please sign in to comment.