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

add prometheus metrics timestamp #2124

Merged
merged 1 commit into from
Dec 12, 2018
Merged

Conversation

Betula-L
Copy link
Contributor

This PR is to fix #2123

It includes,

  • Update vendor prometheus client_golang
  • Add exact scrape timestamp for each Prometheus counter metric

@googlebot
Copy link
Collaborator

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@k8s-ci-robot
Copy link
Collaborator

Hi @Betula-L. Thanks for your PR.

I'm waiting for a google or kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@Betula-L
Copy link
Contributor Author

I signed it!

@googlebot
Copy link
Collaborator

CLAs look good, thanks!

@dashpole
Copy link
Collaborator

/ok-to-test

@dashpole
Copy link
Collaborator

looks like you will need to update the test data to include timestamps as well: https://github.com/google/cadvisor/tree/master/metrics/testdata

@Betula-L
Copy link
Contributor Author

/retest

@Betula-L
Copy link
Contributor Author

I forgot test. Finished now.

Copy link
Collaborator

@dashpole dashpole left a comment

Choose a reason for hiding this comment

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

Can you explain on the PR why the prometheus client version bump is required? Just for historical record. Looks good with one question.

container_tasks_state{container_env_foo_env="prod",container_label_foo_label="bar",id="testcontainer",image="test",name="testcontaineralias",state="sleeping",zone_name="hello"} 50
container_tasks_state{container_env_foo_env="prod",container_label_foo_label="bar",id="testcontainer",image="test",name="testcontaineralias",state="stopped",zone_name="hello"} 52
container_tasks_state{container_env_foo_env="prod",container_label_foo_label="bar",id="testcontainer",image="test",name="testcontaineralias",state="uninterruptible",zone_name="hello"} 53
# HELP http_request_duration_microseconds The HTTP request latencies in microseconds.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why did these metrics disappear?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

container_tasks_state is not removed. http_request_duration_microseconds is removed since it's not cAdvisor metrics, but prometheus metrics, you will not catch it in cAdvisor /metrics.

Copy link
Contributor Author

@Betula-L Betula-L Dec 12, 2018

Choose a reason for hiding this comment

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

For prometheus client_golang 0.8.1, it does not provide metrics with timestamp due to prometheus/prometheus#398. The function NewMetricWithTimestamp is introduced in prometheus client_golang 0.9. A detailed issue track of that is in prometheus/client_golang#187

Copy link
Collaborator

@dashpole dashpole left a comment

Choose a reason for hiding this comment

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

lgtm

@dashpole dashpole merged commit 55d76d7 into google:master Dec 12, 2018
@Betula-L Betula-L deleted the fix-timestamp-gap branch December 17, 2018 01:46
@Betula-L Betula-L restored the fix-timestamp-gap branch December 29, 2018 02:55
@Betula-L Betula-L deleted the fix-timestamp-gap branch December 29, 2018 02:56
@blakebarnett blakebarnett mentioned this pull request Feb 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Timestamp gap between cadvisor and prometheus
4 participants