From d75e4be11fa23626e260cfa08b4bbb870faa69fe Mon Sep 17 00:00:00 2001 From: Moby von Briesen Date: Wed, 2 Dec 2020 17:17:59 -0500 Subject: [PATCH] satellite/{accounting, contact}: Remove periods and spaces from metrics. Change-Id: I84179c2931293e3a1eb0ff8050416d25e481ce07 --- monkit.lock | 23 ++++++++++++++++------- satellite/accounting/tally/tally.go | 29 ++++++++++++++--------------- satellite/contact/service.go | 4 ++-- 3 files changed, 32 insertions(+), 24 deletions(-) diff --git a/monkit.lock b/monkit.lock index 6f61ad631..d1f73c00e 100644 --- a/monkit.lock +++ b/monkit.lock @@ -1,11 +1,18 @@ storj.io/storj/cmd/segment-reaper."zombie_segments" IntVal -storj.io/storj/satellite/accounting/tally."total.bytes" IntVal -storj.io/storj/satellite/accounting/tally."total.inline_bytes" IntVal -storj.io/storj/satellite/accounting/tally."total.inline_segments" IntVal -storj.io/storj/satellite/accounting/tally."total.objects" IntVal -storj.io/storj/satellite/accounting/tally."total.remote_bytes" IntVal -storj.io/storj/satellite/accounting/tally."total.remote_segments" IntVal -storj.io/storj/satellite/accounting/tally."total.segments" IntVal +storj.io/storj/satellite/accounting/tally."bucket_bytes" IntVal +storj.io/storj/satellite/accounting/tally."bucket_inline_bytes" IntVal +storj.io/storj/satellite/accounting/tally."bucket_inline_segments" IntVal +storj.io/storj/satellite/accounting/tally."bucket_objects" IntVal +storj.io/storj/satellite/accounting/tally."bucket_remote_bytes" IntVal +storj.io/storj/satellite/accounting/tally."bucket_remote_segments" IntVal +storj.io/storj/satellite/accounting/tally."bucket_segments" IntVal +storj.io/storj/satellite/accounting/tally."total_bytes" IntVal +storj.io/storj/satellite/accounting/tally."total_inline_bytes" IntVal +storj.io/storj/satellite/accounting/tally."total_inline_segments" IntVal +storj.io/storj/satellite/accounting/tally."total_objects" IntVal +storj.io/storj/satellite/accounting/tally."total_remote_bytes" IntVal +storj.io/storj/satellite/accounting/tally."total_remote_segments" IntVal +storj.io/storj/satellite/accounting/tally."total_segments" IntVal storj.io/storj/satellite/audit."audit_contained_nodes" IntVal storj.io/storj/satellite/audit."audit_contained_nodes_global" Meter storj.io/storj/satellite/audit."audit_contained_percentage" FloatVal @@ -39,6 +46,8 @@ storj.io/storj/satellite/audit."reverify_total_in_segment" IntVal storj.io/storj/satellite/audit."reverify_unknown" IntVal storj.io/storj/satellite/audit."reverify_unknown_global" Meter storj.io/storj/satellite/audit."verify_shares_downloaded_successfully" IntVal +storj.io/storj/satellite/contact."failed_dial" Event +storj.io/storj/satellite/contact."failed_ping_node" Event storj.io/storj/satellite/gracefulexit."graceful_exit_fail_max_failures_percentage" Meter storj.io/storj/satellite/gracefulexit."graceful_exit_fail_validation" Meter storj.io/storj/satellite/gracefulexit."graceful_exit_final_bytes_transferred" IntVal diff --git a/satellite/accounting/tally/tally.go b/satellite/accounting/tally/tally.go index ea9b79d65..080285fcc 100644 --- a/satellite/accounting/tally/tally.go +++ b/satellite/accounting/tally/tally.go @@ -185,26 +185,25 @@ func (service *Service) Tally(ctx context.Context) (err error) { if len(observer.Bucket) > 0 { var total accounting.BucketTally for _, bucket := range observer.Bucket { - monAccounting.IntVal("bucket.objects").Observe(bucket.ObjectCount) + monAccounting.IntVal("bucket_objects").Observe(bucket.ObjectCount) //mon:locked + monAccounting.IntVal("bucket_segments").Observe(bucket.Segments()) //mon:locked + monAccounting.IntVal("bucket_inline_segments").Observe(bucket.InlineSegments) //mon:locked + monAccounting.IntVal("bucket_remote_segments").Observe(bucket.RemoteSegments) //mon:locked - monAccounting.IntVal("bucket.segments").Observe(bucket.Segments()) - monAccounting.IntVal("bucket.inline_segments").Observe(bucket.InlineSegments) - monAccounting.IntVal("bucket.remote_segments").Observe(bucket.RemoteSegments) - - monAccounting.IntVal("bucket.bytes").Observe(bucket.Bytes()) - monAccounting.IntVal("bucket.inline_bytes").Observe(bucket.InlineBytes) - monAccounting.IntVal("bucket.remote_bytes").Observe(bucket.RemoteBytes) + monAccounting.IntVal("bucket_bytes").Observe(bucket.Bytes()) //mon:locked + monAccounting.IntVal("bucket_inline_bytes").Observe(bucket.InlineBytes) //mon:locked + monAccounting.IntVal("bucket_remote_bytes").Observe(bucket.RemoteBytes) //mon:locked total.Combine(bucket) } - monAccounting.IntVal("total.objects").Observe(total.ObjectCount) //mon:locked + monAccounting.IntVal("total_objects").Observe(total.ObjectCount) //mon:locked - monAccounting.IntVal("total.segments").Observe(total.Segments()) //mon:locked - monAccounting.IntVal("total.inline_segments").Observe(total.InlineSegments) //mon:locked - monAccounting.IntVal("total.remote_segments").Observe(total.RemoteSegments) //mon:locked + monAccounting.IntVal("total_segments").Observe(total.Segments()) //mon:locked + monAccounting.IntVal("total_inline_segments").Observe(total.InlineSegments) //mon:locked + monAccounting.IntVal("total_remote_segments").Observe(total.RemoteSegments) //mon:locked - monAccounting.IntVal("total.bytes").Observe(total.Bytes()) //mon:locked - monAccounting.IntVal("total.inline_bytes").Observe(total.InlineBytes) //mon:locked - monAccounting.IntVal("total.remote_bytes").Observe(total.RemoteBytes) //mon:locked + monAccounting.IntVal("total_bytes").Observe(total.Bytes()) //mon:locked + monAccounting.IntVal("total_inline_bytes").Observe(total.InlineBytes) //mon:locked + monAccounting.IntVal("total_remote_bytes").Observe(total.RemoteBytes) //mon:locked } // return errors if something went wrong. diff --git a/satellite/contact/service.go b/satellite/contact/service.go index 0555a6bcb..8b7b6bede 100644 --- a/satellite/contact/service.go +++ b/satellite/contact/service.go @@ -83,7 +83,7 @@ func (service *Service) PingBack(ctx context.Context, nodeurl storj.NodeURL) (_ // If there is an error from trying to dial and ping the node, return that error as // pingErrorMessage and not as the err. We want to use this info to update // node contact info and do not want to terminate execution by returning an err - mon.Event("failed dial") + mon.Event("failed_dial") //mon:locked pingNodeSuccess = false pingErrorMessage = fmt.Sprintf("failed to dial storage node (ID: %s) at address %s: %q", nodeurl.ID, nodeurl.Address, err, @@ -97,7 +97,7 @@ func (service *Service) PingBack(ctx context.Context, nodeurl storj.NodeURL) (_ _, err = client.pingNode(ctx, &pb.ContactPingRequest{}) if err != nil { - mon.Event("failed ping node") + mon.Event("failed_ping_node") //mon:locked pingNodeSuccess = false pingErrorMessage = fmt.Sprintf("failed to ping storage node, your node indicated error code: %d, %q", rpcstatus.Code(err), err) service.log.Debug("pingBack pingNode error",