any issues with these exporters? I'm not receiving...
# signoz-cloud
z
any issues with these exporters? I'm not receiving logs but traces are fine. Perhaps an issue with the urls. The endpoint being used: ingest.us.signoz.cloud:443
const traceExporter = new OTLPTraceExporter({
`url:
${config.exportUrl}/v1/traces
,`
headers: { "signoz-access-token": process.env.SIGNOZ_INGESTION_KEY },
});
const metricExporter = new OTLPMetricExporter({
`url:
${config.exportUrl}/v1/metrics
,`
headers: { "signoz-access-token": process.env.SIGNOZ_INGESTION_KEY },
});
const logExporter = new OTLPLogExporter({
`url:
${config.exportUrl}
,`
headers: { "signoz-access-token": process.env.SIGNOZ_INGESTION_KEY },
});
other details:
const logRecordProcessor = new logs.BatchLogRecordProcessor(logExporter);
export const sdk = new NodeSDK({
resource: resource,
traceExporter: traceExporter,
metricReader: metricReader,
logRecordProcessors: [logRecordProcessor],
instrumentations: [getNodeAutoInstrumentations()],
serviceName: config.serviceName,
});
s
What logging library are you using?
z
pino
This is my current setup:
// logger.js
import pino from "pino";
import { trace } from "@opentelemetry/api";
export const logger = pino({
transport: {
targets: [
{
target: "pino-opentelemetry-transport",
options: {
resourceAttributes: {
"service.name": "loan-monitor",
},
},
},
{
target: "pino-pretty",
level: "info",
options: {
colorize: true,
ignore: "traceId,spanId,traceFlags",
},
},
],
},
formatters: {
*log*: (_log_) => {
const currentSpan = trace.getActiveSpan();
if (currentSpan) {
const { traceId, spanId, traceFlags } = currentSpan.spanContext();
_log_.traceId = traceId;
_log_.spanId = spanId;
_log_.traceFlags = traceFlags;
}
return _log_;
},
},
});
a
@Zack is this fixed?
z
No unfortunately not. I have stepped away from it over the last couple of days.
Also I have a product improvement recommendation, perhaps worthy of discussing in a separate thread that would increase adoption dramatically.
s
pino is setting it's logger provider. I am not sure why they chose to do it that way. Ideally, they should just get the logger and emit logs. If there is no provider set by the application developer, it would just be nop. Can you remove the log processors and just set the env
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=<> OTEL_RESOURCE_ATTRIBUTES="service.name=my-service,service.version=v0.0.1"
and try again
a
hi @Zack I am all ears about
Also I have a product improvement recommendation, perhaps worthy of discussing in a separate thread that would increase adoption dramatically.
Feel free to mention me in a separate thread/write-up