Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: The Cloudera Community will undergo maintenance on Saturday, August 17 at 12:00am PDT. See more info here.

Create a timeseries query for impala backend connections

Create a timeseries query for impala backend connections

Explorer

I'm trying to create a curl against the timeseries data for Impala that would yield the number of backend Impala connections as the data from "now". Essentially one number, that I can act on via an API service restart.

 

The below query works perfectly, but gives me five data points over the last 5 minutes. The docs indicate you can use "from" and "to" to isolate the time frame and I'd like only have the value returned for "now".

 

curl -sSf -u user:passwd http://cmhost:7180/api/v10/timeseries?query=SELECT+total_thrift_server_backend_connections_in_use_across_impalads+WHERE+entityName+=+"impala"+AND+category+=+SERVICE

 

How would I craft this query to return the value for "now"?

 

 

1 REPLY 1
Highlighted

Re: Create a timeseries query for impala backend connections

Explorer

I think is not possible have only a value "now"... In the default 5 minutes you have also the value "now", the last value returned (you should make "grep" of this value)...


"rollupUsed" : "RAW"
      },
      "data" : [ {
        "timestamp" : "2018-02-07T13:33:07.497Z",
        "value" : 0.0,
        "type" : "SAMPLE"
      }, {
        "timestamp" : "2018-02-07T13:34:07.498Z",
        "value" : 0.0,
        "type" : "SAMPLE"
      }, {
        "timestamp" : "2018-02-07T13:35:07.498Z",
        "value" : 0.0,
        "type" : "SAMPLE"
      }, {
        "timestamp" : "2018-02-07T13:36:07.498Z",
        "value" : 0.0,
        "type" : "SAMPLE"
      }, {
        "timestamp" : "2018-02-07T13:37:07.498Z",
        "value" : 0.0,
        "type" : "SAMPLE"

 

P.s: This is an example output of the timeseries query made for one service into charts library section, but I think that the logic is always the same for all cluster's resources.... ;)

 

Let me know...

 

Regards!

 

Alex