Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Counters reported as Gauges in Prometheus metrics #3031

Open
danielgblanco opened this issue Sep 10, 2024 · 1 comment
Open

Counters reported as Gauges in Prometheus metrics #3031

danielgblanco opened this issue Sep 10, 2024 · 1 comment
Labels

Comments

@danielgblanco
Copy link

danielgblanco commented Sep 10, 2024

What happened:
Some of the Prometheus metrics exported by the VPC CNI plugin are defined with inaccurate metric types. For example:

This metric (awscni_add_ip_req_count) is exported as a gauge but it has cumulative incremental values. In fact, it seems that it's used as a counter in:

prometheusmetrics.AddIPCnt.Inc()

It seems that awscni_del_ip_req_count is correctly exported as a counter.

I probably don't have enough context on this to make a judgement call. However, I think there are probably more Gauges that are operating as Counters.

Attach logs
N/A

What you expected to happen:
I'd expect metrics to follow the semantic conventions defined in https://prometheus.io/docs/concepts/metric_types/

How to reproduce it (as minimally and precisely as possible):
Using Prometheus exporters.

Anything else we need to know?:
This may not be a critical issues if systems use Prometheus as the backend. However, it becomes a problem when Prometheus metrics are transformed into other representations. For example, OpenTelemetry Collectors will read this as a Gauge and that gives the aggregation a different meaning (e.g. one can change temporality of counters from cumulative to delta or viceversa).

Environment:

  • Kubernetes version (use kubectl version): 1.28.12
  • CNI Version: 1.16.3
  • OS (e.g: cat /etc/os-release): Bottlerocket 1.21.0
  • Kernel (e.g. uname -a): x86_64 GNU/Linux
@orsenthil
Copy link
Member

@danielgblanco - could you verify this with the latest version of VPC CNI. This was fixed in the recent versions of CNI 1.18.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants