[#77] Add metrics for HTTP endpoint status #78
Labels
No Label
P0
P1
P2
P3
good first issue
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-http-gw#78
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "mbiryukova/frostfs-http-gw:feature/add_metrics_for_http_endpoints"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Closes #77
Signed-off-by: Marina Biryukova m.biryukova@yadro.com
62a91356b5
to942873d72b
@ -233,0 +245,4 @@
m.mu.RLock()
if !m.enabled {
m.mu.RUnlock()
return
Let's create new method
then we can write in functions like this simply
@ -510,3 +534,4 @@
a.log.Warn("failed to add server", append(fields, zap.Error(err))...)
continue
}
a.metrics.MarkHealthy(serverInfo.Address)
Maybe we can also add label to see if tls is enabled ? @alexvanin
This info is available in config and it can't be changed in runtime, so I think we are good without this label for now.
@ -69,0 +73,4 @@
Subsystem: httpServerSubsystem,
Name: healthMetric,
Help: "HTTP Server endpoint health",
VariableLabels: []string{endpointLabel},
Let's keep label names not in constants (as other metrics):
@ -16,0 +13,4 @@
namespace = "frostfs_http_gw"
stateSubsystem = "state"
poolSubsystem = "pool"
httpServerSubsystem = "http_server"
Maybe we can rename this to just
server
? To have the full metric namefrostfs_http_gw_server_health
rather thanfrostfs_http_gw_http_server_health
?@ -195,0 +224,4 @@
}
func (m httpServerMetrics) MarkUnhealthy(endpoint string) {
m.endpointHealth.With(prometheus.Labels{endpointLabel: endpoint}).Set(float64(0))
We can just write
942873d72b
to5cdc6d87d7
5cdc6d87d7
to2dc990ad4b
LGTM
2dc990ad4b
todbc6804d27