azure-monitor-datasource icon indicating copy to clipboard operation
azure-monitor-datasource copied to clipboard

ExpiredAuthenticationToken error, doesn't appear to renew token

Open x-cubed opened this issue 6 years ago • 1 comments

Plugin Version: 0.3.0 Grafana Version: 5.4.2

Steps to reproduce

  1. Set up Azure Monitor plugin and configure a dashboard to consume data from it.
  2. Everything works great.
  3. Leave the dashboard open in a browser tab, suspend your PC and go home for the night.
  4. Return to work, resume your PC and open the browser tab.
  5. Tab is showing old data, so hit the refresh button in the top right corner of the dashboard. All graphs show a red warning exclamation mark in the top left corner.
  6. Refresh the entire page with F5. Page loads fine (so Grafana session is still active), but warnings still show.
  7. Log out of Grafana and back in again. Warnings still show.
  8. Go into the Azure Monitor data source configuration and hit the Save and Test button. All the graphs start working again.

When the warnings appear, the browser console shows requests returning a 401 Unauthorized response: http://localhost:3000/api/datasources/proxy/1/azuremonitor/subscriptions/2033cfb3-5ad3-40ba-95e4-d496b086c3cf/resourceGroups/<omitted>/metrics?api-version=2018-01-01&timespan=2019-01-15T14:31:29Z/2019-01-15T20:31:29Z&interval=PT1M&aggregation=Average&metricnames=storage_limit

{
  "error": {
    "code": "ExpiredAuthenticationToken",
    "message": "The access token expiry UTC time '1/15/2019 1:35:15 AM' is earlier than current UTC time '1/15/2019 8:31:54 PM'."
  }
}

It's possibly a time zone issue, as I'm located in New Zealand (UTC +13).

x-cubed avatar Jan 15 '19 20:01 x-cubed

Sounds like a time zone issue - will have to investigate this further but I think this might be a bug in core Grafana rather than this plugin.

daniellee avatar Feb 05 '19 00:02 daniellee