-
Notifications
You must be signed in to change notification settings - Fork 97
metrics: Add hopr_last_time and rename hopr_up #7183
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
📝 Walkthrough## Walkthrough
This change updates metric labels from `hopr_up` to `hopr_start_time` across documentation, code, and dashboard configurations. It also introduces a new metric to record the timestamp of the last API endpoint fetch. The `hopr-platform` dependency is added to the REST API crate.
## Changes
| Files / Paths | Change Summary |
|-------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|
| METRICS.md | Renamed `hopr_up` to `hopr_start_time` and added `hopr_http_api_last_used_time` metric with descriptions.|
| deploy/compose/grafana/provisioning/dashboards/hopr/hoprd-grafana-dashboard.json | Updated all dashboard queries and variable definitions from `hopr_up` to `hopr_start_time`. |
| hopr/hopr-lib/src/lib.rs | Renamed metric label from `hopr_up` to `hopr_start_time`. |
| hoprd/rest-api/Cargo.toml | Added `hopr-platform` as a new workspace dependency. |
| hoprd/rest-api/src/prometheus.rs | Added `METRIC_API_LAST_TIME` gauge to record the last API fetch timestamp. |
## Sequence Diagram(s)
```mermaid
sequenceDiagram
participant Client
participant API
participant Prometheus
Client->>API: Make API request
API->>API: Process request
API->>Prometheus: Update METRIC_API_LAST_TIME with current timestamp
API-->>Client: Respond to request Assessment against linked issues
Suggested labels
Suggested reviewers
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses #7083 by updating metric naming for clarity and adding a new gauge to capture the last API access time.
- Adds a new gauge (METRIC_API_LAST_TIME) in the REST API to record the timestamp of the latest API call
- Renames the "hopr_up" metric to "hopr_start_time" for consistency
- Updates METRICS.md and Cargo.toml to reflect these changes
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
File | Description |
---|---|
hoprd/rest-api/src/prometheus.rs | Introduces a new gauge to track API last access time and imports current time utility |
hoprd/rest-api/Cargo.toml | Adds dependency on hopr-platform |
hopr/hopr-lib/src/lib.rs | Renames metric "hopr_up" to "hopr_start_time" and improves log message formatting |
METRICS.md | Updates metric names and descriptions to reflect the changes made in the code |
Files not reviewed (1)
- deploy/compose/grafana/provisioning/dashboards/hopr/hoprd-grafana-dashboard.json: Language not supported
Teebor-Choka
requested changes
May 26, 2025
Teebor-Choka
approved these changes
May 26, 2025
ausias-armesto
approved these changes
May 26, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.