Skip to content

[#6632] improvement(core): Add timestamp information to metrics #6882

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Abyss-lord
Copy link
Collaborator

What changes were proposed in this pull request?

Add timestamp information to metrics

Why are the changes needed?

Fix: #6632

Does this PR introduce any user-facing change?

no

How was this patch tested?

local test.

@Abyss-lord
Copy link
Collaborator Author

Hi @FANNG1 , could you please review this PR when you have time? I’d really appreciate your feedback.

@Abyss-lord Abyss-lord requested a review from FANNG1 April 10, 2025 10:39
@Abyss-lord Abyss-lord added the upload log Always upload container log label Apr 10, 2025
@Abyss-lord Abyss-lord self-assigned this Apr 10, 2025
Copy link
Contributor

@jerqi jerqi left a comment

Choose a reason for hiding this comment

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

LGTM.

@jerqi jerqi changed the title [#6632] improve(core): Add timestamp information to metrics [#6632] improvement(core): Add timestamp information to metrics Apr 14, 2025
@jerqi jerqi added branch-0.9 and removed upload log Always upload container log labels Apr 14, 2025
@jerqi
Copy link
Contributor

jerqi commented Apr 14, 2025

@FANNG1 Would you like to take an another look? If no another suggestion, I will merge this PR tomorrow.

@jerryshao
Copy link
Contributor

@FANNG1 please help to review this PR.

@FANNG1
Copy link
Contributor

FANNG1 commented Apr 14, 2025

This PR adds extra metrics name to current guaga metrics like adding gravitino-server.http-server.idle-thread.num.timestamp corresponding to current gravitino-server.http-server.idle-thread.num metrics. what we expect may include timestamp to metric values, like metrics-name timestamp metrics-value, but this may break existing Prometheus metrics format, is there any way to extend the Prometheus format? @jerryshao WDYT?

@jerryshao
Copy link
Contributor

I'm not so sure about Prometheus metrics, but I think to keep the compatibility is the important thing. Can you please investigate other projects to see how they add timestamp to the metrics?

@Abyss-lord
Copy link
Collaborator Author

This PR adds extra metrics name to current guaga metrics like adding gravitino-server.http-server.idle-thread.num.timestamp corresponding to current gravitino-server.http-server.idle-thread.num metrics. what we expect may include timestamp to metric values, like metrics-name timestamp metrics-value, but this may break existing Prometheus metrics format, is there any way to extend the Prometheus format?

@FANNG1 Thanks for the feedback! what we expect ideally is to have a single metric line with explicit timestamps, like:

gravitino_server_http_server_idle_thread_num 42 1713085340000

But if I remember correctly, in the standard /metrics endpoint, Prometheus itself ignores any explicit timestamps even if they are appended.

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

Successfully merging this pull request may close these issues.

[Improvement] Add timestamp information to metrics
4 participants