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 11, 2024
2 parents ac63400 + f05cb73 commit cc22b21
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"@opentelemetry/exporter-jaeger": "^1.19.0",
"@opentelemetry/exporter-metrics-otlp-proto": "^0.50.0",
"@opentelemetry/exporter-trace-otlp-proto": "^0.50.0",
"@opentelemetry/instrumentation-express": "^0.43.0",
"@opentelemetry/instrumentation-http": "^0.53.0",
"@opentelemetry/resources": "^1.18.1",
"@opentelemetry/sdk-metrics": "^1.18.1",
Expand Down
3 changes: 2 additions & 1 deletion src/controllers/opentelemetry.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { NodeSDK } from "@opentelemetry/sdk-node";
import { BatchSpanProcessor } from "@opentelemetry/sdk-trace-node";
import { HttpInstrumentation } from "@opentelemetry/instrumentation-http";
import { ExpressInstrumentation } from "@opentelemetry/instrumentation-express";
import { Resource } from "@opentelemetry/resources";
import Debug from "debug";
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-proto';
Expand All @@ -20,7 +21,7 @@ debug("Initializing Opentelemetry instrumentation...");
const sdk = new NodeSDK({
// metrics, if needed, shall be exported on a different endpoint
// trace a subset of instrumentations to avoid performance overhead
instrumentations: [new HttpInstrumentation()],
instrumentations: [new HttpInstrumentation(), new ExpressInstrumentation()],
resource: new Resource({
[ATTR_SERVICE_NAME]: "biothings-explorer",
}),
Expand Down
5 changes: 0 additions & 5 deletions src/controllers/threading/threadHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,6 @@ export async function runTask(req: Request, res: Response, route: string, useBul
propagation.inject(context.active(), otelData);
const { traceparent, tracestate } = otelData;

// add req dest to root span name as HTTP instrumentation doesn't do it automatically
const activeContext: Context = context.active();
const rootSpan: Span = trace.getSpan(activeContext);
if (rootSpan != undefined) rootSpan.updateName(`${req.method} ${req.originalUrl}`);

const taskInfo: TaskInfo = {
data: {
route,
Expand Down

0 comments on commit cc22b21

Please sign in to comment.