Add project IDs to error logs#362
Merged
SuperQ merged 1 commit intoprometheus-community:masterfrom Sep 5, 2024
Merged
Conversation
a081613 to
2f9dd2e
Compare
SuperQ
reviewed
Aug 27, 2024
collectors/monitoring_collector.go
Outdated
| ) | ||
| 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) |
Contributor
There was a problem hiding this comment.
I think this will duplicate the data since we add it in the error logger above.
SuperQ
approved these changes
Aug 29, 2024
Contributor
|
This needs a DCO sign-off. You can use |
kgeckhart
approved these changes
Aug 30, 2024
Contributor
There was a problem hiding this comment.
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 <tyler@tylerlubeck.com>
ae88052 to
0e29008
Compare
Contributor
Author
|
Updated both - sorry for the delay y'all, I appear to have broken my GitHub notifications |
Contributor
|
Nice |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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?