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

Adjust DQL provider to include range #1918

Closed
2 tasks
RealAnna opened this issue Aug 22, 2023 · 2 comments · Fixed by #1919
Closed
2 tasks

Adjust DQL provider to include range #1918

RealAnna opened this issue Aug 22, 2023 · 2 comments · Fixed by #1919
Assignees
Labels
enhancement New feature or request metrics-operator

Comments

@RealAnna
Copy link
Contributor

RealAnna commented Aug 22, 2023

The current implementation of DQL provider misses the range options, we should fix that.

DoD

  • update the api call to v1 1.0.0 the new endpoint is /platform/storage/query/v1/query:execute
  • exploit the new DQL format to set defaultTimeframeStart and defaultTimeframeEnd based on range (see example below)

Useful links

https://www.dynatrace.com/support/help/platform/grail/dynatrace-query-language/dql-reference

@rakshitgondwal
Copy link
Member

I'm working on this.

@bacherfl
Copy link
Member

What also needs to be adapted is the following:

  1. Move the query and the defaultTimeframeStart/End into the request body of the post request, e.g.:
{
  "query": "fetch events \n| filter event.type == \"davis\" AND davis.status != \"CLOSED\" \n| fields timestamp, davis.title, davis.underMaintenance, davis.status \n| sort timestamp \n| limit 10",
  "defaultTimeframeStart": "2022-04-20T12:10:04.123Z",
  "defaultTimeframeEnd": "2022-04-20T13:10:04.123Z",
  "timezone": "UTC",
  "locale": "en_US",
  "fetchTimeoutSeconds": 60,
  "requestTimeoutMilliseconds": 1000,
}
  1. The response of that request can already contain the result of the query, if it did not exceed a certain amount of time - so if we get an HTTP 200 code for the query:execute request, we can cast the response to a DynatraceDQLResult, and when we get a HTTP 202 response, we can follow the previous approach of calling the query:poll endpoint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request metrics-operator
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants