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
Sentry now has alpha support for Sentry Developer Metrics in the Laravel SDK. You can now flush metrics directly to Sentry via the newly introduced APIs.
To use metrics, you need a minimum Laravel SDK version of 4.0.0 as well as a minimum PHP SDK version of 4.3.0.
You can update the underlying PHP SDK with composer.
Then, you'll be able to add counters, sets, distributions, and gauges.
usefunctionSentry\metrics;
// Add 4 to a counter named `hits`
metrics()->increment(key: 'hits', value: 4);
// Add 25 to a distribution named `response_time` with unit milliseconds
metrics()->distribution(key: 'response_time', value: 25, unit: MetricsUnit::millisecond());
// Add 2 to gauge named `parallel_requests`, tagged with `type: "a"`
metrics()->gauge(key: 'parallel_requests', value: 2, tags: ['type' => 'a']);
// Add a user's email to a set named users.sessions, tagged with role admin
metrics()->set(key: 'users.sessions', value: '[email protected]', tags: ['role' => User::admin()]);
// Meassure the duration of process()
metrics()->timing(key: 'duration', callback: fn() => process());
To attach the code location of your metrics, add the new attach_metric_code_locations option to your config/sentry.php file.
'attach_metric_code_locations' => true,
In case you're not already enrolled on our Metrics alpha program, please sign up here.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Sentry now has alpha support for Sentry Developer Metrics in the Laravel SDK. You can now flush metrics directly to Sentry via the newly introduced APIs.
To use metrics, you need a minimum Laravel SDK version of
4.0.0
as well as a minimum PHP SDK version of4.3.0
.You can update the underlying PHP SDK with composer.
If you're on self-hosted, you'll also need to enable the feature flags.
Then, you'll be able to add counters, sets, distributions, and gauges.
To attach the code location of your metrics, add the new
attach_metric_code_locations
option to yourconfig/sentry.php
file.In case you're not already enrolled on our Metrics alpha program, please sign up here.
Beta Was this translation helpful? Give feedback.
All reactions