Skip to content

Commit

Permalink
Added OpenTelemetry detectors from resources
Browse files Browse the repository at this point in the history
This iwll help us better identify/detect resources
  • Loading branch information
saidsef committed Aug 14, 2023
1 parent 886c68b commit 9635efc
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 129 deletions.
3 changes: 2 additions & 1 deletion libs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-grpc'
const { HttpInstrumentation } = require('@opentelemetry/instrumentation-http');
const { ExpressInstrumentation } = require('@opentelemetry/instrumentation-express');
const { diag, DiagConsoleLogger, DiagLogLevel } = require('@opentelemetry/api');
const { Resource } = require('@opentelemetry/resources');
const { envDetector, processDetector, Resource } = require('@opentelemetry/resources');
const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions');
const { AwsInstrumentation } = require('@opentelemetry/instrumentation-aws-sdk');
const { PinoInstrumentation } = require('@opentelemetry/instrumentation-pino');
Expand All @@ -40,6 +40,7 @@ function setupTracing(serviceName, appName="application", endpoint=null) {
[SemanticResourceAttributes.HOST_NAME]: serviceName,
instrumentationLibrarySemanticConvention: true,
}),
resourceDetectors: [envDetector, processDetector],
});

// Configure exporter with the Collector endpoint - uses gRPC
Expand Down
Loading

0 comments on commit 9635efc

Please sign in to comment.