Skip to content

Commit

Permalink
fix: use more intuitive target name label
Browse files Browse the repository at this point in the history
  • Loading branch information
0x416e746f6e committed Mar 18, 2024
1 parent 271ce1b commit 7ff4c0f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions server/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ const (
defaultTargetGroup = "__default"
groupVirtualEndpoint = "__group"

keyTargetEndpoint = "node_monitor_target_endpoint"
keyTargetGroup = "node_monitor_target_group"
keyTargetID = "node_monitor_target_id"
keyTargetName = "node_monitor_target_name"
keyTargetGroup = "node_monitor_target_group"
keyTargetID = "node_monitor_target_id"
)

func (s *Server) handleEventEthNewHeader(
Expand All @@ -40,7 +40,7 @@ func (s *Server) handleEventEthNewHeader(
latency_s := g.RegisterBlockAndGetLatency(block, ts).Seconds()

attrs := []attribute.KeyValue{
{Key: keyTargetEndpoint, Value: attribute.StringValue(ename)},
{Key: keyTargetName, Value: attribute.StringValue(ename)},
{Key: keyTargetGroup, Value: attribute.StringValue(normalisedGroup(gname))},
{Key: keyTargetID, Value: attribute.StringValue(utils.MakeELEndpointID(gname, ename))},
}
Expand All @@ -65,7 +65,7 @@ func (s *Server) handleHealthcheck(w http.ResponseWriter, r *http.Request) {
func (s *Server) handleEventPrometheusObserve(_ context.Context, o metric.Observer) error {
s.state.IterateELGroupsRO(func(gname string, g *state.ELGroup) {
attrs := []attribute.KeyValue{
{Key: keyTargetEndpoint, Value: attribute.StringValue(groupVirtualEndpoint)},
{Key: keyTargetName, Value: attribute.StringValue(groupVirtualEndpoint)},
{Key: keyTargetGroup, Value: attribute.StringValue(normalisedGroup(gname))},
}

Expand All @@ -79,7 +79,7 @@ func (s *Server) handleEventPrometheusObserve(_ context.Context, o metric.Observ

g.IterateEndpointsRO(func(ename string, e *state.ELEndpoint) {
attrs := []attribute.KeyValue{
{Key: keyTargetEndpoint, Value: attribute.StringValue(ename)},
{Key: keyTargetName, Value: attribute.StringValue(ename)},
{Key: keyTargetGroup, Value: attribute.StringValue(normalisedGroup(gname))},
{Key: keyTargetID, Value: attribute.StringValue(utils.MakeELEndpointID(gname, ename))},
}
Expand Down

0 comments on commit 7ff4c0f

Please sign in to comment.