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

experimental_metricsgeneration divide calculation is not correct #33179

Closed
gaussye opened this issue May 22, 2024 · 3 comments
Closed

experimental_metricsgeneration divide calculation is not correct #33179

gaussye opened this issue May 22, 2024 · 3 comments
Labels
bug Something isn't working closed as inactive needs triage New item requiring triage processor/metricsgeneration Metrics Generation processor Stale

Comments

@gaussye
Copy link

gaussye commented May 22, 2024

Component(s)

No response

What happened?

Description

I using experimental_metricsgeneration to get the utilization if volume by using divide function.
Configure:
experimental_metricsgeneration:
rules:
- name: pvc.utilization
type: calculate
metric1: kubelet_volume_stats_used_bytes
metric2: kubelet_volume_stats_capacity_bytes
operation: divide
- name: pvc.utilization.percentage
type: calculate
metric1: kubelet_volume_stats_used_bytes
metric2: kubelet_volume_stats_capacity_bytes
operation: percent

<title></title> <style type="text/css"> p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px '.AppleSystemUIFont'} table.t1 {border-collapse: collapse} td.td1 {border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #9a9a9a #9a9a9a #9a9a9a #9a9a9a; padding: 1.0px 5.0px 1.0px 5.0px} </style>

Below are the metrics:

kubelet_volume_stats_available_bytes 33057693696
kubelet_volume_stats_capacity_bytes 33501757440
kubelet_volume_stats_inodes 2097152
kubelet_volume_stats_inodes_free 2097075
kubelet_volume_stats_inodes_used 77
kubelet_volume_stats_used_bytes 427286528
namespace kubecost
net.host.name ip-10-0-23-147.eu-west-1.compute.internal
persistentvolumeclaim cost-analyzer-prometheus-server
pvc.utilization 0.10311770985726147
pvc.utilization.percentage 10.311770985726147

Steps to Reproduce

Expected Result

pvc.utilization = kubelet_volume_stats_used_bytes/kubelet_volume_stats_capacity_bytes=427286528/33501757440=0.01275

Actual Result

pvc.utilization = 0.10311770985726147

Collector version

0.38.1

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

No response

Log output

No response

Additional context

No response

@gaussye gaussye added bug Something isn't working needs triage New item requiring triage labels May 22, 2024
@crobert-1 crobert-1 added the processor/metricsgeneration Metrics Generation processor label May 22, 2024
Copy link
Contributor

Pinging code owners for processor/metricsgeneration: @Aneurysm9. See Adding Labels via Comments if you do not have permissions to add labels yourself.

Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

Copy link
Contributor

This issue has been closed as inactive because it has been stale for 120 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working closed as inactive needs triage New item requiring triage processor/metricsgeneration Metrics Generation processor Stale
Projects
None yet
Development

No branches or pull requests

2 participants