question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fingerprints are not working with logging

See original GitHub issue

With raven it was possible to group events using the fingerprint extra parameter:

logger.warning(
    'connection failed',
    exc_info=error,
    extra={'fingerprint': ['my-connection-error']},
)

After migration from raven-python to sentry-sdk such events are no longer grouped by sentry.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
ascrookescommented, Sep 27, 2022

@untitaker Thank you for sharing this approach. We are using this and appreciate the insight.

We ran into a small issue with it that we wanted to highlight for others who might end up here. Not all hints have the key log_record. In the cases where an unhandled exception was raised trying to access the log record caused the before send to raise an exception. That resulted in Sentry not sending the event and failing silently. Checking that the hint has log_record before trying access it fixed that issue for us.

We are currently running sentry-sdk==1.9.0

1reaction
untitakercommented, Jun 7, 2019

No, sorry I don’t want to discover random attributes from there anymore (all should just go into extra).

I added a small fix into master that will allow you to do this:

def before_send(event, hint):
    if hint and hasattr(hint['log_record'], "fingerprint"):
        event['fingerprint'] = hint['log_record'].fingerprint
    return event

init(before_send=before_send)
Read more comments on GitHub >

github_iconTop Results From Across the Web

[SOLVED] Windows Fingerprint Reader Not Working
It's weird that you may find the Windows Fingerprint is not working. Here's a list of possible causes and a detailed guide to...
Read more >
fingerprint log in option not working: Sorry something went ...
Right-click on Windows key and select Device Manager. Locate the Hello, webcam, and fingerprint drivers individually and right-click on each of ...
Read more >
How To Fix Windows Hello Fingerprint Not Working In ...
Install all pending and detected updates, and restart your computer. Try signing in with fingerprint authentication again.
Read more >
6 Fixes For When Your Fingerprint Sensor Isn't Working
The fingerprint scanner on your phone makes everything much easier, but how do you fix it when it's not working?
Read more >
If Touch ID isn't working on your Mac - Apple Support
If you can't unlock your Mac using Touch ID, can't enroll a fingerprint, or can't use Touch ID to enter your password, learn...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found