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

Metrics: Add algod version to metrics #6003

Merged
merged 4 commits into from
Jun 26, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions daemon/algod/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"os"
"os/signal"
"path/filepath"
"runtime"
"strings"
"syscall"
"time"
Expand Down Expand Up @@ -230,6 +231,16 @@
NodeExporterPath: cfg.NodeExporterPath,
})

var currentVersion = config.GetCurrentVersion()
var algodEnvironmentAlgodVersionGauge = metrics.MakeGauge(metrics.MetricName{Name: "algod_environment_algod_version", Description: "Version of the Algod binary"})
hsoerensen marked this conversation as resolved.
Show resolved Hide resolved
algodEnvironmentAlgodVersionGauge.SetLabels(1, map[string]string{
hsoerensen marked this conversation as resolved.
Show resolved Hide resolved
"version": fmt.Sprintf("%d.%d.%d", currentVersion.Major, currentVersion.Minor, currentVersion.BuildNumber),
cce marked this conversation as resolved.
Show resolved Hide resolved
"goarch": runtime.GOARCH,
"goos": runtime.GOOS,
"commit": currentVersion.CommitHash,
"channel": currentVersion.Channel,
})

Check warning on line 242 in daemon/algod/server.go

View check run for this annotation

Codecov / codecov/patch

daemon/algod/server.go#L234-L242

Added lines #L234 - L242 were not covered by tests

var serverNode ServerNode
if cfg.EnableFollowMode {
var followerNode *node.AlgorandFollowerNode
Expand Down
Loading