# A warning message "Counter metric cache limit exceeded" in AG logs.

**URL:** <https://community.dynatrace.com/t/a-warning-message-counter-metric-cache-limit-exceeded-in-ag-logs/49303>\
**Category:** Troubleshooting\
**Tags:** dynatrace-managed, prometheus, kubernetes\
**Created:** [December 11, 2024, 11:37am UTC](https://community.dynatrace.com/t/a-warning-message-counter-metric-cache-limit-exceeded-in-ag-logs/49303 "2024-12-11T11:37:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shahinm](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@shahinm](https://community.dynatrace.com/u/shahinm)\
**Post date:** [December 11, 2024, 11:37am UTC](https://community.dynatrace.com/t/a-warning-message-counter-metric-cache-limit-exceeded-in-ag-logs/49303/1 "2024-12-11T11:37:29Z")

</div>

ActiveGate has a counter metric cache that transforms monotonic counters to delta counters, for cluster scalability reasons. This cache, by default, currently allows 100.000 entries and AG rejects some counter metrics when the limit has been reached.

# **Symptoms**

You enabled monitoring of [Prometheus metrics](https://docs.dynatrace.com/docs/observe/infrastructure-monitoring/container-platform-monitoring/kubernetes-monitoring/monitor-prometheus-metrics) and missing some metrics which type is counter. In the AG logs, you observe the following warning message:

```auto
<timestamp> UTC WARNING [<environment-id>] [CounterCacheImpl] Counter metric cache limit exceeded: 100000. Data point evicted. Reason: SIZE [Suppressing further identical messages for 1 hour]

```

# **Resolution**

There are two possible options to overcome the problem.

1. [Filter ingested metrics](https://docs.dynatrace.com/docs/shortlink/monitor-prometheus-metrics#filter-metrics) and exclude unnecessary ones

2. Extend the cache limit parameters in the [custom.properties file](https://docs.dynatrace.com/docs/shortlink/sgw-configure#custom-properties)

Example:

```auto
[kubernetes_monitoring]
mint_metric_counter_metric_cache_size=300000
mint_metric_counter_metric_cache_expiry_duration_minutes=2

```

For containerized AGs, deployed via the Dynatrace operator, enable the same configuration in the [dynakube](https://github.com/Dynatrace/dynatrace-operator/blob/main/assets/samples/dynakube/v1beta2/cloudNativeFullStack.yaml).

```auto
activeGate:
  ...
  customProperties:
    value: |
     [kubernetes_monitoring]
     mint_metric_counter_metric_cache_size=300000
     mint_metric_counter_metric_cache_expiry_duration_minutes=2

```

---

<div class="post-metadata">

**Author:** ![paum](https://avatars.discourse-cdn.com/v4/letter/p/dc4da7/32.png) [@paum](https://community.dynatrace.com/u/paum)\
**Post date:** [January 14, 2025, 12:45pm UTC](https://community.dynatrace.com/t/a-warning-message-counter-metric-cache-limit-exceeded-in-ag-logs/49303/2 "2025-01-14T12:45:31Z")

</div>

Something frustrating about this is that I find this documented in this post and at the time of me writing this post, there doesn’t seem to be any kind of documentation around these custom property fields.

I was also looking to see if Dynatrace does something with other type of metrics it is scraping, but no luck.

---

<div class="post-metadata">

**Author:** ![the\_real\_anil](https://avatars.discourse-cdn.com/v4/letter/t/a3d4f5/32.png) [@the\_real\_anil](https://community.dynatrace.com/u/the_real_anil)\
**Post date:** [April 16, 2025, 3:10pm UTC](https://community.dynatrace.com/t/a-warning-message-counter-metric-cache-limit-exceeded-in-ag-logs/49303/3 "2025-04-16T15:10:06Z")

</div>

Agree. No documentation for&nbsp;mint\_metric\_counter\_metric\_cache\_size. What is this property mean? Is it cache, if yes, how to reset or how is his value calculated.?The active gate restart does not reset this property, the only option is to increase the value. 😞&nbsp; No luck so far to find the additional details.
