elastic / elastic/apm

Support Prometheus metric libraries with APM agents

Open
#355 12 comments 0 reactions 0 assignees View on GitHub
apm-agents meta
Dominant language
Gherkin
Stars
427
Forks
125
PR merge metrics
No merged PRs in 30d

Description

The background of this is that we want to support sending custom metrics with our agents. We don't want to create another metrics API though and thus we're seeking to integrate with existing ones. Each language has its own favorite metric libraries. But Prometheus has good cross-language coverage and is quite popular in all of them so it seems like a good fit to align on cross-agent.

Prometheus doesn't have to be the one and only API we support. In fact, the Java agent already supports the Micrometer metric registry which is quite popular in that ecosystem. It's up to each agent team to decide on the priority and the choice of other metric APIs they want to support.

This issue tracks writing up a cross agent spec and implementing a reference implementation for supporting the Prometheus client library.

Instead of the pull-based model that is typical for Prometheus, the Elastic APM integration will send the metrics that are registered in the Prometheus metric registry directly from the application to the [APM Server intake API](https://www.elastic.co/guide/en/apm/server/7.9/metricset-api.html).

Histograms will not be supported in the first iteration. After APM Server adds support for histograms (https://github.com/elastic/apm-server/issues/3195), there will be a follow up to support them as well.

Agents that support auto instrumentation should automatically plug into the Prometheus client so that users don't need to configure anything in order for the metrics to be sent.

TODOs
- For counters and timers, decide on whether to report the difference/delta since the last report or whether to send up cumulative values
- Define a mapping for different metric types, like counters, gauges, and timers to the [intake API metrics spec]((https://www.elastic.co/guide/en/apm/server/7.9/metricset-api.html))
- Reconcile that with the existing Go Prometheus implementation and the Java Micrometer implementation
- Work with the PM and docs team on getting started documentation

## Spec issue
- [ ] https://github.com/elastic/apm/issues/375 Milestone

## Agent issues
- [ ] https://github.com/elastic/apm-agent-java/issues/1615 Milestone
- [ ] https://github.com/elastic/apm-agent-dotnet/issues/1127 Milestone
- [ ] https://github.com/elastic/apm-agent-go/issues/867 Milestone
- [ ] https://github.com/elastic/apm-agent-php/issues/319 Milestone
- [ ] https://github.com/elastic/apm-agent-ruby/issues/929 Milestone
- [ ] https://github.com/elastic/apm-agent-nodejs/issues/1941 Milestone
- [x] https://github.com/elastic/apm-agent-python/issues/1005 Milestone

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.