2023-08-03 07:15:22 +00:00
|
|
|
import { NodeSDK } from "@opentelemetry/sdk-node";
|
|
|
|
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
|
|
|
|
import { Resource } from "@opentelemetry/resources";
|
|
|
|
import { SemanticResourceAttributes } from "@opentelemetry/semantic-conventions";
|
|
|
|
import { SimpleSpanProcessor } from "@opentelemetry/sdk-trace-node";
|
2023-08-03 07:58:12 +00:00
|
|
|
import { trace } from "@opentelemetry/api";
|
2023-08-03 07:15:22 +00:00
|
|
|
|
|
|
|
const sdk = new NodeSDK({
|
|
|
|
resource: new Resource({
|
|
|
|
[SemanticResourceAttributes.SERVICE_NAME]: "saleor.app.search",
|
|
|
|
}),
|
|
|
|
spanProcessor: new SimpleSpanProcessor(new OTLPTraceExporter()),
|
|
|
|
});
|
|
|
|
|
|
|
|
sdk.start();
|
2023-08-03 07:58:12 +00:00
|
|
|
|
|
|
|
export const tracer = trace.getTracer("saleor.app.search");
|