Add metrics version#1248
Conversation
|
|
||
| var metricsNameRegex = regexp.MustCompile(`\W+`) | ||
| var metricsNameFixRegex = regexp.MustCompile(`^_+|_+$`) | ||
| var VersionString = "dev" |
There was a problem hiding this comment.
Maybe could you use https://pkg.go.dev/runtime/debug#ReadBuildInfo instead?
There was a problem hiding this comment.
Actually, the version of the FrankenPHP module (and of all other installed modules) should already be exposed by Caddy: https://github.com/caddyserver/caddy/blob/v2.8.4/metrics.go#L15
There was a problem hiding this comment.
This is the string currently output from a production instance:
go_build_info{checksum="",path="github.com/dunglas/frankenphp/caddy",version="(devel)"} 1
It doesn't seem too useful :(
There was a problem hiding this comment.
Hum this looks like an issue in my release script 😅 (because of the replace). Isn't the version of lib (not the Caddy module) displayed?
There was a problem hiding this comment.
I'm not sure what you mean, but that is the only thing in the metrics.
There was a problem hiding this comment.
I mean we should have the version of github.com/dunglas/frankenphp too
There was a problem hiding this comment.
There are no dependencies listed, just the top-level.
|
I think the best fix would be to update our release pipeline to:
|
|
It looks like it is already there: https://pkg.go.dev/github.com/dunglas/frankenphp/caddy So, to get the version string to show up properly, we just need to change how we are building it, if I understand correctly? |
|
Holy hell this was a rabbit hole. Apparently, prior to go 1.24, it was hardcoded to :sigh: Since 1.24, it is now based on git tags when building locally: So, do we want to upgrade from go 1.22 to 1.24 @dunglas? |
|
Sure! We'll upgrade to Go 1.24 as soon as dependencies (especially Caddy) are compatible with it. |
|
Now that we upgraded to Go 1.24, we get It's indeed better. It would be nice to get rid of the For the Docker image, we still get |
closes #1225
This adds a new global set by
-Xld variable,VersionStringwhich is injected during the Docker build. This can be fetched via thefrankenphp_versionlabels, as well as the current php version reported.