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

Auto-update Go Collector Metrics for new Go versions #1476

Merged

Conversation

SachinSahu431
Copy link
Contributor

@SachinSahu431 SachinSahu431 commented Mar 22, 2024

This PR enables autogeneration of Go Collector metrics for supported Go versions.

Runnig make generate-go-collector-test-files command will generate the required metrics collected by Go Collector for list of Go versions specified in supported_go_versions.txt.

Details about the autogenerated files:

  • prometheus/gen_go_collector_metrics_set.go will generate go_collector_metrics_<version>_test.go file.
  • prometheus/collectors/gen_go_collector_set.go will generate go_collector_<version>_test.go file.

Subsequent PR will include automatic generation of files when a new Go version is released. Plan is to have a weekly scheduled GitHub action that will check for the release of new Go versions and will open a PR with autogenerated required files.

Signed-off-by: Sachin Sahu <75629410+SachinSahu431@users.noreply.github.com>
Signed-off-by: Sachin Sahu <75629410+SachinSahu431@users.noreply.github.com>
Signed-off-by: Sachin Sahu <75629410+SachinSahu431@users.noreply.github.com>
@SachinSahu431 SachinSahu431 changed the title Autogenerate go_collector_<version>_test.go files Auto-update Go Collector Metrics for new Go versions Mar 23, 2024
Copy link
Member

@ArthurSens ArthurSens left a comment

Choose a reason for hiding this comment

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

Awesome job! 👏 👏 👏

I've made a few comments but it's already pretty much ready. I'd suggest we introduce the workflow automation in a separate PR, that way we can keep PRs small and easier to review

check-go-version.bash Outdated Show resolved Hide resolved
go_versions.txt Outdated Show resolved Hide resolved
prometheus/collectors/gen_go_collector_set.go Outdated Show resolved Hide resolved
prometheus/collectors/gen_go_collector_set.go Outdated Show resolved Hide resolved
@ArthurSens
Copy link
Member

Also, you can fix the linting issues of the failed CI by running make fmt

Signed-off-by: Sachin Sahu <75629410+SachinSahu431@users.noreply.github.com>
@SachinSahu431
Copy link
Contributor Author

Thank you for the feedback @ArthurSens! I've updated the code and fixed linting issues :)

@SachinSahu431 SachinSahu431 marked this pull request as ready for review March 25, 2024 18:56
Copy link
Member

@kakkoyun kakkoyun left a comment

Choose a reason for hiding this comment

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

Awesome 🏆 🥇 💯

Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Thanks 💪🏽

@bwplotka bwplotka merged commit 50ab457 into prometheus:main Mar 26, 2024
8 checks passed
@SachinSahu431 SachinSahu431 deleted the go-collector-metrics-autogeneration branch March 27, 2024 06:33
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.

None yet

4 participants