Skip to content
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

Add Metrics API #2880

Closed
bruno-garcia opened this issue Nov 22, 2023 · 6 comments · Fixed by #2949
Closed

Add Metrics API #2880

bruno-garcia opened this issue Nov 22, 2023 · 6 comments · Fixed by #2949
Assignees

Comments

@bruno-garcia
Copy link
Member

bruno-garcia commented Nov 22, 2023

Sentry is building a new metrics product: getsentry/sentry#58584

Note: We need to be clear that the API itself would be preview, perhaps through xml docs.

Developer Docs

https://develop.sentry.dev/sdk/metrics/

Progress in other SDKs

Testing / Dogfooding in .NET

Would be great to dogfood this through Symbol Collector which today uses StatsD and emits metrics

The mobile app also has some metrics but it just dumps the Extra on events (can see it anywhere other than individual events).

@bruno-garcia bruno-garcia added this to GDX Nov 22, 2023
@bruno-garcia
Copy link
Member Author

There are actually develop docs on this: https://develop.sentry.dev/delightful-developer-metrics/sending-metrics-sdk/

Please note this is very early stage so not worth adding a ton of tests, we could have this on a branch and ship alpha's from it for example

@bruno-garcia
Copy link
Member Author

see also getsentry/sentry-python#2522

@bruno-garcia
Copy link
Member Author

@bruno-garcia
Copy link
Member Author

getsentry/sentry-rust#618

@jamescrosswell
Copy link
Collaborator

Open Telemetry

Eventaully we might be able to build a bridge between Sentry's metrics and OpenTelemetry Metrics, if people wanted to use OpenTelemetry for instrumentation (similar to what we've done for Tracing)

Metric Types

For the following metric types:

Tags

Tags can be used to attach meta-data to metrics. These could be implemented using OpenTelemetry Attributes.

Additional Context

Sentry DDM allows associating code locations with metrics. This could be achieved by convention using an OpenTelemetry Attribute with a specific name. Note that attributes are provided on metric values, not on the metrics overall e.g. Counter.add in the Metrics API.

Timers

The OpenTelemetry docs don't mention anything like the Timers described in Sentry's DDMs... Although the timers themselves are just a mechanism to collect a fairly specific metric (the amount of time taken to execute a particular piece of code). So these could be implemented in the Sentry SDK... and the results passed as a regular metric of one of the above types, using milliseconds as the unit and also accompanied by a code location (as an attribute).

Sending Metrics to Sentry

A custom exporter can be created to extend OpenTelemetry dotnet.

@bitsandfoxes bitsandfoxes self-assigned this Dec 18, 2023
@bruno-garcia
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants