elastic / elastic/apm-agent-java

Measure GC overhead

Open
#1,791 2 comments 0 reactions 0 assignees View on GitHub
agent-java new-feature
Dominant language
Java
Stars
594
Forks
338
Avg merge
1d 13h
Merged PRs (30d)
25

Description

## Is your feature request related to a problem?

Sometimes our processes are struggling with GC, but it's not easy to "spot" or alert on if it's not at the point of OOMing, but it's just so busy doing GC it's effectively not getting it's work done. We'd like to be aware of instances that are in this state, and possibly alert on it.

## Describe the solution you'd like

It'd be nice if the APM agent could record an approximation of how much time it has spent on GC.

Elasticsearch has a similar solution
https://github.com/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/monitor/jvm/JvmGcMonitorService.java
It's doing it as a scheduled task. I think it's also possible using https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html

What we want it something we can eventually alert on, e.g. if overhead > 50%, your application isn't getting much real work done.

## Describe alternatives you've considered

It's possible to collect it via custom metrics e.g. micrometer, but we have some services where we don't want to add custom code to.

## Additional context

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.