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

version: add version string to metrics #3035

Merged
merged 1 commit into from
Oct 24, 2024
Merged

Conversation

kkourt
Copy link
Contributor

@kkourt kkourt commented Oct 23, 2024

Before this patch:
tetragon_build_info{commit="61b575c72b22aa8bb6d7ed8af2d3dbfee43f6307",go_version="go1.23.1",modified="true",time="2024-10-23T06:20:18Z"} 1

After:
tetragon_build_info{commit="61b575c72b22aa8bb6d7ed8af2d3dbfee43f6307",go_version="go1.23.1",modified="true",time="2024-10-23T06:20:18Z",version="v1.3.0-pre.0-216-g61b575c72"} 1

metrics: add version to build information

@kkourt kkourt requested a review from a team as a code owner October 23, 2024 11:17
@kkourt kkourt added the release-note/minor This PR introduces a minor user-visible change label Oct 23, 2024
@kkourt kkourt force-pushed the pr/kkourt/metrics-version branch from 4428023 to 2228f92 Compare October 23, 2024 11:32
@kkourt kkourt requested a review from mtardy as a code owner October 23, 2024 11:32
Copy link

netlify bot commented Oct 23, 2024

Deploy Preview for tetragon ready!

Name Link
🔨 Latest commit 5394da8
🔍 Latest deploy log https://app.netlify.com/sites/tetragon/deploys/6719150a336bd40008dd0f9f
😎 Deploy Preview https://deploy-preview-3035--tetragon.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@mtardy mtardy left a comment

Choose a reason for hiding this comment

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

Sure!! You just miss some metrics doc generation.

@kkourt
Copy link
Contributor Author

kkourt commented Oct 23, 2024

Sure!! You just miss some metrics doc generation

I think the problem is that the docs are based on the SHA of the version, so every time I update it the SHA changes. I'll try to find a workaround.

@mtardy
Copy link
Member

mtardy commented Oct 23, 2024

Sure!! You just miss some metrics doc generation

I think the problem is that the docs are based on the SHA of the version, so every time I update it the SHA changes. I'll try to find a workaround.

Oh yes put a constant in there :)

Overrides: []metricsmd.LabelValues{
{
Label: "commit",
Values: []string{"931b70f2c9878ba985ba6b589827bea17da6ec33"},
},
{
Label: "go_version",
Values: []string{"go1.22.0"},
},
{
Label: "modified",
Values: []string{"false"},
},
{
Label: "time",
Values: []string{"2022-05-13T15:54:45Z"},
},
},
},

@kkourt
Copy link
Contributor Author

kkourt commented Oct 23, 2024

Did something else. Happy to change it to what you suggested if it's an issue, but I think overriding Version also works.

@mtardy
Copy link
Member

mtardy commented Oct 23, 2024

Did something else. Happy to change it to what you suggested if it's an issue, but I think overriding Version also works.

I think I would do it like Anna did with the rest of the values in there so that you don't touch the Makefile and we don't have two ways of doing the same thing.

Before this patch:
tetragon_build_info{commit="61b575c72b22aa8bb6d7ed8af2d3dbfee43f6307",go_version="go1.23.1",modified="true",time="2024-10-23T06:20:18Z"} 1

After:
tetragon_build_info{commit="61b575c72b22aa8bb6d7ed8af2d3dbfee43f6307",go_version="go1.23.1",modified="true",time="2024-10-23T06:20:18Z",version="v1.3.0-pre.0-216-g61b575c72"} 1

Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
@kkourt kkourt force-pushed the pr/kkourt/metrics-version branch from 5394da8 to 0eea252 Compare October 23, 2024 15:44
@kkourt
Copy link
Contributor Author

kkourt commented Oct 23, 2024

Did something else. Happy to change it to what you suggested if it's an issue, but I think overriding Version also works.

I think I would do it like Anna did with the rest of the values in there so that you don't touch the Makefile and we don't have two ways of doing the same thing.

Good point! Pushed a new version.

Copy link
Member

@mtardy mtardy left a comment

Choose a reason for hiding this comment

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

Looks perfect to me like that

Copy link
Contributor

@lambdanis lambdanis left a comment

Choose a reason for hiding this comment

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

that's a useful label, thanks!

@mtardy mtardy merged commit fcfffec into main Oct 24, 2024
44 checks passed
@mtardy mtardy deleted the pr/kkourt/metrics-version branch October 24, 2024 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/minor This PR introduces a minor user-visible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants