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

Need deduplication when both metric and metric_total exist #42

Closed
RRAlex opened this issue Feb 5, 2018 · 7 comments
Closed

Need deduplication when both metric and metric_total exist #42

RRAlex opened this issue Feb 5, 2018 · 7 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@RRAlex
Copy link

RRAlex commented Feb 5, 2018

On a namespace where the following queries returns a result (say "2"):

sum( rabbitmq_queue_messages_ready{})  by (kubernetes_namespace ) > 0

Trying it directly seems to return 0:

kubectl get --raw /apis/custom.metrics.k8s.io/v1beta1/namespaces/staging/metrics/rabbitmq_queue_messages_ready

Result:

{
  "kind": "MetricValueList",
  "apiVersion": "custom.metrics.k8s.io/v1beta1",
  "metadata": {
    "selfLink": "/apis/custom.metrics.k8s.io/v1beta1/namespaces/staging/metrics/rabbitmq_queue_messages_ready"
  },
  "items": [
    {
      "describedObject": {
        "kind": "Namespace",
        "name": "staging",
        "apiVersion": "/__internal"
      },
      "metricName": "rabbitmq_queue_messages_ready",
      "timestamp": "2018-02-05T22:12:21Z",
      "value": "0"
    }
  ]
}

From the logs it's seems to be calling rate() within the sum():

7471c5_0[1298]: I0205 22:12:21.725052       1 api.go:74] GET http://prometheus.kube-system-monitoring.svc:9090/prometheus/api/v1/query?query=sum%28rate%28rabbitmq_queue_messages_ready_total%7Bkubernetes_namespace%3D%22staging%22%7D%5B5m%5D%29%29+by+%28kubernetes_namespace%29&time=1517868741.722 200 OK

This seems to be a bug as per:
https://github.com/DirectXMan12/k8s-prometheus-adapter/#presentation

Cheers!

@DirectXMan12 DirectXMan12 added the kind/bug Categorizes issue or PR as related to a bug. label Feb 6, 2018
@RRAlex
Copy link
Author

RRAlex commented Feb 6, 2018

I just realized that directly in Prometheus, we have both rabbitmq_queue_messages_ready and rabbitmq_queue_messages_ready_total.
So it seems the second one gets shorten to the first and overrides it.
So the bug might actually be an override protection problem rather than a miscategorization!

@DirectXMan12 DirectXMan12 changed the title rate() used on metrics not ending in _total Need deduplication when both metric and metric_total exist Feb 6, 2018
@RRAlex RRAlex changed the title Need deduplication when both metric and metric_total exist Renaming *_total metrics overrides shortened metrics name that might already exist Feb 6, 2018
@RRAlex RRAlex changed the title Renaming *_total metrics overrides shortened metrics name that might already exist Need deduplication when both metric and metric_total exist Feb 6, 2018
@bradenwright
Copy link

@RRAlex @DirectXMan12 any further information on this, I have the exact use case. We are trying to scale workers off length of rabbitmq length.

@bradenwright
Copy link

I saw #46 may the answer is that we need to wait on this PR.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 30, 2021
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Mar 1, 2021
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-contributor-experience at kubernetes/community.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-contributor-experience at kubernetes/community.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

5 participants