Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples for pino instrumentation still up-to-date? #2459

Open
cklat opened this issue Oct 1, 2024 · 0 comments
Open

Examples for pino instrumentation still up-to-date? #2459

cklat opened this issue Oct 1, 2024 · 0 comments

Comments

@cklat
Copy link

cklat commented Oct 1, 2024

Hi all,

I'm new to OpenTelemetry and 'Logging' or 'Monitoring' in general and have little to non experience yet.

My goal is to implement a logging feature with a trace-context in my NextJS app and I'd like to use Pino for the logger itself.

Now, from my current understanding, OpenTelemetry helps with the part if taking care of the trace-context, i.e. trace ids, span ids etc...
Also, for many tools and libraries there are automatic instrumentations, which, I assume, help you as well to keep track of all the trace-context ids.

Therefore, I try to follow the usage example in the documentation for the Pino Instrumentation here: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-pino#readme

First question: Is this usage example still working for a freshly installed OpenTelemetry and Pino environment?

Follow-up question: If it should still work, is it right that when copy&pasting everything up to logger.info('hi'); and receive an output somewhat like {"level":30,"time":1727782258854,"pid":379946,"hostname":"XYZ","msg":"hi"} without any trace or span id?
If so, does this mean I have to take care of creating and ending spans myself all over my app's codebase?

Thanks for your help and sorry for the relatively open questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant