Skip to content

Host Configuration

Host Id

The host id is a unique identifier that is used as label to identify on which host a metric has been generated. It is set to the value of the /etc/machine-id file. This file is created by default in all Linux distribution and it is built to be globally unique.

The file can be manually modified to assign a custom id, but it is not recommended.

More information can be found here.

Host Location

The host location is guessed (unless the --no-ipinfo is specified) using the online http://ip-api.com service. The Telemetruum Leaf Exporter sends a request to http://ip-api.com/json and the service reply with the location guessed from the requester's IP address. This location can be inaccurate and can be influenced by firewalls and NATs.

To override the guessed location, it is possible to manually specify a location creating the /etc/machine-location file in the host with the following content:

<latitude>:<longitude>

For instance:

> cat /etc/machine-location
41.8967:12.4822

The host location is exposed by the tlum_host_info metric.

Host Labels

Host labels can be used to influence the ICOS matchmaking process (e.g. restric the possible targets to some specific nodes). There are two ways for specifying the labels. Both methods can be used at the same time (however if the same label is defined with different values, the result is not predicatable).

Host labels are exposed by the tlum_host_labels metric.

Specify the labels in the /etc/machine-labels file

Labels can be defined as <name>=<value> pairs in the file (one per line). For instance:

> cat /etc/machine-labels
role=server
uc=uc4
type=near-edge

Specify the labels in the runtime platform (Kubernetes or Docker)

Host labels can be defined exploiting the support for object labelling in Kubernetes and Docekr. In this case, to avoid clashes with other labels, ICOS label names should be defined in the format [prefix.]icos.eu/<suffix>. The following table shows how label names are transformed from Docker/Kubernetes to ICOS.

Docker/Kubernetes Label --> ICOS Label
icos.eu/role=server --> role=server
node.icos.eu/type=server --> node_type=server
invalid.icos.eu=val --> ‼ invalid

For Kubernetes, labels should be added to the Kubernetes node resource using the kubectl tool or editing the node resource through APIs. E.g.:

# synatx: kubectl label <node> <name>=<value>
> kubectl label node1 role=server

In Docker, labels should be added in the Docker daemon configuration file or as startup argument. See the dockerd command reference guide for more details. The docker system info command can be used to inspect the labels currently defined for the node. E.g.:

Specify the labels as Telemetruum Leaf Exporter arguments

It is possible to specify labels as arguments in the Telemetruum Leaf Exporter command line, for instance:

> telemetruum-leaf-exporter ... --static-host-label mylabel=myvalue --static-host-label "anotherLabel=secondValue" ...

Labels specified in the command line override labels with the same name defined with the other methods.

When the Telemetruum Leaf Exporter is deployed on Kubernetes with the Telemetruum Leaf Helm Chart, it is possible to specify the labels in the staticHostsLabels value and they will be translated in arguments for the Telemetruum Leaf Exporter command:

telemetruum-leaf-exporter:
  staticHostsLabels:
    myStaticLabel: myValue
    another_label: anotherValue

Warning

Static Host Labels specified as Helm values will be applied to all nodes of the cluster where the Telemetruum Leaf instance is being deployed