diff --git a/lib/plugins/grafana/send-annotation.js b/lib/plugins/grafana/send-annotation.js index 17ce6f896..015e0ad19 100644 --- a/lib/plugins/grafana/send-annotation.js +++ b/lib/plugins/grafana/send-annotation.js @@ -77,6 +77,7 @@ module.exports = { }; // If Grafana is behind auth, use it! if (options.grafana.auth) { + log.debug('Using auth for Grafana'); postOptions.headers.Authorization = 'Bearer ' + options.grafana.auth; } log.verbose('Send annotation to Grafana: %j', postData); @@ -88,7 +89,13 @@ module.exports = { const e = new Error( `Got ${res.statusCode} from Grafana when sending annotation` ); - log.warn(e.message); + if (res.statusCode === 403) { + log.warn('Authentication required.', e.message) + } else if (res.statusCode === 401) { + log.warn('No valid authentication.', e.message) + } else { + log.warn(e.message); + } reject(e); } else { res.setEncoding('utf8');