You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.
then %returned_context will not contain any information about those tags (and there will be no warnings).
This can be surprisingly different than the capture_request call (which does observe non-request context), and besides can lead to slightly over-verbose code like:
my ($url, %context) = get_sentry_context_from_request($req);
$sentry->capture_message($message, %context, Sentry::Raven->request_context($url, %context));
(instead of
my ($url, %context) = get_sentry_context_from_request($req);
$sentry->capture_message($message, Sentry::Raven->request_context($url, %context));
)
Would you have any interest in a patch to make request_context and company behave more like their capture_ counterparts (and also allow chaining)?
The text was updated successfully, but these errors were encountered:
@querry43 So I finally took a pass at this, and ultimately decided it's probably not a good idea, at least as specced.
In particularly, user_context needs to allow an arbitrary list of key-value pairs (per https://develop.sentry.dev/sdk/event-payloads/user/). That makes it nigh-impossible to pass in non-user contexts, at least while passing hashes, and it seems a poor idea to have user_context behave differently than its siblings.
However - we could get more invasive while retaining backwards compatibility. If each method's signature preferred hashrefs rather than hashes, eg.
we could support this in user_context, but retain backwards compatibility (if we don't get a hashref as the first argument, we behave in the current manner).
I'm still game to make that patch, but figured it was worth checking in again before pulling out my scalpel.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Right now the various ->$foo_context methods (eg.
request_context
) return only the appropriate context.Eg. if you do
then
%returned_context
will not contain any information about those tags (and there will be no warnings).This can be surprisingly different than the
capture_request
call (which does observe non-request context), and besides can lead to slightly over-verbose code like:(instead of
)
Would you have any interest in a patch to make
request_context
and company behave more like theircapture_
counterparts (and also allow chaining)?The text was updated successfully, but these errors were encountered: