Skip to content

pinoTransport ignores "msg" field #18381

@allohamora

Description

@allohamora

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/node

SDK Version

^10.27.0

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

No response

Steps to Reproduce

  1. setup sentry in instrumentation file:
npm i @sentry/node @sentry/profiling-node
import * as Sentry from "@sentry/node";
import { nodeProfilingIntegration } from "@sentry/profiling-node";

Sentry.init({
  dsn: {{SENTRY_DSN}},
  integrations: [
    nodeProfilingIntegration(),
    Sentry.pinoIntegration(),
  ],

  // Send structured logs to Sentry
  enableLogs: true,
  // Tracing
  tracesSampleRate: 1.0, //  Capture 100% of the transactions
  // Set sampling rate for profiling - this is evaluated only once per SDK.init call
  profileSessionSampleRate: 1.0,
  // Trace lifecycle automatically enables profiling during active traces
  profileLifecycle: 'trace',
  // Setting this option to true will send default PII data to Sentry.
  // For example, automatic IP address collection on events
  sendDefaultPii: true,
});
  1. setup pino in pino file:
npm i pino pino-pretty
import { pino } from 'pino';

const logger = pino({
  transport: {
    target: 'pino-pretty',
  }
});

export const createLogger = (name: string) => {
  return logger.child({ name });
}
  1. setup index file:
import './instrument.js';
import { createLogger } from './pino.js';

const logger = createLogger('index');

logger.info({ msg: 'test' });
  1. run the index file and receive no logs in sentry dashboard

Expected Result

Logs with the "msg" key are in the dashboard

Actual Result

Logs with the "msg" aren't in the dashboard

Additional Context

Pino ecosystem uses the "msg" field to pass a message.
The current version of the pinoTransport integration just ignores it and does not render logs with this field in the dashboard

Example of usage with pino-pretty:
Image
Image

Example of code:
https://github.com/pinojs/pino/blob/8141f9e41c3286a393ae83e604645ce5891b6d62/pino.js#L56-L57

Priority

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Metadata

Metadata

Assignees

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions