Last active
October 1, 2025 18:22
-
-
Save rohit1kumar/f7473bd9af7ff35f3a35dd53ef078121 to your computer and use it in GitHub Desktop.
signoz setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| OTEL_LOG_LEVEL=debug OTEL_SERVICE_NAME=my_app OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=http://ip:4318/v1/logs OTEL_RESOURCE_ATTRIBUTES="service.name=my_app,service.version=1.2.3" node -r ./tracing.js app.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "dependencies": { | |
| "@opentelemetry/auto-instrumentations-node": "^0.64.1", | |
| "@opentelemetry/exporter-trace-otlp-http": "^0.205.0", | |
| "@opentelemetry/sdk-node": "^0.205.0", | |
| "pino": "^9.11.0", | |
| "pino-opentelemetry-transport": "^1.1.0" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict' | |
| const process = require('process') | |
| const opentelemetry = require('@opentelemetry/sdk-node') | |
| const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node') | |
| const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-http') | |
| const exporterOptions = { | |
| url: 'http://my-ip:4318/v1/traces', | |
| } | |
| const traceExporter = new OTLPTraceExporter(exporterOptions) | |
| const sdk = new opentelemetry.NodeSDK({ | |
| traceExporter, | |
| instrumentations: [getNodeAutoInstrumentations()], | |
| }) | |
| sdk.start() | |
| process.on('SIGTERM', () => { | |
| sdk | |
| .shutdown() | |
| .then(() => console.log('Tracing terminated')) | |
| .catch((error) => console.log('Error terminating tracing', error)) | |
| .finally(() => process.exit(0)) | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment