Skip to content

Commit

Permalink
Merge pull request #478 from yadneshk/node_exporter_scrape
Browse files Browse the repository at this point in the history
Add "node-exporter" to Node Exporter's job name in scrape config
  • Loading branch information
openshift-merge-bot[bot] authored Oct 1, 2024
2 parents 0b65ef4 + 9a1b919 commit 85d3b6f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions controllers/metricstorage_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,14 +599,15 @@ func (r *MetricStorageReconciler) createScrapeConfigs(
}

// ScrapeConfig for non-tls nodes
neServiceName := fmt.Sprintf("%s-node-exporter", telemetry.ServiceName)
err = r.createServiceScrapeConfig(ctx, instance, Log, "Node Exporter",
telemetry.ServiceName, endpointsNonTLS, false)
neServiceName, endpointsNonTLS, false)
if err != nil {
return ctrl.Result{}, err
}

// ScrapeConfig for tls nodes
neServiceName := fmt.Sprintf("%s-tls", telemetry.ServiceName)
neServiceName = fmt.Sprintf("%s-node-exporter-tls", telemetry.ServiceName)
err = r.createServiceScrapeConfig(ctx, instance, Log, "Node Exporter",
neServiceName, endpointsTLS, true)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion tests/kuttl/suites/metricstorage/tests/01-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ kind: ScrapeConfig
metadata:
labels:
service: metricStorage
name: telemetry
name: telemetry-node-exporter
ownerReferences:
- kind: MetricStorage
name: telemetry-kuttl
Expand Down
2 changes: 1 addition & 1 deletion tests/kuttl/suites/metricstorage/tests/04-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ kind: ScrapeConfig
metadata:
labels:
service: metricStorage
name: telemetry
name: telemetry-node-exporter
ownerReferences:
- kind: MetricStorage
name: telemetry-kuttl
Expand Down
4 changes: 2 additions & 2 deletions tests/kuttl/suites/tls/tests/02-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ kind: ScrapeConfig
metadata:
labels:
service: metricStorage
name: telemetry-tls
name: telemetry-node-exporter-tls
ownerReferences:
- kind: MetricStorage
name: telemetry-kuttl-metricstorage
Expand All @@ -311,7 +311,7 @@ kind: ScrapeConfig
metadata:
labels:
service: metricStorage
name: telemetry
name: telemetry-node-exporter
ownerReferences:
- kind: MetricStorage
name: telemetry-kuttl-metricstorage
Expand Down

0 comments on commit 85d3b6f

Please sign in to comment.