[Hawkular-dev] Ability to group by datapoint tag in Grafana

John Sanda jsanda at redhat.com
Fri Jan 20 09:35:44 EST 2017


> On Jan 20, 2017, at 8:09 AM, Michael Burman <miburman at redhat.com> wrote:
> 
> Hi,
> 
> Your syntax is still incorrect. It's either metricId or tags, not both 
> (at least not in this case).
> 
> You should call /gauges/stats?tags=name:*&start=..
> 
> https://github.com/hawkular/hawkular-metrics/blob/master/api/metrics-api-jaxrs/src/main/java/org/hawkular/metrics/api/jaxrs/handler/GaugeHandler.java#L571 <https://github.com/hawkular/hawkular-metrics/blob/master/api/metrics-api-jaxrs/src/main/java/org/hawkular/metrics/api/jaxrs/handler/GaugeHandler.java#L571>
> 
> If you wish to use id/stats, then you can't have tags at all.

That’s not right. Look at https://github.com/hawkular/hawkular-metrics/blob/master/api/metrics-api-jaxrs/src/main/java/org/hawkular/metrics/api/jaxrs/handler/GaugeHandler.java#L628 <https://github.com/hawkular/hawkular-metrics/blob/master/api/metrics-api-jaxrs/src/main/java/org/hawkular/metrics/api/jaxrs/handler/GaugeHandler.java#L628>. Maybe I had a typo in my previous example. The endpoint is:

GET /hawkular/metrics/gauges/{id}/stats/tags/{tags}

and the endpoint supports the standard start/end parameters.

> 
> /gauges/$METRIC_ID/stats?start=..
> 
> https://github.com/hawkular/hawkular-metrics/blob/master/api/metrics-api-jaxrs/src/main/java/org/hawkular/metrics/api/jaxrs/handler/GaugeHandler.java#L509 <https://github.com/hawkular/hawkular-metrics/blob/master/api/metrics-api-jaxrs/src/main/java/org/hawkular/metrics/api/jaxrs/handler/GaugeHandler.java#L509>
> 
>   - Micke
> 
> On 01/20/2017 11:21 AM, Gareth Healy wrote:
>> Hi John S,
>> 
>> No, still dont get any data (204 error) back with that endpoint either.
>> 
>> I tweaked the endpoint, as you had /stats/tags/*type*/ - presume that 
>> was a typo, since it gives me a 404 and i can't see it mentioned in 
>> the docs so just removed it.
>> 
>>    HAWKULAR_TENANT="fis2-monitoring-demo"
>>    MERTIC_ID="pod%2Fded071be-d9a6-11e6-8140-525400c583ad%2Fcustom%2Fprometheus_MyCamel_MeanProcessingTime"
>> 
>>    curl -v -k -X GET \
>> 
>>        -H "Content-Type: application/json" \
>> 
>>        -H "Hawkular-Tenant: $HAWKULAR_TENANT" \
>> 
>>        -H "Authorization: Bearer $(oc sa get-token -n openshift-infra
>>        heapster)" \
>> 
>>        "$HAWKULAR_URL/gauges/$MERTIC_ID/stats/tags/name:*?start=1484320827578&end=1484329973940"
>> 
>> Tried with both tag keys (name and type) and with the value set and 
>> wild-carded.
>> 
>> The $HAWKULAR_URL/gauges/$MERTIC_ID/raw endpoint returns data points.
>> 
>> On Thu, Jan 19, 2017 at 9:45 PM, John Sanda <jsanda at redhat.com 
>> <mailto:jsanda at redhat.com <mailto:jsanda at redhat.com>>> wrote:
>> 
>>    You are using the wrong endpoint. It should be:
>> 
>>    $HAWKULAR_URL/gauges/{metric_id}/stats/tags/type/type:routes?start=1484320827578&end=1484329973940
>> 
>>    where {metric_id}
>>    is pod%2Fded071be-d9a6-11e6-8140-525400c583ad%2Fcustom%2Fprometheus_MyCamel_MeanProcessingTime
>> 
>>    And for this endpoint the bucketDuration parameter is not
>>    supported. The buckets are determined by the tag filters. The
>>    endpoint URL has changed from the initial implementation (and
>>    needs to be documented) but the examples in the ticket of how the
>>    buckets are determined are still valid.
>> 
>>>    On Jan 19, 2017, at 4:02 PM, Gareth Healy <garethahealy at gmail.com <mailto:garethahealy at gmail.com>
>>>    <mailto:garethahealy at gmail.com <mailto:garethahealy at gmail.com>>> wrote:
>>> 
>>>    @John S,
>>> 
>>>    No, i dont get back what i expect.
>>> 
>>>    Based on the below data (below is logs from HOSA):
>>> 
>>>        I0113 17:24:09.138095       1 metrics_storage.go:154] TRACE:
>>>        Stored [5] [gauge] datapoints for metric named
>>>        [pod/ded071be-d9a6-11e6-8140-525400c583ad/custom/prometheus_MyCamel_MeanProcessingTime]:
>>> 
>>> 
>>>        [{2017-01-13 17:24:09.117190753 +0000 UTC 18 map[type:routes
>>>        name:"route1"]}
>>>        {2017-01-13 17:24:09.117190753 +0000 UTC 0
>>>        map[type:processors name:"transform2"]}
>>>        {2017-01-13 17:24:09.117190753 +0000 UTC 17
>>>        map[type:processors name:"choice1"]}
>>>        {2017-01-13 17:24:09.117190753 +0000 UTC 8
>>>        map[type:processors name:"transform1"]}
>>>        {2017-01-13 17:24:09.117190753 +0000 UTC 18
>>>        map[name:"MyCamel" type:context]}]
>>> 
>>> 
>>>    With the below cURL:
>>> 
>>>        curl -k -X GET -H "Content-Type: application/json" -H
>>>        "Hawkular-Tenant: $HAWKULAR_TENANT" -H "Authorization: Bearer
>>>        $(oc sa get-token -n openshift-infra heapster)"
>>>        "$HAWKULAR_URL/gauges/stats?start=1484320827578&end=1484329973940&bucketDuration=10d&tags=type:routes"
>>> 
>>>    I get no data back. From a reply i got from Joel (in this
>>>    thread), its because the stats endpoint is working on metric
>>>    tags, but i am wanting to look at datapoint tags.
>>> 
>>>    On Thu, Jan 19, 2017 at 8:35 PM, John Mazzitelli
>>>    <jmazzite at redhat.com <mailto:jmazzite at redhat.com> <mailto:jmazzite at redhat.com <mailto:jmazzite at redhat.com>>> wrote:
>>> 
>>> 
>>>        On Thu, 2017-01-19 at 15:21 -0500, John Sanda wrote:
>>>> I think I already asked this before, but does the tag based
>>>        bucketing
>>>> introduced in
>>>        https://issues.jboss.org/browse/HWKMETRICS-373 <https://issues.jboss.org/browse/HWKMETRICS-373>
>>>        <https://issues.jboss.org/browse/HWKMETRICS-373 <https://issues.jboss.org/browse/HWKMETRICS-373>> help
>>>> here?
>>> 
>>>        I do not know... that would be a question for Gareth to answer.
>>>        _______________________________________________
>>>        hawkular-dev mailing list
>>>        hawkular-dev at lists.jboss.org <mailto:hawkular-dev at lists.jboss.org>
>>>        <mailto:hawkular-dev at lists.jboss.org <mailto:hawkular-dev at lists.jboss.org>>
>>>        https://lists.jboss.org/mailman/listinfo/hawkular-dev <https://lists.jboss.org/mailman/listinfo/hawkular-dev>
>>>        <https://lists.jboss.org/mailman/listinfo/hawkular-dev <https://lists.jboss.org/mailman/listinfo/hawkular-dev>>
>>> 
>>> 
>>>    _______________________________________________
>>>    hawkular-dev mailing list
>>>    hawkular-dev at lists.jboss.org <mailto:hawkular-dev at lists.jboss.org> <mailto:hawkular-dev at lists.jboss.org <mailto:hawkular-dev at lists.jboss.org>>
>>>    https://lists.jboss.org/mailman/listinfo/hawkular-dev <https://lists.jboss.org/mailman/listinfo/hawkular-dev>
>>>    <https://lists.jboss.org/mailman/listinfo/hawkular-dev <https://lists.jboss.org/mailman/listinfo/hawkular-dev>>
>> 
>> 
>>    _______________________________________________
>>    hawkular-dev mailing list
>>    hawkular-dev at lists.jboss.org <mailto:hawkular-dev at lists.jboss.org> <mailto:hawkular-dev at lists.jboss.org <mailto:hawkular-dev at lists.jboss.org>>
>>    https://lists.jboss.org/mailman/listinfo/hawkular-dev <https://lists.jboss.org/mailman/listinfo/hawkular-dev>
>>    <https://lists.jboss.org/mailman/listinfo/hawkular-dev>
>> 
>> 
>> 
>> 
>> _______________________________________________
>> hawkular-dev mailing list
>> hawkular-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/hawkular-dev
> 
> _______________________________________________
> hawkular-dev mailing list
> hawkular-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hawkular-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hawkular-dev/attachments/20170120/35b2b6e9/attachment-0001.html 


More information about the hawkular-dev mailing list