Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
distractedm1nd committed May 3, 2023
1 parent f337f3e commit 723091f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions share/getters/shrex.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (m *metrics) recordNDAttempt(ctx context.Context, attemptCount int, success

func (sg *ShrexGetter) WithMetrics() error {
edsAttemptHistogram, err := meter.SyncInt64().Histogram(
"attempts_per_eds_request",
"getters_shrex_eds_attempts_per_request",
instrument.WithUnit(unit.Dimensionless),
instrument.WithDescription("Number of attempts per shrex/eds request"),
)
Expand All @@ -65,7 +65,7 @@ func (sg *ShrexGetter) WithMetrics() error {
}

ndAttemptHistogram, err := meter.SyncInt64().Histogram(
"attempts_per_nd_request",
"getters_shrex_nd_attempts_per_request",
instrument.WithUnit(unit.Dimensionless),
instrument.WithDescription("Number of attempts per shrex/nd request"),
)
Expand Down
12 changes: 6 additions & 6 deletions share/p2p/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ var meter = global.MeterProvider().Meter("shrex/eds")
type status string

const (
StatusInternalErr status = "InternalError"
StatusNotFound status = "NotFound"
StatusSuccess status = "Success"
StatusRateLimited status = "RateLimited"
StatusInternalErr status = "internal_err"
StatusNotFound status = "not_found"
StatusSuccess status = "success"
StatusRateLimited status = "rate_limited"
)

type Metrics struct {
Expand All @@ -37,7 +37,7 @@ func (m *Metrics) ObserveRequests(ctx context.Context, count int64, status statu

func InitClientMetrics(protocol string) (*Metrics, error) {
totalRequestCounter, err := meter.SyncInt64().Counter(
fmt.Sprintf("total_shrex_%s_requests", protocol),
fmt.Sprintf("shrex_%s_client_total_requests", protocol),
instrument.WithUnit(unit.Dimensionless),
instrument.WithDescription(fmt.Sprintf("Total count of sent shrex/%s requests", protocol)),
)
Expand All @@ -52,7 +52,7 @@ func InitClientMetrics(protocol string) (*Metrics, error) {

func InitServerMetrics(protocol string) (*Metrics, error) {
totalRequestCounter, err := meter.SyncInt64().Counter(
fmt.Sprintf("total_shrex_%s_responses", protocol),
fmt.Sprintf("shrex_%s_server_total_responses", protocol),
instrument.WithUnit(unit.Dimensionless),
instrument.WithDescription(fmt.Sprintf("Total count of sent shrex/%s responses", protocol)),
)
Expand Down

0 comments on commit 723091f

Please sign in to comment.