[small] Add build information as a multi labeled metric#5526
Merged
sougou merged 2 commits intovitessio:masterfrom Dec 9, 2019
Merged
[small] Add build information as a multi labeled metric#5526sougou merged 2 commits intovitessio:masterfrom
sougou merged 2 commits intovitessio:masterfrom
Conversation
6c14733 to
129bcd6
Compare
Signed-off-by: Richard Bailey <rbailey@slack-corp.com>
129bcd6 to
da08c38
Compare
rafael
reviewed
Dec 9, 2019
Member
rafael
left a comment
There was a problem hiding this comment.
This LGTM. After the tests pass, should be good to got from my perspective.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
I'm using the prometheus stats exporter with a grafana frontend to monitor my deployment. I wanted to utilize build metrics to construct a dashboard that allowed us to watch the deployment progress.
For greater versatility Grafana dashboards can be templatized and I'm using that so we graph % of the fleet on a specified build... In order to set that variable there are, roughly, two options
If the build number / branch name is expressed as a metric value it is not possible (or very expensive) to express "all possible values" as a promql on dashboard load whereas when we expose this information as a label on a const metric it's extremely simple (
label_values(vttablet_build_information, build_number)), fast, and efficient.Bonus points is that this also allows us to use a much cleaner query for a lot of the dashboard (
vttablet_build_information{build="$target_version"}).Solution
Expert a const value with the build information baked in as a label value.
Testing
I built and deployed this to a canary keyspace and observed
vttablet_build_informationwas operating as expected. Additionally I deployed to a vtgate servicing that keyspace and observed some test queries operated as expected.There is a unit test failing on this PR according to the validation checks here but it seems unrelated as it's associated with vreplication. It seems consistent though. Logs of the failure below, curious if this is a known issue:
Details