Skip to content
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

confgenerator: allow relabelling project_id #40

Merged
merged 2 commits into from
Aug 9, 2024

Conversation

ridwanmsharif
Copy link
Collaborator

@ridwanmsharif ridwanmsharif commented Jul 23, 2024

Fixes b/339498134

This change does the following:

  • Removes validation that prevents the project_id being relabelled
  • Moves the project_id to the gcp.project.id resource attribute so the exporter can set it correctly in the monitored resource label
  • Adds a confgenerator test
  • Fix broken prometheus tests

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

This change does the following:
- Removes validation that prevents the project_id being relabelled
- Moves the project_id to the `gcp.project.id` resource attribute so the
  exporter can set it correctly in the monitored resource label
- Adds a confgenerator test
- Fix broken prometheus tests

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

Change-Id: I930e8c985c48491f6debb8181432b3b5c3646c05
Change-Id: Ide2fa4d33f5557be3eeadce3d78945a3bc28f9e7
@ridwanmsharif ridwanmsharif merged commit f330dd7 into main Aug 9, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants