Skip to content

Commit 9861677

Browse files
authored
[Metrics] Remove endpoint_url Exemplar and add endpoint_domain URL (#440)
- Remove `endpoint_url` examplar - Add `endpoint_domain` to all relevant metrics - Dashboard for per domain service results is here: https://grafana.tooling.grove.city/goto/SIdAx8rHR?orgId=1
1 parent 8c40e1c commit 9861677

File tree

6 files changed

+123
-184
lines changed

6 files changed

+123
-184
lines changed

data/legacy_protocol_shannon.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func setLegacyFieldsFromHTTPObservations(
114114
// Empty value if parsing the URL above failed.
115115
endpointDomain, err := shannonmetrics.ExtractDomainOrHost(endpointObservation.GetEndpointUrl())
116116
if err != nil {
117-
logger.With("endpoint_url", endpointObservation.EndpointUrl).Warn().Err(err).Msg("Could not extract domain from Shannon endpoint URL")
117+
logger.Error().Err(err).Msg("Could not extract domain from Shannon endpoint URL")
118118
return legacyRecord
119119
}
120120
legacyRecord.NodeDomain = endpointDomain
@@ -145,12 +145,12 @@ func setLegacyFieldsFromWebsocketConnectionObservation(
145145
// Set endpoint address to the supplier address.
146146
legacyRecord.NodeAddress = wsConnectionObs.GetSupplier()
147147

148-
// Extract and set the endpoint's domain from its URL.
149-
// Empty value if parsing the URL above failed.
150-
endpointDomain, err := shannonmetrics.ExtractDomainOrHost(wsConnectionObs.GetEndpointUrl())
148+
// Extract effective TLD+1 from endpoint URL.
149+
endpointUrl := wsConnectionObs.GetEndpointUrl()
150+
endpointDomain, err := shannonmetrics.ExtractDomainOrHost(endpointUrl)
151151
if err != nil {
152-
logger.With("endpoint_url", wsConnectionObs.EndpointUrl).Warn().Err(err).Msg("Could not extract domain from WebSocket endpoint URL")
153-
return legacyRecord
152+
logger.Error().Err(err).Msgf("Could not extract domain from endpoint URL %s.", endpointUrl)
153+
endpointDomain = shannonmetrics.ErrDomain
154154
}
155155
legacyRecord.NodeDomain = endpointDomain
156156

@@ -184,10 +184,11 @@ func setLegacyFieldsFromWebsocketMessageObservation(
184184

185185
// Extract and set the endpoint's domain from its URL.
186186
// Empty value if parsing the URL above failed.
187-
endpointDomain, err := shannonmetrics.ExtractDomainOrHost(wsMessageObs.GetEndpointUrl())
187+
endpointUrl := wsMessageObs.GetEndpointUrl()
188+
endpointDomain, err := shannonmetrics.ExtractDomainOrHost(endpointUrl)
188189
if err != nil {
189-
logger.With("endpoint_url", wsMessageObs.EndpointUrl).Warn().Err(err).Msg("Could not extract domain from WebSocket message endpoint URL")
190-
return legacyRecord
190+
logger.Error().Err(err).Msg("Could not extract domain from WebSocket message endpoint URL")
191+
endpointDomain = shannonmetrics.ErrDomain
191192
}
192193
legacyRecord.NodeDomain = endpointDomain
193194

0 commit comments

Comments
 (0)