-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add project IDs to error logs #362
Add project IDs to error logs #362
Conversation
a081613
to
2f9dd2e
Compare
collectors/monitoring_collector.go
Outdated
@@ -416,7 +416,7 @@ func (c *MonitoringCollector) reportTimeSeriesMetrics( | |||
c.aggregateDeltas, | |||
) | |||
if err != nil { | |||
return fmt.Errorf("error creating the TimeSeriesMetrics %v", err) | |||
return fmt.Errorf("error creating the TimeSeriesMetrics for project %s %v", c.projectID, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will duplicate the data since we add it in the error logger above.
This needs a DCO sign-off. You can use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this!
A small optional enhancement I can see would be to add a logger = log.With(logger, "project_id", c.projectID)
in the constructor https://github.com/prometheus-community/stackdriver_exporter/blob/master/collectors/monitoring_collector.go#L123-L126 that way every log in the collector has the project_id attached.
When exporting metrics from multiple projects at once, it's useful to know which of the projects is generating metrics errors. Signed-off-by: Tyler Lubeck <[email protected]>
ae88052
to
0e29008
Compare
Updated both - sorry for the delay y'all, I appear to have broken my GitHub notifications |
Nice |
When exporting metrics from multiple projects at once, it's useful to know which of the projects is generating metrics errors.
Heya @SuperQ , tagging you per the contributors guide. Mind taking a look when you get a minute?