Jaeger: Return `uptime` or something similar for `/health` endpoint

Created on 2 Apr 2019  路  3Comments  路  Source: jaegertracing/jaeger

Currently, the /health endpoint returns a 204 when it becomes Ready, which isn't a great indicator of whether the service is healthy or not.

// New creates a HealthCheck with the specified initial state.
func New() *HealthCheck {
    hc := &HealthCheck{
        state: int32(Unavailable),
        mapping: map[Status]int{
            Unavailable: http.StatusServiceUnavailable,
            Ready:       http.StatusNoContent,
        },
        logger: zap.NewNop(),
    }
    return hc
}

However, it would be nice to return a 200 and something like:
{"ok":true,"status":"up"} or even {"uptime":1h20m}, etc.

good first issue help wanted

Most helpful comment

We indicate the status via HTTP status code, but I don't mind returning it in JSON as well. And I like the idea of uptime, so:

{
    "status": "unavailable"
}
{
    "status": "up",
    "uptime": "1h20m"
}

All 3 comments

I can probably tackle this when I get some time.

We indicate the status via HTTP status code, but I don't mind returning it in JSON as well. And I like the idea of uptime, so:

{
    "status": "unavailable"
}
{
    "status": "up",
    "uptime": "1h20m"
}

The initial idea was to indeed return some content, like the status of the connection to the backing storage, but we never ended up doing that.

Uptime is indeed something we can return right now. Perhaps another field indicating when it has started could also be helpful? Parsing 2019-04-03T09:31:07+02:00 is usually easier (and more accurate) than the uptime.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mabn picture mabn  路  4Comments

Disturbing picture Disturbing  路  5Comments

tomaszturkowski picture tomaszturkowski  路  4Comments

elgalu picture elgalu  路  3Comments

albertteoh picture albertteoh  路  3Comments