Skip to content

Commit

Permalink
Restrict the self-reporting metrics (#826)
Browse files Browse the repository at this point in the history
* Restrict the self-reporting metrics to just the metric that we care about

The removes the node_exporter_build_info metric that doesn't make sense for this source

Signed-off-by: Pete Wall <pete.wall@grafana.com>

* Fix typo

Signed-off-by: Pete Wall <pete.wall@grafana.com>

* Bring back the local test script and fix an issue with the no-op on platform tests

Signed-off-by: Pete Wall <pete.wall@grafana.com>

* Bump prometheus timeout to 10m

Signed-off-by: Pete Wall <pete.wall@grafana.com>

---------

Signed-off-by: Pete Wall <pete.wall@grafana.com>
  • Loading branch information
petewall authored Oct 30, 2024
1 parent edf683a commit 3b5d9cf
Show file tree
Hide file tree
Showing 124 changed files with 1,376 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/platform-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
run: |
if [ "${{ github.event_name }}" == "pull_request" ] && [ "${{contains(github.event.pull_request.labels.*.name, 'run-platform-tests')}}" != "true" ]; then
echo "Skipping platform tests"
echo "tests=[]" >> "${GITHUB_OUTPUT}"
exit 0
fi
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,15 @@ jobs:
helm install alloy grafana/alloy -f "${GRAFANA_ALLOY_VALUES}" -n alloy --create-namespace --wait
# This prometheus instance is used pod annotation testing with https
helm install prometheus-workload prometheus-community/prometheus -f "${PROMETHEUS_WORKLOAD_VALUES}" -n prometheus --create-namespace --wait
helm install prometheus-workload prometheus-community/prometheus -f "${PROMETHEUS_WORKLOAD_VALUES}" -n prometheus --create-namespace --timeout 10m --wait
# Deploy the Prometheus Operator CRDs, since we want to deploy Loki with a ServiceMonitor later
helm install prom-crds prometheus-community/prometheus-operator-crds --wait
- name: Deploy Prometheus
if: (steps.list-changed.outputs.changed == 'true') || (contains(github.event.pull_request.labels.*.name, 'full_test_required'))
run: |
helm install prometheus prometheus-community/prometheus -f "${PROMETHEUS_VALUES}" -n prometheus --create-namespace --wait
helm install prometheus prometheus-community/prometheus -f "${PROMETHEUS_VALUES}" -n prometheus --create-namespace --timeout 10m --wait
- name: Deploy Loki
if: (steps.list-changed.outputs.changed == 'true') || (contains(github.event.pull_request.labels.*.name, 'full_test_required'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,15 @@ prometheus.scrape "kubernetes_monitoring_telemetry" {
clustering {
enabled = true
}
forward_to = [prometheus.relabel.kubernetes_monitoring_telemetry.receiver]
}

prometheus.relabel "kubernetes_monitoring_telemetry" {
rule {
source_labels = ["__name__"]
regex = "grafana_kubernetes_monitoring_build_info"
action = "keep"
}
forward_to = [prometheus.relabel.metrics_service.receiver]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,15 @@ data:
clustering {
enabled = true
}
forward_to = [prometheus.relabel.kubernetes_monitoring_telemetry.receiver]
}

prometheus.relabel "kubernetes_monitoring_telemetry" {
rule {
source_labels = ["__name__"]
regex = "grafana_kubernetes_monitoring_build_info"
action = "keep"
}
forward_to = [prometheus.relabel.metrics_service.receiver]
}

Expand Down Expand Up @@ -68075,6 +68084,15 @@ data:
clustering {
enabled = true
}
forward_to = [prometheus.relabel.kubernetes_monitoring_telemetry.receiver]
}

prometheus.relabel "kubernetes_monitoring_telemetry" {
rule {
source_labels = ["__name__"]
regex = "grafana_kubernetes_monitoring_build_info"
action = "keep"
}
forward_to = [prometheus.relabel.metrics_service.receiver]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,15 @@ prometheus.scrape "kubernetes_monitoring_telemetry" {
clustering {
enabled = true
}
forward_to = [prometheus.relabel.kubernetes_monitoring_telemetry.receiver]
}

prometheus.relabel "kubernetes_monitoring_telemetry" {
rule {
source_labels = ["__name__"]
regex = "grafana_kubernetes_monitoring_build_info"
action = "keep"
}
forward_to = [prometheus.relabel.metrics_service.receiver]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,15 @@ data:
clustering {
enabled = true
}
forward_to = [prometheus.relabel.kubernetes_monitoring_telemetry.receiver]
}

prometheus.relabel "kubernetes_monitoring_telemetry" {
rule {
source_labels = ["__name__"]
regex = "grafana_kubernetes_monitoring_build_info"
action = "keep"
}
forward_to = [prometheus.relabel.metrics_service.receiver]
}

Expand Down Expand Up @@ -69324,6 +69333,15 @@ data:
clustering {
enabled = true
}
forward_to = [prometheus.relabel.kubernetes_monitoring_telemetry.receiver]
}

prometheus.relabel "kubernetes_monitoring_telemetry" {
rule {
source_labels = ["__name__"]
regex = "grafana_kubernetes_monitoring_build_info"
action = "keep"
}
forward_to = [prometheus.relabel.metrics_service.receiver]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,15 @@ prometheus.scrape "kubernetes_monitoring_telemetry" {
clustering {
enabled = true
}
forward_to = [prometheus.relabel.kubernetes_monitoring_telemetry.receiver]
}

prometheus.relabel "kubernetes_monitoring_telemetry" {
rule {
source_labels = ["__name__"]
regex = "grafana_kubernetes_monitoring_build_info"
action = "keep"
}
forward_to = [prometheus.relabel.metrics_service.receiver]
}

Expand Down
18 changes: 18 additions & 0 deletions charts/k8s-monitoring-v1/docs/examples/azure-aks/output.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,15 @@ data:
clustering {
enabled = true
}
forward_to = [prometheus.relabel.kubernetes_monitoring_telemetry.receiver]
}

prometheus.relabel "kubernetes_monitoring_telemetry" {
rule {
source_labels = ["__name__"]
regex = "grafana_kubernetes_monitoring_build_info"
action = "keep"
}
forward_to = [prometheus.relabel.metrics_service.receiver]
}

Expand Down Expand Up @@ -68019,6 +68028,15 @@ data:
clustering {
enabled = true
}
forward_to = [prometheus.relabel.kubernetes_monitoring_telemetry.receiver]
}

prometheus.relabel "kubernetes_monitoring_telemetry" {
rule {
source_labels = ["__name__"]
regex = "grafana_kubernetes_monitoring_build_info"
action = "keep"
}
forward_to = [prometheus.relabel.metrics_service.receiver]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,15 @@ prometheus.scrape "kubernetes_monitoring_telemetry" {
clustering {
enabled = true
}
forward_to = [prometheus.relabel.kubernetes_monitoring_telemetry.receiver]
}

prometheus.relabel "kubernetes_monitoring_telemetry" {
rule {
source_labels = ["__name__"]
regex = "grafana_kubernetes_monitoring_build_info"
action = "keep"
}
forward_to = [prometheus.relabel.metrics_service.receiver]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,15 @@ data:
clustering {
enabled = true
}
forward_to = [prometheus.relabel.kubernetes_monitoring_telemetry.receiver]
}

prometheus.relabel "kubernetes_monitoring_telemetry" {
rule {
source_labels = ["__name__"]
regex = "grafana_kubernetes_monitoring_build_info"
action = "keep"
}
forward_to = [prometheus.relabel.metrics_service.receiver]
}

Expand Down Expand Up @@ -68007,6 +68016,15 @@ data:
clustering {
enabled = true
}
forward_to = [prometheus.relabel.kubernetes_monitoring_telemetry.receiver]
}

prometheus.relabel "kubernetes_monitoring_telemetry" {
rule {
source_labels = ["__name__"]
regex = "grafana_kubernetes_monitoring_build_info"
action = "keep"
}
forward_to = [prometheus.relabel.metrics_service.receiver]
}

Expand Down
9 changes: 9 additions & 0 deletions charts/k8s-monitoring-v1/docs/examples/beyla/metrics.alloy
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,15 @@ prometheus.scrape "kubernetes_monitoring_telemetry" {
clustering {
enabled = true
}
forward_to = [prometheus.relabel.kubernetes_monitoring_telemetry.receiver]
}

prometheus.relabel "kubernetes_monitoring_telemetry" {
rule {
source_labels = ["__name__"]
regex = "grafana_kubernetes_monitoring_build_info"
action = "keep"
}
forward_to = [prometheus.relabel.metrics_service.receiver]
}

Expand Down
18 changes: 18 additions & 0 deletions charts/k8s-monitoring-v1/docs/examples/beyla/output.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,15 @@ data:
clustering {
enabled = true
}
forward_to = [prometheus.relabel.kubernetes_monitoring_telemetry.receiver]
}

prometheus.relabel "kubernetes_monitoring_telemetry" {
rule {
source_labels = ["__name__"]
regex = "grafana_kubernetes_monitoring_build_info"
action = "keep"
}
forward_to = [prometheus.relabel.metrics_service.receiver]
}

Expand Down Expand Up @@ -68337,6 +68346,15 @@ data:
clustering {
enabled = true
}
forward_to = [prometheus.relabel.kubernetes_monitoring_telemetry.receiver]
}

prometheus.relabel "kubernetes_monitoring_telemetry" {
rule {
source_labels = ["__name__"]
regex = "grafana_kubernetes_monitoring_build_info"
action = "keep"
}
forward_to = [prometheus.relabel.metrics_service.receiver]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,15 @@ prometheus.scrape "kubernetes_monitoring_telemetry" {
clustering {
enabled = true
}
forward_to = [prometheus.relabel.kubernetes_monitoring_telemetry.receiver]
}

prometheus.relabel "kubernetes_monitoring_telemetry" {
rule {
source_labels = ["__name__"]
regex = "grafana_kubernetes_monitoring_build_info"
action = "keep"
}
forward_to = [prometheus.relabel.metrics_service.receiver]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,15 @@ data:
clustering {
enabled = true
}
forward_to = [prometheus.relabel.kubernetes_monitoring_telemetry.receiver]
}

prometheus.relabel "kubernetes_monitoring_telemetry" {
rule {
source_labels = ["__name__"]
regex = "grafana_kubernetes_monitoring_build_info"
action = "keep"
}
forward_to = [prometheus.relabel.metrics_service.receiver]
}

Expand Down Expand Up @@ -68168,6 +68177,15 @@ data:
clustering {
enabled = true
}
forward_to = [prometheus.relabel.kubernetes_monitoring_telemetry.receiver]
}

prometheus.relabel "kubernetes_monitoring_telemetry" {
rule {
source_labels = ["__name__"]
regex = "grafana_kubernetes_monitoring_build_info"
action = "keep"
}
forward_to = [prometheus.relabel.metrics_service.receiver]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,15 @@ prometheus.scrape "kubernetes_monitoring_telemetry" {
clustering {
enabled = true
}
forward_to = [prometheus.relabel.kubernetes_monitoring_telemetry.receiver]
}

prometheus.relabel "kubernetes_monitoring_telemetry" {
rule {
source_labels = ["__name__"]
regex = "grafana_kubernetes_monitoring_build_info"
action = "keep"
}
forward_to = [prometheus.relabel.metrics_service.receiver]
}

Expand Down
18 changes: 18 additions & 0 deletions charts/k8s-monitoring-v1/docs/examples/custom-config/output.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,15 @@ data:
clustering {
enabled = true
}
forward_to = [prometheus.relabel.kubernetes_monitoring_telemetry.receiver]
}

prometheus.relabel "kubernetes_monitoring_telemetry" {
rule {
source_labels = ["__name__"]
regex = "grafana_kubernetes_monitoring_build_info"
action = "keep"
}
forward_to = [prometheus.relabel.metrics_service.receiver]
}

Expand Down Expand Up @@ -69311,6 +69320,15 @@ data:
clustering {
enabled = true
}
forward_to = [prometheus.relabel.kubernetes_monitoring_telemetry.receiver]
}

prometheus.relabel "kubernetes_monitoring_telemetry" {
rule {
source_labels = ["__name__"]
regex = "grafana_kubernetes_monitoring_build_info"
action = "keep"
}
forward_to = [prometheus.relabel.metrics_service.receiver]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,15 @@ prometheus.scrape "kubernetes_monitoring_telemetry" {
clustering {
enabled = true
}
forward_to = [prometheus.relabel.kubernetes_monitoring_telemetry.receiver]
}

prometheus.relabel "kubernetes_monitoring_telemetry" {
rule {
source_labels = ["__name__"]
regex = "grafana_kubernetes_monitoring_build_info"
action = "keep"
}
forward_to = [prometheus.relabel.metrics_service.receiver]
}

Expand Down
Loading

0 comments on commit 3b5d9cf

Please sign in to comment.