sentry-java
                                
                                 sentry-java copied to clipboard
                                
                                    sentry-java copied to clipboard
                            
                            
                            
                        [Java] Add support for Sentry Metrics
Description
Metrics! Sentry will support Metrics finally! First we need all of our SDKs to support Metrics, including Java and dependent SDKs
Requirements:
- [ ] https://github.com/getsentry/sentry-java/pull/3205
- [ ] Metrics Summary
- [ ] Code location
- [ ] Tag normalization
Question:
How much of this can the Android SDK inherit if added in Java?
Document(s)
Having looked into the docs and the .NET implementation I want to highlight a few development aspects:
- The product specs describe the overall API behavior best
- We not only need to provide APIs on the SDK side, but also need some basic logic to aggregate metrics into 10s buckets
- We need some async flush functionality to send past buckets to our backend
- There's a new envelope item, type = statsd for sending metrics
- We have to keep thread safety (metrics can be emitted by any thread, reading and cleaning up happens every 10s) in mind
- There's a timing API which connects spans with metrics AND creates gauge metrics aka "summaries" of metrics on a span level
- When capturing metrics, stack traces are used to determine a code location for an emitted metric, if feasible at all, some caching needs to be done
To get going fast let's split this up into smaller PRs / tasks:
- [x] Implement basic API, add protocol definitions for sending statsdenvelope items
- [ ] Add support for code locations, linking metrics to source code
- [x] Add support for the timing API, connecting spans with metrics and creating gauges
@markushi do you mean the develop spec? the link is to develop docs, not product
Thanks for investigating in more detail!
released with 7.6.0 (excluding code location, which is currently blocked and tracked separately)