Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func NewGRPCController(proxyGRPCServer *nbgrpc.ProxyServiceServer, meter metric.
// SendServiceUpdateToCluster sends a service update to a specific proxy cluster.
func (c *GRPCController) SendServiceUpdateToCluster(ctx context.Context, accountID string, update *proto.ProxyMapping, clusterAddr string) {
c.proxyGRPCServer.SendServiceUpdateToCluster(ctx, update, clusterAddr)
c.metrics.IncrementServiceUpdateSendCount(clusterAddr)
c.metrics.IncrementServiceUpdateSendCount()
}

// GetOIDCValidationConfig returns the OIDC validation configuration from the gRPC server.
Expand All @@ -53,7 +53,7 @@ func (c *GRPCController) RegisterProxyToCluster(ctx context.Context, clusterAddr
proxySet.(*sync.Map).Store(proxyID, struct{}{})
log.WithContext(ctx).Debugf("Registered proxy %s to cluster %s", proxyID, clusterAddr)

c.metrics.IncrementProxyConnectionCount(clusterAddr)
c.metrics.IncrementProxyConnectionCount()

return nil
}
Expand All @@ -67,7 +67,7 @@ func (c *GRPCController) UnregisterProxyFromCluster(ctx context.Context, cluster
proxySet.(*sync.Map).Delete(proxyID)
log.WithContext(ctx).Debugf("Unregistered proxy %s from cluster %s", proxyID, clusterAddr)

c.metrics.DecrementProxyConnectionCount(clusterAddr)
c.metrics.DecrementProxyConnectionCount()
}
return nil
}
Expand Down
22 changes: 6 additions & 16 deletions management/internals/modules/reverseproxy/proxy/manager/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package manager
import (
"context"

"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/metric"
)

Expand Down Expand Up @@ -48,25 +47,16 @@ func newMetrics(meter metric.Meter) (*metrics, error) {
}, nil
}

func (m *metrics) IncrementProxyConnectionCount(clusterAddr string) {
m.proxyConnectionCount.Add(context.Background(), 1,
metric.WithAttributes(
attribute.String("cluster", clusterAddr),
))
func (m *metrics) IncrementProxyConnectionCount() {
m.proxyConnectionCount.Add(context.Background(), 1)
}

func (m *metrics) DecrementProxyConnectionCount(clusterAddr string) {
m.proxyConnectionCount.Add(context.Background(), -1,
metric.WithAttributes(
attribute.String("cluster", clusterAddr),
))
func (m *metrics) DecrementProxyConnectionCount() {
m.proxyConnectionCount.Add(context.Background(), -1)
}

func (m *metrics) IncrementServiceUpdateSendCount(clusterAddr string) {
m.serviceUpdateSendCount.Add(context.Background(), 1,
metric.WithAttributes(
attribute.String("cluster", clusterAddr),
))
func (m *metrics) IncrementServiceUpdateSendCount() {
m.serviceUpdateSendCount.Add(context.Background(), 1)
}

func (m *metrics) IncrementProxyHeartbeatCount() {
Expand Down
Loading