OpenTSDB / opentsdb

A scalable, distributed Time Series Database.
http://opentsdb.net
GNU Lesser General Public License v2.1
5k stars 1.25k forks source link

api/query/last is not working with metric name but works with tsuid #1705

Open rajsarkapally opened 5 years ago

rajsarkapally commented 5 years ago

TSDB version: 2.4.0RC2 built at revision e1937d3b

Due to performance reasons, we did not set tsd.core.meta.enable_tsuid_tracking or tsd.core.meta.enable_realtime_ts

The last datapoint API is working with tsuid as shown below /api/query/last?tsuids=XXXXX&back_scan=2400&resolve=true&use_meta=false

But the last datapoint API is returning empty result when used metric name and tags as below /api/query/last?timeseries=metric1{device=host1}&back_scan=2400&use_meta=false

  1. Do I need to change any configuration if querying last datapoint with metric name and tags when back_scan=24 and use_meta=false?
  2. when tsd.core.meta.enable_tsuid_tracking is enabled, it was mentioned that number of put calls will be doubled. If i am pushing 10 different metrics with one datapoint for each metric, will it cause just 2 put calls or 1+10 = 11 put calls?
deamerfire commented 4 years ago

Use the api/query/last don't set tsd.core.meta.enable_tsuid_tracking or tsd.core.meta.enable_realtime_ts . I can work when use the format below, { "queries": [ { "metric": "XBX" , "tags": { "cluster": "XlX", "table": "XXX" } } ], "resolveNames":true, "backScan":24 }

Hope it helps you