[#77] Add metrics for HTTP endpoint status #78
Labels
No labels
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 a new issue
No description provided.
Delete branch "mbiryukova/frostfs-http-gw:feature/add_metrics_for_http_endpoints"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. 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