diff --git a/client/nginx.go b/client/nginx.go index c47dfec85..510f25a29 100644 --- a/client/nginx.go +++ b/client/nginx.go @@ -93,3 +93,7 @@ func parseStubStats(r io.Reader) (*StubStats, error) { } return &s, nil } + +func (client *NginxClient) GetAPIEndpoint() string { + return client.apiEndpoint +} diff --git a/collector/nginx.go b/collector/nginx.go index e7cc1b1bc..79975e179 100644 --- a/collector/nginx.go +++ b/collector/nginx.go @@ -54,7 +54,7 @@ func (c *NginxCollector) Collect(ch chan<- prometheus.Metric) { if err != nil { c.upMetric.Set(nginxDown) ch <- c.upMetric - c.logger.Error("error getting stats", "error", err.Error()) + c.logger.Error("error getting stats", "uri", c.nginxClient.GetAPIEndpoint(), "error", err) return }