We are talking about the metrics name when stored in Hawkular
Metrics,
correct ?
Yes, these will end up as part of the H-Metric names (HOSA does allow the user to define
their own IDs if they don't like the metric names coming from the resource, but the
name of the metric is the default and for Prometheus endpoints people will probably use
them and not define their own IDs).
With multiple agents,I guess we would need some kind of isolation
with a
prefix or tags or tenant or else ? What options do we have ?
We do use tenants - by default we set a metric's tenant to the same as the name of the
OpenShift project where that metric came from. You can see that here:
https://github.com/hawkular/hawkular-openshift-agent/blob/master/deploy/o...
And we already support an ID prefix. As you say, this is to isolate metric names in order
to avoid name clashes across pods. You can see we set this in the default agent config
to:
metric_id_prefix: pod/${POD:uid}/custom/
See:
https://github.com/hawkular/hawkular-openshift-agent/blob/master/deploy/o...
So, for example, if the agent is running in a pod that has a UID of
"deadbeef123456" then the metric will be stored in H-Metrics as:
pod/deadbeef123456/custom/hawkular_openshift_agent_metric_data_points_collected_total
It's tenant will be that of the project (aka namespace) of where the agent is running
(which will be "openshift-infra" today).
How do we avoid clashes between 2 HOSA ?
By using this metric ID prefix. As I understand it, pod UIDs are unique across nodes so
the use of ${POD:uid} avoids clashes.