Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query Metric Tags does not respect relative time ranges #670

Open
sspieker opened this issue Aug 25, 2022 · 0 comments
Open

Query Metric Tags does not respect relative time ranges #670

sspieker opened this issue Aug 25, 2022 · 0 comments

Comments

@sspieker
Copy link
Contributor

The API for querying metric tags describes the possibiliby to use relative time ranges ("start_relative" and "end_relative").

In our tests, these query properties are not being used. The response of those queries always contains every value available.
We're using KairosDB v1.3.0.

quick demo

Posting 2 datapoints, both have tags "m" and "h" with different values:

  • first at Thu Aug 25 2022 05:00:00 GMT+0000
  • second at Thu Aug 25 2022 06:00:00 GMT+0000
[
  {
      "name": "queryMetricTags.bug",
      "datapoints": [
          [1661403600000, 1]
      ],
      "tags": {
          "m": "true",
          "h": "h1"
      }
  },
  {
      "name": "queryMetricTags.bug",
      "datapoints": [
          [1661407200000, 2]
      ],
      "tags": {
          "m": "false",
          "h": "h2"
      }
  }
]

Querying the tag values, filtering for tag "m"=false, and setting are relative time range of 1m (both datapoints are a couple of hours old at the time of writing/querying):

{
   "start_relative": {
       "value": "1",
       "unit": "minutes"
   },
   "metrics": [
       {
           "tags": {
               "m": ["true"]
           },
           "name": "queryMetricTags.bug"
       }
   ]
}

The result contains the combination of the second datapoint, which is wrong -> should be an empty result.

{
  "queries": [
    {
      "results": [
        {
          "name": "queryMetricTags.bug",
          "tags": {
            "h": [
              "h2"
            ],
            "m": [
              "false"
            ]
          },
          "values": []
        }
      ]
    }
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant