Skip to content

Using getLastEventId in Laravel Lumen #555

Answered by stayallive
androidacy-user asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @androidacybot,

You should not use toTraceParent this is not the last event ID but the current transaction ID. Unless you are using performance monitoring this value will be empty or invalid, it also includes other data next to the transaction ID, so it's not really meaningful in the feedback context.

The last event ID comes from the "hub" in the Sentry SDK and you can get the hub using: \Sentry\SentrySdk::getCurrentHub(), from there you can request the last event ID like so: \Sentry\SentrySdk::getCurrentHub()->getLastEventId(). This "hub" is what you would resolve from the container using app('sentry').

Let me know if that worked!

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@androidacy-user
Comment options

@androidacy-user
Comment options

Answer selected by androidacy-user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants