Dynatrace / backstage-plugin

Dynatrace Backstage Plugin
Apache License 2.0
21 stars 3 forks source link

Better feeback for misconfigured plugins #99

Closed iain-b closed 6 months ago

iain-b commented 6 months ago

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 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.

Context

Kirdock commented 6 months ago

The first mentioned bug should already be solved with https://github.com/Dynatrace/backstage-plugin/pull/71. A release with the change will follow soon

We will look into the URL issue :)