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 build info metric. #213

Merged
merged 2 commits into from
Mar 5, 2019
Merged

Add Prometheus build info metric. #213

merged 2 commits into from
Mar 5, 2019

Conversation

SuperQ
Copy link
Contributor

@SuperQ SuperQ commented Mar 4, 2019

  • Refactor build info from a string into a struct.
  • Add git branch to build info.
  • Add a Prometheus build info version metric.

@SuperQ
Copy link
Contributor Author

SuperQ commented Mar 4, 2019

Example output:

# HELP mtail_build_info A metric with a constant '1' value labeled by version, revision, branch, and goversion from which mtail was built.
# TYPE mtail_build_info gauge
mtail_build_info{branch="build_info",goversion="go1.12",revision="9e954492119486c24e1a1c8b1930641cb2763fe9",version="v3.0.0-rc25-2-g9e95449-dirty"} 1

cmd/mtail/main.go Outdated Show resolved Hide resolved
internal/mtail/mtail.go Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Mar 4, 2019

Pull Request Test Coverage Report for Build 2830

  • 16 of 18 (88.89%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 66.341%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/mtail/mtail.go 16 17 94.12%
internal/mtail/options.go 0 1 0.0%
Totals Coverage Status
Change from base Build 2797: 0.1%
Covered Lines: 3597
Relevant Lines: 5422

💛 - Coveralls

* Refactor build info from a string into a struct.
* Add git branch to build info.
* Add a Prometheus build info version metric.
Copy link
Contributor

@jaqx0r jaqx0r left a comment

Choose a reason for hiding this comment

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

Love it. Thanks!

@jaqx0r jaqx0r merged commit 37131e2 into google:master Mar 5, 2019
@SuperQ SuperQ deleted the build_info branch March 5, 2019 01:04
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