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

feat: add network tag to metrics #12733

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

- The miner actor builtin `QAPowerForWeight` no longer accepts the unused "dealWeight" parameter, the function signature now only takes 3 arguments: sectorSize, sectorDuration, verifiedWeight. ([filecoin-project/lotus#12445](https://github.com/filecoin-project/lotus/pull/12445))

- Lotus now reports the network name in the metrics. ([filecoin-project/lotus#12733](https://github.com/filecoin-project/lotus/pull/12733))

## Bug Fixes

- Make `EthTraceFilter` / `trace_filter` skip null rounds instead of erroring. ([filecoin-project/lotus#12702](https://github.com/filecoin-project/lotus/pull/12702))
Expand Down
4 changes: 4 additions & 0 deletions cmd/lotus-miner/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
_ "net/http/pprof"
"os"
"strings"

"github.com/multiformats/go-multiaddr"
"github.com/urfave/cli/v2"
Expand All @@ -16,6 +17,7 @@ import (
"github.com/filecoin-project/lotus/api/v0api"
"github.com/filecoin-project/lotus/api/v1api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/build/buildconstants"
lcli "github.com/filecoin-project/lotus/cli"
"github.com/filecoin-project/lotus/lib/ulimit"
"github.com/filecoin-project/lotus/metrics"
Expand Down Expand Up @@ -55,10 +57,12 @@ var runCmd = &cli.Command{
}
}

network := strings.Split(buildconstants.BuildTypeString(), "+")[1]
ctx, _ := tag.New(lcli.DaemonContext(cctx),
tag.Insert(metrics.Version, build.MinerBuildVersion),
tag.Insert(metrics.Commit, build.CurrentCommit),
tag.Insert(metrics.NodeType, "miner"),
tag.Insert(metrics.Network, network),
)
// Register all metric views
if err := view.Register(
Expand Down
3 changes: 2 additions & 1 deletion cmd/lotus/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,12 @@ var DaemonCmd = &cli.Command{
default:
return fmt.Errorf("unrecognized profile type: %q", profile)
}

network := strings.Split(buildconstants.BuildTypeString(), "+")[1]
ctx, _ := tag.New(context.Background(),
tag.Insert(metrics.Version, build.NodeBuildVersion),
tag.Insert(metrics.Commit, build.CurrentCommit),
tag.Insert(metrics.NodeType, "chain"),
tag.Insert(metrics.Network, network),
)
// Register all metric views
if err = view.Register(
Expand Down
Loading