feat: add support for Otel semantic conventions for JVM metrics
Motivation/summary
Handle new metrics properly:
- 'type' was previously called 'area'
- 'name' includes what was previously called 'type'
See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/semantic_conventions/runtime-environment-metrics.md#jvm-metrics
Checklist
- [ ] Update CHANGELOG.asciidoc
- [ ] Update package changelog.yml (only if changes to
apmpackagehave been made) - [ ] Documentation has been updated
For functional changes, consider:
- Is it observable through the addition of either logging or metrics?
- Is its use being published in telemetry to enable product improvement?
- Have system tests been added to avoid regression?
How to test these changes
Related issues
Closes https://github.com/elastic/apm-server/issues/8042
This pull request does not have a backport label. Could you fix it @kruskall? 🙏 To fixup this pull request, you need to add the backport labels for the needed branches, such as:
-
backport-7.xis the label to automatically backport to the7.xbranch. -
backport-7./dis the label to automatically backport to the7./dbranch./dis the digit
NOTE: backport-skip has been added to this pull request.
:green_heart: Build Succeeded
the below badges are clickable and redirect to their specific view in the CI or DOCS
![]()
![]()
![]()
![]()
![]()
Expand to view the summary
Build stats
-
Start Time: 2022-08-11T19:10:36.573+0000
-
Duration: 25 min 44 sec
Test stats :test_tube:
| Test | Results |
|---|---|
| Failed | 0 |
| Passed | 137 |
| Skipped | 1 |
| Total | 138 |
:robot: GitHub comments
To re-run your PR in the CI, just comment with:
-
/test: Re-trigger the build. -
/package: Generate and publish the docker images. -
/test windows: Build & tests on Windows. -
runelasticsearch-ci/docs: Re-trigger the docs validation. (use unformatted text in the comment!)
:books: Go benchmark report
Diff with the main branch
name old time/op new time/op delta
pkg:github.com/elastic/apm-server/internal/agentcfg goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/internal/decoder goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/internal/model/modelindexer goos:linux goarch:amd64
ModelIndexer/NoCompression-12 1.73µs ±21% 1.16µs ±18% -33.13% (p=0.008 n=5+5)
pkg:github.com/elastic/apm-server/internal/processor/stream goos:linux goarch:amd64
BackendProcessor-12 0.00ns ±24% 0.00ns ±49% -49.38% (p=0.008 n=5+5)
RUMV3Processor-12 0.00ns ±20% 0.00ns ±31% -59.98% (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel0-12 0.00ns ±33% 0.00ns ±58% -39.23% (p=0.024 n=5+5)
pkg:github.com/elastic/apm-server/internal/publish goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/aggregation/spanmetrics goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/aggregation/txmetrics goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/sampling goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/sampling/eventstorage goos:linux goarch:amd64
ReadEvents/json_codec_big_tx/199_events-12 1.69ms ± 6% 1.64ms ± 1% -3.18% (p=0.016 n=5+5)
ReadEvents/nop_codec_big_tx/10_events-12 16.7µs ±37% 31.5µs ±34% +88.32% (p=0.032 n=5+5)
IsTraceSampled/unsampled-12 78.3ns ± 1% 76.3ns ± 2% -2.58% (p=0.032 n=5+5)
IsTraceSampled/unknown-12 369ns ± 1% 353ns ± 2% -4.17% (p=0.008 n=5+5)
name old alloc/op new alloc/op delta
pkg:github.com/elastic/apm-server/internal/agentcfg goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/internal/decoder goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/internal/model/modelindexer goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/internal/processor/stream goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/internal/publish goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/aggregation/spanmetrics goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/aggregation/txmetrics goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/sampling goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/sampling/eventstorage goos:linux goarch:amd64
ReadEvents/json_codec/1000_events-12 3.19MB ± 0% 3.23MB ± 0% +1.18% (p=0.016 n=4+5)
name old allocs/op new allocs/op delta
pkg:github.com/elastic/apm-server/internal/agentcfg goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/internal/decoder goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/internal/model/modelindexer goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/internal/processor/stream goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/internal/publish goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/aggregation/spanmetrics goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/aggregation/txmetrics goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/sampling goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/sampling/eventstorage goos:linux goarch:amd64
report generated with https://pkg.go.dev/golang.org/x/perf/cmd/benchstat