-
Notifications
You must be signed in to change notification settings - Fork 8
Datasource not working when Grafana is configured with root_url #9
Copy link
Copy link
Open
Description
The datasource doesn't show any values if Grafana is configured to run on a different root_url.
The error log shows that the directory from the root_url setting is not passed to the request:
GET http://server/api/datasources/proxy/7/v1/tasks/8232611d-27f5-4716-9a83-28ae867ffdc1/watch 404 (Not Found)
While the correct URL would be:
http://server/grafana/api/datasources/proxy/7/v1/tasks/8232611d-27f5-4716-9a83-28ae867ffdc1/watch
The issue seems to be in this function: https://github.com/raintank/snap-app/blob/master/src/datasource/stream_handler.js#L31 (this.ds.url does not contain the configured subdirectory).
In Grafana core this is usually implemented by importing app/core/config and prepending config.appSubUrl to the URLs. I'm not sure if that's a working / acceptable solution also for a plugin.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels