How do i view the traces exported to OTLP exporter #5534
-
I have a simple express app running locally, configured to export traces to the OTLP eXPORTED const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-http');
const { SimpleSpanProcessor } = require('@opentelemetry/sdk-trace-base');
const exporter = new OTLPTraceExporter({
// optional - url default value is http://localhost:55681/v1/traces
url: 'http://localhost:55681/v1/traces',
// optional - collection of custom headers to be sent with each request, empty by default
headers: {},
});
// For troubleshooting, set the log level to DiagLogLevel.DEBUG
// diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.INFO);
const sdk = new opentelemetry.NodeSDK({
traceExporter: exporter,
spanProcessor: new SimpleSpanProcessor(exporter),
instrumentations: [getNodeAutoInstrumentations()],
});
sdk.start(); I've previously tried printing the traces to stdout using the console exported and have confirmed it works, however, now that i'm exporting to the OTLPExporter, I can't figure out how to actually view the traces |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 7 replies
-
Do you deploy otel collector to receiver those traces? If so, what is the configuration file of the otel collector? |
Beta Was this translation helpful? Give feedback.
-
According to your config file, the exporter you used is As the documents said
So in my opinion, the traces data that collector received should output to collector's stdout. You can check the stdout of your collector. By the way, I read about the code details about how logging exporter consume the traces data. opentelemetry-collector/exporter/loggingexporter/logging_exporter.go Lines 42 to 54 in 277f98e I find that if loglevel is set to INFO, you can only see the content output to stdout just like this
So if you want to see the origin content of your trace data, you should change the configuration to
I have not tested the above thought by myself, you can test as I suggest to clarify it :) |
Beta Was this translation helpful? Give feedback.
-
should be
Try this way again. if it still does not work, can you share the stdout of collector to me? |
Beta Was this translation helpful? Give feedback.
-
Please change the discussion into Answered. :) |
Beta Was this translation helpful? Give feedback.
should be
logLevel
is not right key. The right name isloglevel
.Try this way again. if it still does not work, can you share the stdout of collector to me?