mirror of
https://github.com/prometheus/prometheus
synced 2024-12-26 00:23:18 +00:00
Include humanized target state strings.
In the current /status implementation, we cannot divine what the target's state is but rather get an integer constant for it. This commit, stringifies the constants.
This commit is contained in:
parent
8358e5ee44
commit
5a9417f80a
@ -28,6 +28,19 @@ const (
|
||||
// The state of the given Target.
|
||||
type TargetState int
|
||||
|
||||
func (t TargetState) String() string {
|
||||
switch t {
|
||||
case UNKNOWN:
|
||||
return "UNKNOWN"
|
||||
case ALIVE:
|
||||
return "ALIVE"
|
||||
case UNREACHABLE:
|
||||
return "UNREACHABLE"
|
||||
}
|
||||
|
||||
panic("unknown state")
|
||||
}
|
||||
|
||||
const (
|
||||
// The Target has not been seen; we know nothing about it, except that it is
|
||||
// on our docket for examination.
|
||||
|
Loading…
Reference in New Issue
Block a user