Skip to content

Commit

Permalink
Add project ID to all logs from the collector
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
TylerLubeck committed Sep 4, 2024
1 parent 8ae3d33 commit 0e29008
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions collectors/monitoring_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ type DeltaHistogramStore interface {
func NewMonitoringCollector(projectID string, monitoringService *monitoring.Service, opts MonitoringCollectorOptions, logger log.Logger, counterStore DeltaCounterStore, histogramStore DeltaHistogramStore) (*MonitoringCollector, error) {
const subsystem = "monitoring"

logger = log.With(logger, "project_id", projectID)

apiCallsTotalMetric := prometheus.NewCounter(
prometheus.CounterOpts{
Namespace: namespace,
Expand Down

0 comments on commit 0e29008

Please sign in to comment.