Logging / troubleshooting

Hello! I’m trying to troubleshoot a new datasource plugin that I’m writing. I’m running Grafana locally in Docker, my plugin is installed, config UI is working, but when I click “Save & test” I get the error “Connection failed.”

Nothing interesting shows up in the logs. I’ve tried using logInfo and logWarning from @grafana/runtime in my testDatasource() but that doesn’t do anything, nothing gets logged.

Is there a way for me to add logging from my plugin, or somehow troubleshoot this? Thanks in advance!

You can use the browser network tab to inspect the request headers and the response headers and response payload.

“Connection failed” usually means that grafana could not reach the server. The error code can give you a better insight on what happened.