Skip to content

Commit 383d377

Browse files
committed
chore: update otel env/resource detection
Mirror more closely what cloud environment injects
1 parent fdf2832 commit 383d377

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

.env.local.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,5 @@ PUBSUB_EMULATOR_HOST=localhost:8085
6969
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
7070
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
7171
OTEL_SERVICE_NAME=monitor
72+
OTEL_NODE_ENABLED_INSTRUMENTATIONS="http,knex,fs,grpc,aws-sdk,http,ioredis,knex,winston,undici,runtime-node,redis"
73+
OTEL_RESOURCE_ATTRIBUTES="service.namespace=monitor-local,service.version=0.0.1"

src/instrumentation.node.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ export async function nodeSDKBuilder() {
9898
const sdk = new NodeSDK({
9999
resource: resourceFromAttributes({
100100
[ATTR_SERVICE_NAME]: appConfig.otel.serviceName,
101-
...appConfig.otel.resourceAttributes,
102101
}),
103102
metricReaders: [
104103
new PeriodicExportingMetricReader({
@@ -126,10 +125,6 @@ export async function nodeSDKBuilder() {
126125
enabled: false,
127126
requireParentSpan: true,
128127
},
129-
"@opentelemetry/instrumentation-pg": {
130-
// Disable because we're using @opentelemetry/instrumentation-knex
131-
enabled: false,
132-
},
133128
// Node native fetch instrumentation
134129
"@opentelemetry/instrumentation-undici": {
135130
// Ignore sending anonymous telemetry to next.js
@@ -152,10 +147,6 @@ export async function nodeSDKBuilder() {
152147
return false;
153148
},
154149
},
155-
// Similar to prometheus default metrics
156-
"@opentelemetry/instrumentation-runtime-node": {
157-
enabled: true,
158-
},
159150
}),
160151
],
161152
});

0 commit comments

Comments
 (0)