Skip to content

Commit

Permalink
chore: reduce local run logging noise. (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
tjholm authored Jul 20, 2023
2 parents 08f89fe + 6f91745 commit 056f4f7
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/faas/v0/traceProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
ConsoleSpanExporter,
BatchSpanProcessor,
NodeTracerProvider,
NoopSpanProcessor,
} from '@opentelemetry/sdk-trace-node';
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
import { Resource } from '@opentelemetry/resources';
Expand Down Expand Up @@ -51,13 +52,13 @@ const newTracerProvider = (): NodeTracerProvider => {
tracerProvider: provider,
});

const traceExporter = localRun // If running locally
? new ConsoleSpanExporter()
: new OTLPTraceExporter({
url: 'http://localhost:4317',
});

const processor = new BatchSpanProcessor(traceExporter);
const processor = localRun
? new NoopSpanProcessor()
: new BatchSpanProcessor(
new OTLPTraceExporter({
url: 'http://localhost:4317',
})
);

provider.addSpanProcessor(processor);
provider.register();
Expand Down

0 comments on commit 056f4f7

Please sign in to comment.