-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
confgenerator: make instance an optional targetLabel
This change does the following: - Adds `instance` to the list of configurable targetLabels. It used to be non configurable but now it is, keeping it consistent with PodMonitoring - Rename the curated metrics to be more consistent with https://cloud.google.com/monitoring/api/resources#tag_cloud_run_revision This will make joins with those metrics easier. - Disallow using `instanceId` as a source label in relabelling rules. This is important because this label is added later in the pipeline. - Add unit tests. - Make self metrics add no additional labels other than the resource labels. Change-Id: I5acd7ef51ec5f33ce0e8532a2e1e54b91bfaa63d Signed-off-by: Ridwan Sharif <[email protected]>
- Loading branch information
1 parent
d3ef1ce
commit 65f8d7b
Showing
11 changed files
with
179 additions
and
90 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
1 change: 1 addition & 0 deletions
1
confgenerator/testdata/invalid-relabel-labels-invalid-source/golden/error
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
invalid definition for endpoint with index 0: cannot relabel with action "replace" using source label "instanceId" |
30 changes: 30 additions & 0 deletions
30
confgenerator/testdata/invalid-relabel-labels-invalid-source/input.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright 2023 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
apiVersion: monitoring.googleapis.com/v1beta | ||
kind: RunMonitoring | ||
metadata: | ||
name: mycollector | ||
labels: | ||
run-app: mycollector | ||
type: mytype | ||
spec: | ||
endpoints: | ||
- port: 8080 | ||
interval: 10s | ||
metricRelabeling: | ||
- action: replace | ||
sourceLabels: | ||
- instanceId | ||
targetLabel: target |
Oops, something went wrong.