Skip to content

Conversation

AbhiPrasad
Copy link
Member

@AbhiPrasad AbhiPrasad commented Aug 20, 2025

resolves #16659

This PR adds support for consola so that we can send logs from consola to Sentry.

// importing from browser also works - consola is isomorphic
import * as Sentry from "@sentry/node";

// Create a Sentry reporter for consola
const sentryReporter = Sentry.createConsolaReporter();

// Add the reporter to consola
consola.addReporter(sentryReporter);

// Test with arguments formatting
consola.info('Message with args:', 'hello', 123, { key: 'value' }, [1, 2, 3]);
consola.error('Error with object:', new Error('Test error'));

cursor[bot]

This comment was marked as outdated.

@AbhiPrasad AbhiPrasad force-pushed the abhi-consola-integration branch from a6c653e to 4c67e33 Compare September 10, 2025 21:35
@AbhiPrasad AbhiPrasad requested review from a team, stephanie-anderson and andreiborza and removed request for a team September 10, 2025 21:35
Copy link
Contributor

github-actions bot commented Sep 10, 2025

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 9,033 - 9,405 -4%
GET With Sentry 1,274 14% 1,244 +2%
GET With Sentry (error only) 6,076 67% 6,082 -0%
POST Baseline 1,219 - 1,194 +2%
POST With Sentry 488 40% 496 -2%
POST With Sentry (error only) 1,069 88% 1,061 +1%
MYSQL Baseline 3,361 - 3,356 +0%
MYSQL With Sentry 424 13% 410 +3%
MYSQL With Sentry (error only) 2,736 81% 2,703 +1%

View base workflow run

Comment on lines 163 to 164
* @experimental This method will experience breaking changes. This is not yet part of
* the stable Sentry SDK API and can be changed or removed without warning.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this just a precaution for now or are we going to break for certain? If so, should we prefix this function to something like experimentalCreateConsolaReporter? No strong opinion, just a suggestion.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this note shouldn't be there anymore because we are now GA. Going to remove!

@AbhiPrasad AbhiPrasad enabled auto-merge (squash) September 12, 2025 14:29
@AbhiPrasad AbhiPrasad merged commit 5a3d572 into develop Sep 12, 2025
86 checks passed
@AbhiPrasad AbhiPrasad deleted the abhi-consola-integration branch September 12, 2025 14:51
AbhiPrasad added a commit to getsentry/sentry-docs that referenced this pull request Sep 17, 2025
<!-- Use this checklist to make sure your PR is ready for merge. You may
delete any sections you don't need. -->

## DESCRIBE YOUR PR

documents getsentry/sentry-javascript#17435

## IS YOUR CHANGE URGENT?  

Help us prioritize incoming PRs by letting us know when the change needs
to go live.
- [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE -->
- [ ] Other deadline: <!-- ENTER DATE HERE -->
- [x] None: Not urgent, can wait up to 1 week+

## SLA

- Teamwork makes the dream work, so please add a reviewer to your PRs.
- Please give the docs team up to 1 week to review your PR unless you've
added an urgent due date to it.
Thanks in advance for your help!

## PRE-MERGE CHECKLIST

*Make sure you've checked the following before merging your changes:*

- [ ] Checked Vercel preview for correctness, including links
- [ ] PR was reviewed and approved by any necessary SMEs (subject matter
experts)
- [ ] PR was reviewed and approved by a member of the [Sentry docs
team](https://github.com/orgs/getsentry/teams/docs)

## LEGAL BOILERPLATE

<!-- Sentry employees and contractors can delete or ignore this section.
-->

Look, I get it. The entity doing business as "Sentry" was incorporated
in the State of Delaware in 2015 as Functional Software, Inc. and is
gonna need some rights from me in order to utilize my contributions in
this here PR. So here's the deal: I retain all rights, title and
interest in and to my contributions, and by keeping this boilerplate
intact I confirm that Sentry can use, modify, copy, and redistribute my
contributions, under Sentry's choice of terms.

## EXTRA RESOURCES

- [Sentry Docs contributor guide](https://docs.sentry.io/contributing/)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add consola integration for sentry logging
2 participants