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

Merged
merged 21 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d3b150c
add netwok tag to metrics
virajbhartiya Nov 28, 2024
747f087
Enhance metrics by adding network tag to daemon and miner commands
virajbhartiya Nov 29, 2024
e420b87
Update CHANGELOG
virajbhartiya Nov 29, 2024
83a2bca
minor fix
virajbhartiya Nov 29, 2024
a80b86b
Update cmd/lotus-miner/run.go
virajbhartiya Dec 4, 2024
1ab14ea
Update cmd/lotus/daemon.go
virajbhartiya Dec 4, 2024
3080368
chore: remove unused import
virajbhartiya Dec 10, 2024
78e0bf5
Merge branch 'master' into network-tag
virajbhartiya Dec 10, 2024
be5d79a
feat(metrics): add network tagging to context across multiple files
virajbhartiya Dec 11, 2024
65a02f6
refactor(imports): reorganize and clean up imports in rcmgr.go, manag…
virajbhartiya Dec 11, 2024
775cfac
feat(metrics): implement AddNetworkTag function for consistent networ…
virajbhartiya Dec 12, 2024
1244845
feat(metrics): update context tagging for network metrics in StorageA…
virajbhartiya Dec 12, 2024
01e8501
refactor(metrics): replace buildconstants with AddNetworkTag for cons…
virajbhartiya Dec 16, 2024
fc56efa
chore(metrics): remove AddNetworkTag calls from multiple files and up…
virajbhartiya Dec 17, 2024
b678818
Update CHANGELOG.md
rvagg Dec 17, 2024
729d0e9
Apply suggestions from code review
rvagg Dec 17, 2024
58bbd4f
Update storage/paths/db_index.go
rvagg Dec 17, 2024
410ec91
Merge branch 'master' into network-tag
rvagg Dec 17, 2024
1e2fe5f
Update CHANGELOG.md
rvagg Dec 17, 2024
c64b4df
Update CHANGELOG.md
rvagg Dec 18, 2024
2fa37a5
Merge branch 'master' into network-tag
rvagg Dec 18, 2024
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ The Lotus v1.31.0 release introduces the new `ChainIndexer` subsystem, enhancing
- Return a "data" field on the "error" returned from RPC when `eth_call` and `eth_estimateGas` APIs encounter `execution reverted` errors. This is a standard expectation of Ethereum RPC tooling and may improve compatibility in some cases. ([filecoin-project/lotus#12553](https://github.com/filecoin-project/lotus/pull/12553))
- Improve ETH-filter performance for nodes serving many clients. ([filecoin-project/lotus#12603](https://github.com/filecoin-project/lotus/pull/12603))
- Implement F3 utility CLIs to list the power table for a given instance and sum the proportional power of a set of actors that participate in a given instance. ([filecoin-project/lotus#12698](https://github.com/filecoin-project/lotus/pull/12698))
- Lotus now reports the network name in the metrics. ([filecoin-project/lotus#12733](https://github.com/filecoin-project/lotus/pull/12733))

## Bug Fixes
rvagg marked this conversation as resolved.
Show resolved Hide resolved

## 🐛 Bug Fix Highlights
- Add logic to check if the miner's owner address is delegated (f4 address). If it is delegated, the `lotus-shed sectors termination-estimate` command now sends the termination state call using the worker ID. This fix resolves the issue where termination-estimate did not function correctly for miners with delegated owner addresses. ([filecoin-project/lotus#12569](https://github.com/filecoin-project/lotus/pull/12569))
Expand All @@ -36,6 +39,7 @@ The Lotus v1.31.0 release introduces the new `ChainIndexer` subsystem, enhancing
- Return a consistent error when encountering null rounds in ETH RPC method calls. ([filecoin-project/lotus#12655](https://github.com/filecoin-project/lotus/pull/12655))
- Correct erroneous sector QAP-calculation upon sector extension in lotus-miner cli. ([filecoin-project/lotus#12720](https://github.com/filecoin-project/lotus/pull/12720))


virajbhartiya marked this conversation as resolved.
Show resolved Hide resolved
## 📝 Changelog

For the full set of changes since the last stable release:
Expand Down
10 changes: 9 additions & 1 deletion blockstore/splitstore/splitstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ import (
ipld "github.com/ipfs/go-ipld-format"
logging "github.com/ipfs/go-log/v2"
"go.opencensus.io/stats"
"go.opencensus.io/tag"
"go.uber.org/multierr"
"golang.org/x/xerrors"

"github.com/filecoin-project/go-state-types/abi"

bstore "github.com/filecoin-project/lotus/blockstore"
"github.com/filecoin-project/lotus/build/buildconstants"
"github.com/filecoin-project/lotus/chain/actors/policy"
"github.com/filecoin-project/lotus/chain/stmgr"
"github.com/filecoin-project/lotus/chain/types"
Expand Down Expand Up @@ -266,7 +268,13 @@ func Open(path string, ds dstore.Datastore, hot, cold bstore.Blockstore, cfg *Co
ss.txnViewsCond.L = &ss.txnViewsMx
ss.txnSyncCond.L = &ss.txnSyncMx
ss.chainSyncCond.L = &ss.chainSyncMx
ss.ctx, ss.cancel = context.WithCancel(context.Background())

baseCtx := context.Background()
ctx, err := tag.New(baseCtx, tag.Insert(metrics.Network, buildconstants.NetworkBundle))
if err != nil {
return nil, xerrors.Errorf("failed to create context with network tag: %w", err)
}
virajbhartiya marked this conversation as resolved.
Show resolved Hide resolved
ss.ctx, ss.cancel = context.WithCancel(ctx)

ss.reifyCond.L = &ss.reifyMx
ss.reifyPend = make(map[cid.Cid]struct{})
Expand Down
2 changes: 2 additions & 0 deletions cmd/lotus-miner/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,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 @@ -59,6 +60,7 @@ var runCmd = &cli.Command{
tag.Insert(metrics.Version, build.MinerBuildVersion),
tag.Insert(metrics.Commit, build.CurrentCommit),
tag.Insert(metrics.NodeType, "miner"),
tag.Insert(metrics.Network, buildconstants.NetworkBundle),
)
// Register all metric views
if err := view.Register(
Expand Down
2 changes: 1 addition & 1 deletion cmd/lotus/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,11 @@ var DaemonCmd = &cli.Command{
default:
return fmt.Errorf("unrecognized profile type: %q", profile)
}

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, buildconstants.NetworkBundle),
)
// Register all metric views
if err = view.Register(
Expand Down
Loading
Loading