Hi , i tried signoz self-hosted (docker), im using nestjs, but i cant see any thing in my signoz. //...
a
Hi , i tried signoz self-hosted (docker), im using nestjs, but i cant see any thing in my signoz. // tracer.ts 'use strict'; import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node'; import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http'; import { Resource } from '@opentelemetry/resources'; import { formattedLogger } from './utils/formatedLogger'; import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions'; import { ConfigService } from '@nestjs/config'; import { NodeSDK } from '@opentelemetry/sdk-node'; const logger = formattedLogger('Signoz'); /* const configService = new ConfigService(); const TRACE_ENABLED = configService.getOrThrow<boolean>('TRACE_ENABLED'); logger.debug('TRACE_ENABLED: ' + TRACE_ENABLED); if (!TRACE_ENABLED) { return; } */ // Configure the SDK to export telemetry data to SigNoz const exporterOptions = { url: 'http://adelpro.duckdns.org:4318/v1/traces', }; const traceExporter = new OTLPTraceExporter(exporterOptions); const sdk = new NodeSDK({ traceExporter, instrumentations: [ getNodeAutoInstrumentations({ '@opentelemetry/instrumentation-nestjs-core': { enabled: true }, }), ], resource: new Resource({ [SemanticResourceAttributes.SERVICE_NAME]: 'imcoder-backend', }), }); sdk.start(); // Gracefully shut down the SDK on process exit process.on('SIGTERM', () => { sdk .shutdown() .then(() => logger.log('Tracing terminated')) .catch((error) => logger.error('Error terminating tracing: ' + error)) .finally(() => process.exit(0)); }); process.on('SIGINT', () => { sdk .shutdown() .then(() => logger.log('Tracing terminated')) .catch((error) => logger.error('Error terminating tracing:' + error)) .finally(() => process.exit(0)); }); export default sdk; // main.ts ... tracer.start() ...
j
how do you run the app?
a
For the backend I'm running locally: localhost:3500, the signoz is hosted on a distant server and accessing the ui with server_address:3301, Others needed ports 4318, 4317 are open
n
Can you try using the consoleExporter and check if the traces are added to the console ?
a
Do you have any example? please
n
Use this
const traceExporter = new ConsoleSpanExporter();
ref https://github.com/open-telemetry/opentelemetry-js
a
thanks for your support, after running:
docker ps
, i found one of signoz related docker is not running, a fresh re-install and all is working perfectly
n
awesome
a
One more note, may be iy will helpful for somme one else. I previously installed docker as a snap package, yhe default Dockploy did not work with this setup. Now after installing docker using apt (from docker official documentation), it works perfectly.
👍 1