De Scholar
06/25/2022, 4:38 PMtracer.ts
file is this one:
'use strict';
const opentelemetry = require('@opentelemetry/sdk-node');
const {
getNodeAutoInstrumentations,
} = require('@opentelemetry/auto-instrumentations-node');
const { OTLPTraceExporter } = require('@opentelemetry/exporter-otlp-grpc');
const { Resource } = require('@opentelemetry/resources');
const {
SemanticResourceAttributes,
} = require('@opentelemetry/semantic-conventions');
// configure the SDK to export telemetry data to the console
// enable all auto-instrumentations from the meta package
const exporterOptions = {
url: 'my IP address here with the port',
};
const traceExporter = new OTLPTraceExporter(exporterOptions);
const sdk = new opentelemetry.NodeSDK({
resource: new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: 'myServiceNameHere',
}),
traceExporter,
instrumentations: [getNodeAutoInstrumentations()],
});
// initialize the SDK and register with the OpenTelemetry API
// this enables the API to record telemetry
sdk
.start()
.then(() => console.log('Tracing initialized'))
.catch((error) => console.log('Error initializing tracing', error));
// gracefully shut down the SDK on process exit
process.on('SIGTERM', () => {
sdk
.shutdown()
.then(() => console.log('Tracing terminated'))
.catch((error) => console.log('Error terminating tracing', error))
.finally(() => process.exit(0));
});
module.exports = sdk;
On the log, I can see Tracing initialized
which means that it's starting successfully, but I still don't see it on signoz dashboard,
Is there anything that I might be missing?Blake Romano
06/25/2022, 4:52 PMDe Scholar
06/25/2022, 4:59 PMBlake Romano
06/25/2022, 5:01 PMconst exporterOptions = {
url: 'my IP address here with the port',
};
De Scholar
06/25/2022, 5:16 PMPranay