Closed jmazzitelli closed 7 years ago
I changed the description of this issue because I was wrong about the OS UI - it uses the metric description, not the name, for the graph labels.
We have to implement this. To replicate a problem, deploy the the Prometheus example and notice some graphs are empty. I think this is because the console is expecting the metric_name to be Prometheus timeseries name (that is: metric family appended with the Prometheus labels enclosed in curly braces). But the metric_name today is the metric family name only.
See the console code (introduced by this PR) and notice where it uses metric_name:
datasets: [
{
id: "custom/" + metric.name,
...
So the console expects the metric_name tag to be the full "metric-family{prometheus_labels}".
Therefore, we need to do this:
Rename the "metric_name" tag to "metric_family" and create another tag (this one called "metric_name") and its value should be the family{labels} value.
Ok, now that I am looking at this more closely, I think we already have what we need, no changes required to HOSA.
Here is what this issue originally proposed:
${METRIC:family_name} == the family name ${METRIC:name} == the family+ labels ("family{labels...}")
But we already have these but named differently. This is what we have today:
${METRIC:name} == the family name ${METRIC:id} == the family+ labels ("family{labels...}")
This just means the console is using the wrong tag. It was using "name" but it should be using "id".
In podMetrics.js this:
datasets: [
{
id: "custom/" + metric.name,
should be:
datasets: [
{
id: "custom/" + metric.id,
In other words, it should be looking up the metric ID, not the metric name.
I'm going to rebuild the console on my local box and see if I am right. If so, I'll submit a PR on the console and close this issue.
I submitted https://github.com/openshift/origin-web-console/pull/1344 to fix the console metric graphs.
I'm not going to change any code here in HOSA. If someone wants to propose we change the names of these tags, we can reopen this issue.
Today, "metric_name" tag for Prometheus metrics is set to the metric family name. But we don't have the metric ID (minus the metric prefix) as a tag. We might want that. So for Prometheus metrics like "what_i_ate{food=apple}", today there is a tag metric_name = "what_i_ate" but that is the metric family name. We might want to rename that metric_family_name and set metric_name to be "what_i_ate{food=apple}".
This can help users that want to query H-Metrics for this data based on metric family name or full metric name.