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

internal/contour: Add contour version to metrics #2383

Merged
merged 1 commit into from
Mar 30, 2020
Merged

internal/contour: Add contour version to metrics #2383

merged 1 commit into from
Mar 30, 2020

Conversation

poidag-zz
Copy link
Contributor

Fixes #2378

Signed-off-by: Peter Grant [email protected]

Allows for passing version at build time and exposes build information as a metric.

@poidag-zz
Copy link
Contributor Author

@jpeach I have not taken a look at metrics documentation auto-generation yet.

@codecov
Copy link

codecov bot commented Mar 25, 2020

Codecov Report

Merging #2383 into master will increase coverage by 0.28%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2383      +/-   ##
==========================================
+ Coverage   77.83%   78.12%   +0.28%     
==========================================
  Files          61       62       +1     
  Lines        5248     5288      +40     
==========================================
+ Hits         4085     4131      +46     
+ Misses       1075     1069       -6     
  Partials       88       88              
Impacted Files Coverage Δ
internal/metrics/metrics.go 85.32% <100.00%> (+0.63%) ⬆️
internal/dag/cache.go 95.43% <0.00%> (-0.71%) ⬇️
internal/contour/endpointstranslator.go 83.03% <0.00%> (-0.59%) ⬇️
internal/contour/listener.go 92.10% <0.00%> (-0.35%) ⬇️
internal/envoy/route.go 98.45% <0.00%> (-0.04%) ⬇️
internal/contour/cluster.go 100.00% <0.00%> (ø)
internal/protobuf/helpers.go 100.00% <0.00%> (ø)
internal/sorter/sorter.go 97.27% <0.00%> (ø)
internal/envoy/listener.go 96.15% <0.00%> (+1.09%) ⬆️
internal/contour/route.go 92.92% <0.00%> (+1.26%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7868db2...32eefea. Read the comment docs.

@jpeach jpeach self-requested a review March 25, 2020 05:21
Copy link
Contributor

@jpeach jpeach left a comment

Choose a reason for hiding this comment

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

I think that this is heading in the right direction.

Can you please change the commit message from internal\contour to internal/contour?

Dockerfile Outdated Show resolved Hide resolved
internal/metrics/metrics.go Outdated Show resolved Hide resolved
internal/metrics/metrics.go Outdated Show resolved Hide resolved
internal/metrics/metrics.go Outdated Show resolved Hide resolved
@poidag-zz
Copy link
Contributor Author

Have made some changes and this is how it's currently looking

/ # curl -s contour.projectcontour:8000/metrics | grep build
# HELP contour_build_info Build information for Contour
# TYPE contour_build_info gauge
contour_build_info{branch="metrics-version",revision="3ef9cbc4a72363c0cac409d030db9a1146b8ac2e",version="v1.3.0-21-g3ef9cbc4"} 1

@jpeach jpeach changed the title internal\contour: Add contour version to metrics internal/contour: Add contour version to metrics Mar 26, 2020
@jpeach jpeach added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Mar 26, 2020
@poidag-zz poidag-zz requested a review from jpeach March 26, 2020 21:48
internal/metrics/metrics.go Show resolved Hide resolved
internal/metrics/metrics.go Outdated Show resolved Hide resolved
internal/metrics/metrics.go Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
@poidag-zz poidag-zz requested a review from jpeach March 28, 2020 21:17
Copy link
Contributor

@jpeach jpeach left a comment

Choose a reason for hiding this comment

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

This looks good to me. Just address the last editorial nits are we are ready to go.

internal/build/version.go Outdated Show resolved Hide resolved
internal/build/version.go Outdated Show resolved Hide resolved
internal/metrics/metrics.go Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
@jpeach
Copy link
Contributor

jpeach commented Mar 29, 2020

@stevesloka Are you OK with using a separate package for the version information here?

Fixes #2378

Signed-off-by: Peter Grant <[email protected]>

Allows for passing version at build time and exposes build information as a metric.
@jpeach jpeach added this to the 1.4.0 milestone Mar 30, 2020
@jpeach jpeach added the area/metrics Issues or PRs related to exposing time series metrics. label Mar 30, 2020
@jpeach jpeach merged commit 5134891 into projectcontour:master Mar 30, 2020
@stevesloka
Copy link
Member

Are you OK with using a separate package for the version information here?

I think the build package could be used for many things. My reference before on the sort package was I could hear @davecheney in my head asking me what the package was responsible for if it couldn't do a single thing and to think about that name.

For this, I think it's fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/metrics Issues or PRs related to exposing time series metrics. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose Contour version in metrics
3 participants