Is it possible to push metrics to a grafana agent from a java application with OpenTelemetry agent instrumentation?

434 views Asked by At

When I'm setting up my Grafana Agent, I see only the "scraping" option, so the agent itself needs to poll my java app (e.g. /actuator/metrics endpoint). I'm wondering if it's possible to have the "push" approach instead.

Basically, I want the same as we could do to collect traces: add otlp java agent to our application, set a grpc/http receiver on the agent side and that's it. But it seems that you cannot have receivers block for metrics section (which exists in traces section).

I'm using Grafana Agent v0.31 if it matters.

1

There are 1 answers

1
Maciej Nawrocki On BEST ANSWER

From my research it seems it is not currently possible with "standard" Grafana Agent configuration.

It is possible to configure metrics receiver in OpenTelemetry Collector though.

Grafana has introduced Grafana-Agent-Flow, which provides OTelCollector components.

It seems like it would meet your requirements, however, as it is currently under heavy development and mentioned components are in BETA, I am not comfortable recommending it for production maintenance.