I've recently gone through configuring this plugin and there were a couple of times I needed to get out the debugger to work out why things were failing so I thought I'd raise an issue to maybe have these things smoothed out for future users.
Both boil down to a failure to execute a query not being surfaced well to the user. This is kind of two issues but one is very minor.
Feature Suggestion
Firstly, It looks like if you have a trailing forward slash '/' on the url in environment config then query execution fails with a 401 (e.g. the path is something like https://<id>.apps.dynatrace.com//platform/storage/query/v1/query:execute (note: //) however the waitForQueryResult function still tries to check the status of the query but request-token is undefined and this fails returning a 500 error.
The same error occurs if query execution fails for lack of permissions. For example, I tried to query logs fetch logs but I hadn't given the token view logs permission.
Possible Implementation
Return an error message to the user which includes or is based on the response code of the execute query API call so users can better respond.
Also, the url building should handle a trailing forward slash.
Summary
I've recently gone through configuring this plugin and there were a couple of times I needed to get out the debugger to work out why things were failing so I thought I'd raise an issue to maybe have these things smoothed out for future users.
Both boil down to a failure to execute a query not being surfaced well to the user. This is kind of two issues but one is very minor.
Feature Suggestion
Firstly, It looks like if you have a trailing forward slash '/' on the url in environment config then query execution fails with a 401 (e.g. the path is something like
https://<id>.apps.dynatrace.com//platform/storage/query/v1/query:execute
(note://
) however thewaitForQueryResult
function still tries to check the status of the query but request-token is undefined and this fails returning a 500 error.The same error occurs if query execution fails for lack of permissions. For example, I tried to query logs
fetch logs
but I hadn't given the token view logs permission.Possible Implementation
Return an error message to the user which includes or is based on the response code of the execute query API call so users can better respond.
Also, the url building should handle a trailing forward slash.
Context