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 1 commit
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# UNRELEASED

- Add json output of tipsets to `louts chain list`. ([filecoin-project/lotus#12691](https://github.com/filecoin-project/lotus/pull/12691))
- Lotus now reports the network name in the metrics. ([filecoin-project/lotus#12733](https://github.com/filecoin-project/lotus/pull/12733))
rvagg marked this conversation as resolved.
Show resolved Hide resolved
rvagg marked this conversation as resolved.
Show resolved Hide resolved

# UNRELEASED v.1.32.0

Expand All @@ -28,7 +29,6 @@ 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

Expand Down
3 changes: 0 additions & 3 deletions storage/paths/db_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ func (dbi *DBIndex) StorageDetach(ctx context.Context, id storiface.ID, url stri
}

func (dbi *DBIndex) StorageReportHealth(ctx context.Context, id storiface.ID, report storiface.HealthReport) error {
ctx = metrics.AddNetworkTag(ctx)

rvagg marked this conversation as resolved.
Show resolved Hide resolved
retryWait := time.Millisecond * 20
retryReportHealth:
Expand Down Expand Up @@ -380,7 +379,6 @@ func (dbi *DBIndex) checkFileType(fileType storiface.SectorFileType) bool {
}

func (dbi *DBIndex) StorageDeclareSector(ctx context.Context, storageID storiface.ID, s abi.SectorID, ft storiface.SectorFileType, primary bool) error {
ctx = metrics.AddNetworkTag(ctx)

if !dbi.checkFileType(ft) {
return xerrors.Errorf("invalid filetype")
Expand Down Expand Up @@ -681,7 +679,6 @@ func (dbi *DBIndex) StorageInfo(ctx context.Context, id storiface.ID) (storiface
}

func (dbi *DBIndex) StorageBestAlloc(ctx context.Context, allocate storiface.SectorFileType, ssize abi.SectorSize, pathType storiface.PathType, miner abi.ActorID) ([]storiface.StorageInfo, error) {
ctx = metrics.AddNetworkTag(ctx)

rvagg marked this conversation as resolved.
Show resolved Hide resolved
var err error
var spaceReq uint64
Expand Down
5 changes: 0 additions & 5 deletions storage/paths/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"github.com/filecoin-project/go-state-types/proof"

"github.com/filecoin-project/lotus/lib/result"
"github.com/filecoin-project/lotus/metrics"
"github.com/filecoin-project/lotus/storage/sealer/fsutil"
"github.com/filecoin-project/lotus/storage/sealer/storiface"
)
Expand Down Expand Up @@ -240,8 +239,6 @@ func (st *Local) OpenPath(ctx context.Context, p string) error {
return err
}

ctx = metrics.AddNetworkTag(ctx)

err = st.index.StorageAttach(ctx, storiface.StorageInfo{
ID: meta.ID,
URLs: st.urls,
Expand Down Expand Up @@ -334,8 +331,6 @@ func (st *Local) Redeclare(ctx context.Context, filterId *storiface.ID, dropMiss
continue
}

ctx = metrics.AddNetworkTag(ctx)

err = st.index.StorageAttach(ctx, storiface.StorageInfo{
ID: id,
URLs: st.urls,
Expand Down
3 changes: 0 additions & 3 deletions storage/wdpost/wdpost_changehandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (

"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/metrics"
)

const (
Expand Down Expand Up @@ -211,7 +210,6 @@ func (p *proveHandler) run() {
}

func (p *proveHandler) processHeadChange(ctx context.Context, newTS *types.TipSet, di *dline.Info) {
ctx = metrics.AddNetworkTag(ctx)
// If the post window has expired, abort the current proof
if p.current != nil && newTS.Height() >= p.current.di.Close {
// Cancel the context on the current proof
Expand Down Expand Up @@ -389,7 +387,6 @@ func (s *submitHandler) run() {

// processHeadChange is called when the chain head changes
func (s *submitHandler) processHeadChange(ctx context.Context, revert *types.TipSet, advance *types.TipSet, di *dline.Info) {
ctx = metrics.AddNetworkTag(ctx)
s.currentCtx = ctx
s.currentTS = advance
s.currentDI = di
Expand Down