Skip to content

Add metric about metrics freshness #126

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

Merged
merged 3 commits into from
Dec 9, 2022

Conversation

olivierlemasle
Copy link
Member

@olivierlemasle olivierlemasle commented Dec 6, 2022

Add a metric custom_metrics_apiserver_metric_freshness_seconds, similar to the metric metrics_server_api_metric_freshness_seconds from metrics-server.

This metric can optionally be registered using RegisterMetrics(registrationFunc func(metrics.Registerable) error) error, e.g:

metrics.RegisterMetrics(legacyregistry.Register)

Also, in test-adapter:

  • register the new metric custom_metrics_apiserver_metric_freshness_seconds;
  • currently, the timestamp for custom metrics values is the time when the metric is queried. With this change, the timestamp used is the time when the metric value is created / updated.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 6, 2022
@k8s-ci-robot
Copy link
Contributor

@olivierlemasle: This issue is currently awaiting triage.

If custom-metrics-apiserver contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 6, 2022
@olivierlemasle
Copy link
Member Author

I've updated the PR to follow your suggestions.

In test-adapter, the timestamp for custom metrics values is currently
the time when the metric is queried. With this change, the timestamp
used is the time when the metric value is created / updated.
Copy link
Member

@dgrisonnet dgrisonnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes related to the new metrics looks good to me, but the ones in the test-adapter provider need to be reflected in https://github.com/kubernetes-sigs/custom-metrics-apiserver/blob/master/docs/getting-started.md. That can be done in a follow-up but we need to make sure that we keep the doc up-to-date.

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 9, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dgrisonnet, olivierlemasle

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 9, 2022
@k8s-ci-robot k8s-ci-robot merged commit cee4d69 into kubernetes-sigs:master Dec 9, 2022
@olivierlemasle olivierlemasle deleted the own-metrics branch December 10, 2022 11:29
@olivierlemasle
Copy link
Member Author

... but the ones in the test-adapter provider need to be reflected in https://github.com/kubernetes-sigs/custom-metrics-apiserver/blob/master/docs/getting-started.md. That can be done in a follow-up but we need to make sure that we keep the doc up-to-date.

Yes, I'm thinking about it since #108. I've just opened an issue for that topic: #132.

@zroubalik
Copy link
Contributor

@olivierlemasle @dgrisonnet would be nice to have all exposed metrics documented somewhere.

@dgrisonnet
Copy link
Member

I opened an issue to keep track of that: #134

@dgrisonnet dgrisonnet mentioned this pull request May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants