-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(metrics): use namespaceSelector from configuration for additional…
…ServiceMonitors (cherry picked from commit e5a0e8a)
- Loading branch information
1 parent
2836c40
commit 2bc54db
Showing
6 changed files
with
468 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fix(metrics): use namespaceSelector from configuration for additionalServiceMonitors |
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
11 changes: 11 additions & 0 deletions
11
tests/helm/testdata/goldenfile/metrics_additional_service_monitors/basic.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,11 @@ | ||
sumologic: | ||
metrics: | ||
additionalServiceMonitors: | ||
- name: basic-service-monitor | ||
endpoints: | ||
- port: 8888 | ||
path: /metrics | ||
selector: | ||
matchLabels: | ||
label-key-a: label-value-a | ||
label-key-b: label-value-b |
218 changes: 218 additions & 0 deletions
218
tests/helm/testdata/goldenfile/metrics_additional_service_monitors/basic.output.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,218 @@ | ||
--- | ||
# Source: sumologic/templates/metrics/prometheus/servicemonitors.yaml | ||
apiVersion: v1 | ||
kind: List | ||
items: | ||
- apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: collection-sumologic-otelcol-logs | ||
namespace: sumologic | ||
labels: | ||
app: sumologic-prometheus | ||
|
||
app.kubernetes.io/managed-by: Helm | ||
app.kubernetes.io/instance: RELEASE-NAME | ||
app.kubernetes.io/version: "%CURRENT_CHART_VERSION%" | ||
app.kubernetes.io/part-of: sumologic | ||
chart: "sumologic-%CURRENT_CHART_VERSION%" | ||
release: "RELEASE-NAME" | ||
heritage: "Helm" | ||
sumologic.com/app: otelcol-logs | ||
spec: | ||
endpoints: | ||
- port: otelcol-metrics | ||
namespaceSelector: | ||
matchNames: | ||
- sumologic | ||
selector: | ||
matchLabels: | ||
sumologic.com/app: otelcol-logs | ||
sumologic.com/scrape: "true" | ||
- apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: collection-sumologic-otelcol-metrics | ||
namespace: sumologic | ||
labels: | ||
app: sumologic-prometheus | ||
|
||
app.kubernetes.io/managed-by: Helm | ||
app.kubernetes.io/instance: RELEASE-NAME | ||
app.kubernetes.io/version: "%CURRENT_CHART_VERSION%" | ||
app.kubernetes.io/part-of: sumologic | ||
chart: "sumologic-%CURRENT_CHART_VERSION%" | ||
release: "RELEASE-NAME" | ||
heritage: "Helm" | ||
sumologic.com/app: otelcol-metrics | ||
spec: | ||
endpoints: | ||
- port: otelcol-metrics | ||
namespaceSelector: | ||
matchNames: | ||
- sumologic | ||
selector: | ||
matchLabels: | ||
sumologic.com/app: otelcol-metrics | ||
sumologic.com/scrape: "true" | ||
- apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: collection-sumologic-metrics-collector | ||
namespace: sumologic | ||
labels: | ||
app: sumologic-prometheus | ||
|
||
app.kubernetes.io/managed-by: Helm | ||
app.kubernetes.io/instance: RELEASE-NAME | ||
app.kubernetes.io/version: "%CURRENT_CHART_VERSION%" | ||
app.kubernetes.io/part-of: sumologic | ||
chart: "sumologic-%CURRENT_CHART_VERSION%" | ||
release: "RELEASE-NAME" | ||
heritage: "Helm" | ||
sumologic.com/app: otelcol-metrics | ||
spec: | ||
endpoints: | ||
- port: monitoring | ||
namespaceSelector: | ||
matchNames: | ||
- sumologic | ||
selector: | ||
matchLabels: | ||
sumologic.com/app: otelcol | ||
sumologic.com/component: metrics | ||
sumologic.com/scrape: "true" | ||
- apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: collection-sumologic-otelcol-logs-collector | ||
namespace: sumologic | ||
labels: | ||
app: sumologic-prometheus | ||
|
||
app.kubernetes.io/managed-by: Helm | ||
app.kubernetes.io/instance: RELEASE-NAME | ||
app.kubernetes.io/version: "%CURRENT_CHART_VERSION%" | ||
app.kubernetes.io/part-of: sumologic | ||
chart: "sumologic-%CURRENT_CHART_VERSION%" | ||
release: "RELEASE-NAME" | ||
heritage: "Helm" | ||
sumologic.com/app: otelcol-logs-collector | ||
spec: | ||
endpoints: | ||
- port: metrics | ||
namespaceSelector: | ||
matchNames: | ||
- sumologic | ||
selector: | ||
matchLabels: | ||
sumologic.com/app: otelcol-logs-collector | ||
sumologic.com/scrape: "true" | ||
- apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: collection-sumologic-otelcol-events | ||
namespace: sumologic | ||
labels: | ||
app: sumologic-prometheus | ||
|
||
app.kubernetes.io/managed-by: Helm | ||
app.kubernetes.io/instance: RELEASE-NAME | ||
app.kubernetes.io/version: "%CURRENT_CHART_VERSION%" | ||
app.kubernetes.io/part-of: sumologic | ||
chart: "sumologic-%CURRENT_CHART_VERSION%" | ||
release: "RELEASE-NAME" | ||
heritage: "Helm" | ||
sumologic.com/app: otelcol-events | ||
spec: | ||
endpoints: | ||
- port: otelcol-metrics | ||
namespaceSelector: | ||
matchNames: | ||
- sumologic | ||
selector: | ||
matchLabels: | ||
sumologic.com/app: otelcol-events | ||
sumologic.com/scrape: "true" | ||
- apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: collection-sumologic-otelcol-traces | ||
namespace: sumologic | ||
labels: | ||
app: sumologic-prometheus | ||
|
||
app.kubernetes.io/managed-by: Helm | ||
app.kubernetes.io/instance: RELEASE-NAME | ||
app.kubernetes.io/version: "%CURRENT_CHART_VERSION%" | ||
app.kubernetes.io/part-of: sumologic | ||
chart: "sumologic-%CURRENT_CHART_VERSION%" | ||
release: "RELEASE-NAME" | ||
heritage: "Helm" | ||
sumologic.com/app: otelcol | ||
spec: | ||
endpoints: | ||
- port: metrics | ||
namespaceSelector: | ||
matchNames: | ||
- sumologic | ||
selector: | ||
matchLabels: | ||
sumologic.com/component: instrumentation | ||
sumologic.com/scrape: "true" | ||
- apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: collection-sumologic-prometheus | ||
namespace: sumologic | ||
labels: | ||
app: sumologic-prometheus | ||
|
||
app.kubernetes.io/managed-by: Helm | ||
app.kubernetes.io/instance: RELEASE-NAME | ||
app.kubernetes.io/version: "%CURRENT_CHART_VERSION%" | ||
app.kubernetes.io/part-of: sumologic | ||
chart: "sumologic-%CURRENT_CHART_VERSION%" | ||
release: "RELEASE-NAME" | ||
heritage: "Helm" | ||
spec: | ||
endpoints: | ||
- metricRelabelings: | ||
- action: keep | ||
regex: prometheus_remote_storage_.* | ||
sourceLabels: | ||
- __name__ | ||
path: /metrics | ||
port: http-web | ||
namespaceSelector: | ||
matchNames: | ||
- sumologic | ||
selector: | ||
matchLabels: | ||
app: kube-prometheus-stack-prometheus | ||
- apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: basic-service-monitor | ||
namespace: sumologic | ||
labels: | ||
app: sumologic-prometheus | ||
|
||
app.kubernetes.io/managed-by: Helm | ||
app.kubernetes.io/instance: RELEASE-NAME | ||
app.kubernetes.io/version: "%CURRENT_CHART_VERSION%" | ||
app.kubernetes.io/part-of: sumologic | ||
chart: "sumologic-%CURRENT_CHART_VERSION%" | ||
release: "RELEASE-NAME" | ||
heritage: "Helm" | ||
spec: | ||
endpoints: | ||
- path: /metrics | ||
port: 8888 | ||
namespaceSelector: | ||
matchNames: | ||
- sumologic | ||
selector: | ||
matchLabels: | ||
label-key-a: label-value-a | ||
label-key-b: label-value-b |
15 changes: 15 additions & 0 deletions
15
tests/helm/testdata/goldenfile/metrics_additional_service_monitors/custom.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,15 @@ | ||
sumologic: | ||
metrics: | ||
additionalServiceMonitors: | ||
- name: custom-service-monitor | ||
endpoints: | ||
- port: 8888 | ||
path: /metrics | ||
namespaceSelector: | ||
matchNames: | ||
- custom-namespace-a | ||
- custom-namespace-b | ||
selector: | ||
matchLabels: | ||
label-key-a: label-value-a | ||
label-key-b: label-value-b |
Oops, something went wrong.