Werk #22250 · Nov 26, 26
Telemetry metrics: Name hosts via templates and use several rules
You can now decide how the dynamic host management connection Telemetry metrics names the hosts it creates from OpenTelemetry data. Instead of using the value of a single resource attribute as in 2.5.0, in 3.0.0 you define a host name template. You can also add several host name lookup rules to one connection, each with its own filters and template. This way you can map your OpenTelemetry data to hosts even if it has no attribute that fits as a host name.
You find the connection under Setup > Hosts > Dynamic host management.
Naming hosts with host name templates
In the option Host name template used to name the hosts, you combine free text with macros that insert the value of an OpenTelemetry attribute:
$RESOURCE_ATTR.<key>$: an attribute of the resource that sends the data, for example a service, pod or node.$SCOPE_ATTR.<key>$: an attribute of the instrumentation scope, that is, the library that produced the metrics.$DATA_POINT_ATTR.<key>$: an attribute (label) of a single metric data point.
<key> is the name of the attribute, for example service.name or k8s.namespace.name.
Example: the template deployment_$RESOURCE_ATTR.k8s.namespace.name$_$RESOURCE_ATTR.k8s.deployment.name$ turns data with the resource attributes k8s.namespace.name=production and k8s.deployment.name=nginx into the host deployment_production_nginx.
Rules for templates:
- A template must contain at least one macro.
- Its free text may only contain letters, digits,
-,_and., and the template must not start with-or.. - In the attribute values, characters that are not allowed in host names are replaced with
_. - The default template is
$RESOURCE_ATTR.service.name$.
Each distinct combination of attribute values results in one host.
Data that lacks one of the attributes used in the template is not assigned to any host.
If different attribute values result in the same host name, that host intentionally receives the data of all of them.
Because this can also mean that the template is not specific enough, the connection logs a warning with the affected host names to var/log/dcd.log.
Using several host name lookup rules per connection
The list Telemetry Host and Service configuration can now hold several host name lookup rules. Each rule has its own filters in Select telemetry data for host creation and its own host name template. The filters decide both which data creates hosts and which metrics become services on those hosts.
For example, a rule with the template $RESOURCE_ATTR.k8s.deployment.name$ creates one host per Kubernetes deployment, because data without this attribute is skipped.
A second rule with the filter deployment.environment = on-prem and the template $RESOURCE_ATTR.service.name$ creates hosts for your standalone services.
A host that results from several rules receives the data of all of them. If two rules provide a metric with the same name for a host, the rule higher in the list is used. The host creation options and the Maximum number of hosts apply to all rules of the connection together.
In the properties of a created host, the attribute OpenTelemetry data shows the attribute values that identify the host as filters.
Automatic migration of existing connections
Existing connections are migrated automatically: the previously configured resource attribute becomes the template $RESOURCE_ATTR.<key>$ in a single rule.
Removed host name lookup for other hosts
For the removal of the host name lookup on manually created hosts, piggyback hosts and folders, see werk #18766.
Details
- Class:
- New Features
- Level:
- Prominent
- Component:
- Telemetry
- Versions:
- 3.0.0b1Not yet releasedUltimateUltimate + MTCloud