Add service name for tracing
This commit is contained in:
parent
04dea9021d
commit
49f14889b8
@ -24,6 +24,7 @@
|
|||||||
"@opentelemetry/auto-instrumentations-node": "^0.35.0",
|
"@opentelemetry/auto-instrumentations-node": "^0.35.0",
|
||||||
"@opentelemetry/exporter-trace-otlp-grpc": "^0.34.0",
|
"@opentelemetry/exporter-trace-otlp-grpc": "^0.34.0",
|
||||||
"@opentelemetry/sdk-node": "^0.34.0",
|
"@opentelemetry/sdk-node": "^0.34.0",
|
||||||
|
"@opentelemetry/semantic-conventions": "^1.8.0",
|
||||||
"@prisma/client": "^4.0.0",
|
"@prisma/client": "^4.0.0",
|
||||||
"@sentry/node": "^7.7.0",
|
"@sentry/node": "^7.7.0",
|
||||||
"@sentry/tracing": "^7.7.0",
|
"@sentry/tracing": "^7.7.0",
|
||||||
|
@ -4,6 +4,8 @@ import * as opentelemetry from '@opentelemetry/sdk-node';
|
|||||||
import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node';
|
import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node';
|
||||||
import { diag, DiagConsoleLogger, DiagLogLevel } from '@opentelemetry/api';
|
import { diag, DiagConsoleLogger, DiagLogLevel } from '@opentelemetry/api';
|
||||||
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-grpc';
|
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-grpc';
|
||||||
|
import { Resource } from '@opentelemetry/resources';
|
||||||
|
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
|
||||||
import process from 'process';
|
import process from 'process';
|
||||||
|
|
||||||
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.INFO);
|
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.INFO);
|
||||||
@ -13,6 +15,11 @@ const sdk = new opentelemetry.NodeSDK({
|
|||||||
url: process.env.OPENTELEMETRY_OTLP_URI,
|
url: process.env.OPENTELEMETRY_OTLP_URI,
|
||||||
headers: {}
|
headers: {}
|
||||||
}),
|
}),
|
||||||
|
resource: new Resource({
|
||||||
|
[SemanticResourceAttributes.SERVICE_NAME]: 'bayshore',
|
||||||
|
[SemanticResourceAttributes.DEPLOYMENT_ENVIRONMENT]:
|
||||||
|
process.env.NODE_ENV !== undefined ? process.env.NODE_ENV : 'development',
|
||||||
|
}),
|
||||||
instrumentations: [getNodeAutoInstrumentations()]
|
instrumentations: [getNodeAutoInstrumentations()]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -686,7 +686,7 @@
|
|||||||
"@opentelemetry/sdk-trace-base" "1.8.0"
|
"@opentelemetry/sdk-trace-base" "1.8.0"
|
||||||
semver "^7.3.5"
|
semver "^7.3.5"
|
||||||
|
|
||||||
"@opentelemetry/semantic-conventions@1.8.0", "@opentelemetry/semantic-conventions@^1.0.0":
|
"@opentelemetry/semantic-conventions@1.8.0", "@opentelemetry/semantic-conventions@^1.0.0", "@opentelemetry/semantic-conventions@^1.8.0":
|
||||||
version "1.8.0"
|
version "1.8.0"
|
||||||
resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.8.0.tgz#fe2aa90e6df050a11cd57f5c0f47b0641fd2cad3"
|
resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.8.0.tgz#fe2aa90e6df050a11cd57f5c0f47b0641fd2cad3"
|
||||||
integrity sha512-TYh1MRcm4JnvpqtqOwT9WYaBYY4KERHdToxs/suDTLviGRsQkIjS5yYROTYTSJQUnYLOn/TuOh5GoMwfLSU+Ew==
|
integrity sha512-TYh1MRcm4JnvpqtqOwT9WYaBYY4KERHdToxs/suDTLviGRsQkIjS5yYROTYTSJQUnYLOn/TuOh5GoMwfLSU+Ew==
|
||||||
|
Loading…
Reference in New Issue
Block a user