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

github exporter: show tag within release in github_repo_release_downloads #235

Open
532910 opened this issue Feb 23, 2024 · 7 comments · Fixed by githubexporter/github-exporter#104
Labels
enhancement New feature or request

Comments

@532910
Copy link

532910 commented Feb 23, 2024

Request

github_repo_release_downloads gives only release which could be a human name. Please add support to return tag name in addition to release.

Use case

get the latest version

@532910 532910 added the enhancement New feature or request label Feb 23, 2024
@tpaschalis
Copy link
Member

I agree this might be useful. Like in #236, I think it's best if we manage to get an upstream fix that can benefit the entire community.

I'm hoping that the github_exporter project finds a new home (prometheus-community/community#44) and it continues working.

@hainenber
Copy link
Contributor

The github-exporter already moved to https://github.com/githubexporter, from its previous org infinityworks :D

I'll open a upstream PR for this

@hainenber
Copy link
Contributor

Made an upstream PR to address this issue. Hopefully the authors taking a look :D

@532910
Copy link
Author

532910 commented Mar 1, 2024

I just tried to get the latest release with the current implementation and really didn't find a way to get it:
github_repo_release_downloads{repo="some-repo"}) gives several time-series with different release labels, but how to get the latest one?

I believe the PR above should be applied, but really it doesn't fixes this issue fully. I will be nice to have a separate metric to track the latest release:

% curl -s https://api.github.com/repos/grafana/agent/releases/latest | jq .tag_name 
"v0.40.1"

@hainenber
Copy link
Contributor

If your target is to track the latest release, GH doc recommends to sort releases by their created_at attribute as the timestamp is the date of the commit used for the release.

Since this is considered to be useful by other folks, I'll keep the upstream PR open.

@532910
Copy link
Author

532910 commented Mar 5, 2024

  1. GH doc does not recommend to sort releases by their created_at attribute! It just explains the latest release as:

the most recent non-prerelease, non-draft release, sorted by the created_at attribute.

GH doc recommends the same I showed with curl:

GET /repos/{owner}/{repo}/releases/latest
  1. GH doc has nothing common with how to get the latest release from github_exporter.

@hainenber
Copy link
Contributor

I think my wording before, recommends, was too far-reaching but honestly, the addition of one more label is_latest or some sort to indicate a tag to be latest would be pricey, API-wise.

The ListRelease API response doesn't have any attribute to indicate a release to be latest. That requires another call to GH using the API you've described. I'm not sure the upstream author would agree with this change, btw.

@rfratto rfratto transferred this issue from grafana/agent Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants