lambda-node-opentelemetry
lambda-node-opentelemetry copied to clipboard
pino logs are not recieved by baselime
I am trying to setup logging to baselime using pino , I can see my traces but logs don't seem to work. In the log pannel of the trace I get the message: "There are no events matching the criteria in the selected timeframe The query didn't return any event."
this is the otel config I am using
/* eslint-disable @typescript-eslint/no-var-requires */
const { PinoInstrumentation } = require('@opentelemetry/instrumentation-pino')
const { BaselimeSDK } = require('@baselime/node-opentelemetry')
const {
getNodeAutoInstrumentations
} = require('@opentelemetry/auto-instrumentations-node')
const sdk = new BaselimeSDK({
instrumentations: [getNodeAutoInstrumentations(), new PinoInstrumentation()],
service: 'server',
baselimeKey: 'MY_KEY'
})
sdk.start()
and this is how I log
import pino from 'pino'
const logger = pino()
logger.info("posts")
In the console I can see the log being printed
{"level":30,"time":1712507245438,"pid":16972,"hostname":"DESKTOP-IE8MVRK","trace_id":"cca13668880673edd47b43217a6c984c","span_id":"2117231e1a362282","trace_flags":"01","msg":"posts"
but no logs in baselime
Hi @Mdev303,
This is the wrong repo. Have you tried our pino transport to send logs from pino to baselime?
https://github.com/baselime/pino-transport
@Ankcorn sorry for the repo, it works with the transport but because it's not exported by otel , opentelemettry will create traces for the request sending the logs and send them to baselime it's not ideal.
What do you mean by not ideal?