Feat: update the pr as per comment

This commit is contained in:
Manendra Pal Singh
2026-02-27 19:05:09 +05:30
parent 1293c241f7
commit 59aa058920
13 changed files with 159 additions and 178 deletions

View File

@@ -4,6 +4,7 @@ import (
"context"
"fmt"
"net/http"
"strings"
"sync"
"github.com/beckn-one/beckn-onix/pkg/telemetry"
@@ -79,10 +80,10 @@ func RecordHTTPRequest(ctx context.Context, statusCode int, action, role, sender
metric_code := action + "_api_total_count"
category := "NetworkHealth"
if action == "/search" || action == "/discovery" {
if strings.HasSuffix(action, "/search") || strings.HasSuffix(action, "/discovery") {
category = "Discovery"
}
attributes = append(attributes, specHttpMetricAttr(metric_code, category)...) //TODO: need to update as per the furthur discussion
attributes = append(attributes, specHttpMetricAttr(metric_code, category)...)
m.HttpRequestCount.Add(ctx, 1, metric.WithAttributes(attributes...))
}