GoogleCloudPlatform / run-gmp-sidecar

Apache License 2.0
8 stars 7 forks source link

confgenerator: allow relabelling project_id #40

Closed ridwanmsharif closed 3 months ago

ridwanmsharif commented 4 months ago

Fixes b/339498134

This change does the following:

This is being tested by running the sidecar in one project and sending the metrics to another using a relabel rule.

Self metrics: screen/8wNBTeKuUfuAgyL

Service metrics (sent to a different project): screen/3FubQ698D2PX6Cs

Config used:

apiVersion: monitoring.googleapis.com/v1beta
kind: RunMonitoring
metadata:
  name: mycollector
spec:
  endpoints:
  - port: 8080
    interval: 10s
    metricRelabeling:
    - action: replace
      targetLabel: project_id
      replacement: ridwanmsharif-dev

Change-Id: I930e8c985c48491f6debb8181432b3b5c3646c05