Health service interface

interface Health {
    checks?: Checks;
    description?: string;
    instanceId: string;
    links?: { about?: string; related?: string; self?: string };
    name: string;
    namespace?: `x-${string}`;
    notes?: string[];
    output?: string;
    release: string;
    serviceGroupId?: string;
    serviceId?: string;
    status: "pass" | "fail" | "warn";
    tags?: string[];
    version: string;
}

Hierarchy (View Summary)

Properties

checks?: Checks

The “checks” object MAY have a number of unique keys, one for each logical sub-components. Since each sub-component may be backed by several nodes with varying health statuses, the key points to an array of objects. In case of a single-node sub-component (or if presence of nodes is not relevant), a single-element array should be used as the value, for consistency. The key identifying an element in the object should be a unique string within the details section. It MAY have two parts: {componentName}:{metricName}, in which case the meaning of the parts SHOULD be as follows:

  • componentName: Human-readable name for the component. MUST not contain a colon, in the name, since colon is used as a separator
  • metricName: Name of the metrics that the status is reported for. MUST not contain a colon, in the name, since colon is used as a separator and can be one of:
    • Pre-defined value from this spec. Pre-defined values include:
      • utilization
      • responseTime
      • connections
      • uptime
    • A common and standard term from a well-known source such as schema.org, IANA or microformats.
    • A URI that indicates extra semantics and processing rules that MAY be provided by a resource at the other end of the URI. URIs do not have to be dereferenceable, however. They are just a namespace, and the meaning of a namespace CAN be provided by any convenient means (e.g. publishing an RFC, Swagger document or a nicely printed book).
description?: string

Service description

`My own service description`
instanceId: string

Service instance unique identification within the scope of the service identification

`085f47e9-7fad-4da1-b5e5-31fc6eed9f94`
links?: { about?: string; related?: string; self?: string }

Service related links

Type declaration

  • Optionalabout?: string

    About link for the service

    `https://www.mytra.es/about`
    
  • Optionalrelated?: string

    Related link for the service

    `https://www.mytra.es`
    
  • Optionalself?: string

    Link to the own service or health endpoint

    `http://localhost:3000/v1/health`
    
name: string

Service name

`myOwnService`
namespace?: `x-${string}`

Service namespace, used to identify declare which namespace the service belongs to. It must start with x- as it is a custom namespace and will be used for custom headers, openc2 commands, etc.

`x-mytra`
notes?: string[]

Array of notes relevant to current state of health

output?: string

Raw error output, in case of “fail” or “warn” states. This field SHOULD be omitted for “pass” state.

release: string

Service release. Its recommended to use semantic versioning.

`1.0.0`
serviceGroupId?: string

Service group unique identification

`firehose`, `driver`
serviceId?: string

Service unique identification

`uplink-firehose`, `mqtt-driver`
status: "pass" | "fail" | "warn"

Indicates whether the service status is acceptable or not

tags?: string[]

List of string values that can be used to add service-level labels.

`["primary", "test"]`
version: string

Service version

`1`