Skip to content

Demonstration about the use to clarify a issue in opentelemetry-js-contrib

Notifications You must be signed in to change notification settings

jennysson-junior/demo-instrumenting-winston

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenTelemetry & Winston Trace ID Demo

This demo shows how to include traceId in Winston logs using OpenTelemetry auto-instrumentation for HTTP requests.

Setup

  1. Install dependencies:
npm install
  1. Run with auto-instrumentation:
node --require '@opentelemetry/auto-instrumentations-node/register' app.js

Expected Logs

Startup Log: Logs without traceId. Request Log: Logs with traceId due to active HTTP span.

Note on Expected Errors

You may see ECONNREFUSED errors in the console output, as OpenTelemetry is configured here only to capture the traceId and spanId in logs without connecting to an external collector. These errors can be ignored in this setup since the primary goal is to verify the presence of the traceId in log entries for testing purposes.

This configuration is intended for local development and testing and does not send telemetry data to any server.

Logs

About

Demonstration about the use to clarify a issue in opentelemetry-js-contrib

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published