-
-
Notifications
You must be signed in to change notification settings - Fork 462
feat(metrics): introduce metrics #1968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| string $key, | ||
| float $value, | ||
| ?MetricsUnit $unit = null, | ||
| ?Unit $unit = null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ?Unit $unit = null, | |
| ?MetricsUnit $unit = null, |
stayallive
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code wise the looks good (especially much love for the RingBuffer).
The only thing I'm worried about a bit is that we modify the existing code, namely MetricsUnit and some parameters which is a backwards incompatible break for people that did not yet cleanup their code after we deprecated the previous metrics iteration. Do we feel like that is an acceptable risk? If this is going in 5.x this is a non-issue but the target is master so hence my ask.
Introducing metrics for PHP!
Metrics have 3 supported types
Each of those metrics can be submitted by calling
\Sentry\metrics()->count('test-counter', 1, ['tag' => 'foo'])It's also possible to attach units:
\Sentry\metrics()->gauge('test-gauge', 10, ['tag' => 'foo'], \Sentry\Metrics\Unit::second())Up to 1000 metrics can be stored per request. Older metrics are dropped when the limit is reached.
Metrics need to be flushed manually by calling
\Sentry\metrics()->flush().