openshift / origin-metrics

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: Querying the labels field for a single label.

ScottWe opened this issue · comments

Hello,

I am trying to aggregate the metrics for all pods created under a specific deployment configuration. I've tried running my request with tags=labels:.*deploymentconfig:mysql.*, which does aggregate the data. However, if there was another deployment config named mysql-1, I would aggregate both. I know such name prefixing will occur in my environment. If I try tags=labels:^(.*,)?deploymentconfig:mysql(.*,)?$, I produce the error

{"errorMsg":"Invalid tags: labels:^(.*,)?deploymentconfig:mysql(.*,)?$,descriptor_name:cpu/usage"}

Is a strict query for a single label supported in Hawkular?

what about something like this:

tags=labels(?=.\deploymentconfig:mysql\b).$

Unfortunately "-" is also a boundary character so \b doesn't help. The same issue arises with \W. Your suggestion led me to find \x2C though, which matches a comma as an ASCII value (0x2C). This seems to work.

I guess it fell off my radar, but I thought we agreed a while back that we would flatten the labels in Hawkular Metrics so that we can more easily use the tag query language. @mwringe do you recall the discussion?

In OpenShift origin, we should have support for more flattened metrics, but its not in any OpenShift release yet.

The old labels="foo=bar,A=B" will still exist, but we will now also have "labels.foo=bar" and "labels.A=B"

@ScottWe could you let me know what your final query string was? I seem to be stuck with this now

I am going to close this issue since it has not had any recent activity. Please feel free to reopen if your issue is unresolved.