mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-06 13:18:58 +00:00
feat: add :51090/metrics endpoint with Prometheus metrics listening on machine IP (#304)
Signed-off-by: Miek Gieben <miek@miek.nl> Co-authored-by: Pasha Sviderski <me@psviderski.name>
This commit is contained in:
1 parent
11df8e4a75
commit
24b81af43c
8 files changed
+169
-1
No files matched your search
@@ -11,6 +11,7 @@ import (
|
||||
"github.com/psviderski/uncloud/internal/daemon"
|
||||
"github.com/psviderski/uncloud/internal/log"
|
||||
"github.com/psviderski/uncloud/internal/machine"
|
||||
"github.com/psviderski/uncloud/internal/metrics"
|
||||
"github.com/psviderski/uncloud/internal/version"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
@@ -46,6 +47,8 @@ func main() {
|
||||
cmd.AddCommand(newDialStdioCommand())
|
||||
cmd.AddCommand(newVersionCommand())
|
||||
|
||||
metrics.Version.WithLabelValues(version.String()).Set(1)
|
||||
|
||||
// ctx is canceled when the daemon command is interrupted.
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
|
||||
|
||||
Reference in new issue
Block a user