Skip to content

Commit 1fa87f2

Browse files
committed
Drop the default scrape metrics
1 parent 954371a commit 1fa87f2

4 files changed

Lines changed: 9 additions & 8 deletions

File tree

metrics-collector/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app main.go
88

99
# Stage 2: Download and extract Prometheus
1010
FROM busybox:1.36-glibc AS prometheus-downloader
11-
ARG PROMETHEUS_VERSION=3.9.1
11+
ARG PROMETHEUS_VERSION=3.10.0
1212
ARG TARGETARCH=amd64
1313

1414
WORKDIR /tmp

metrics-collector/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ ibmcloud ce job create \
6161
--mode daemon \
6262
--cpu 0.25 \
6363
--memory 0.5G \
64+
--service-account reader \
6465
--build-size xlarge \
6566
--env INTERVAL=30 \
6667
--env METRICS_ENABLED=true \

metrics-collector/prometheus.yml.template

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ scrape_configs:
1414
regex: (.+)
1515
replacement: '${CE_PROJECT_NAME}'
1616
target_label: ibm_codeengine_project_name
17-
metric_relabel_configs:
18-
# Droping scrape metrics (e.g. scrape_duration_seconds)
19-
- source_labels: [__name__]
20-
regex: 'scrape_duration_seconds|scrape_samples_scraped|scrape_series_added|scrape_samples_post_metric_relabeling'
21-
action: drop
2217

2318
- job_name: 'codeengine-metrics-user'
2419
fallback_scrape_protocol: PrometheusText0.0.4
@@ -99,4 +94,9 @@ scrape_configs:
9994
remote_write:
10095
- url: https://${METRICS_REMOTE_WRITE_FQDN}/prometheus/remote/write
10196
authorization:
102-
credentials_file: "/etc/secrets/monitoring-apikey"
97+
credentials_file: "/etc/secrets/monitoring-apikey"
98+
write_relabel_configs:
99+
# Dropping scrape metrics (e.g. scrape_duration_seconds)
100+
- source_labels: [__name__]
101+
regex: 'scrape_duration_seconds|scrape_samples_scraped|scrape_series_added|scrape_samples_post_metric_relabeling'
102+
action: drop

metrics-collector/setup/ibm-cloud-monitoring/code-engine-component-resource-overview.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"links": null,
2323
"advancedQueries": [
2424
{
25-
"query": "(sum by (ibm_codeengine_component_name) (ibm_codeengine_instance_cpu_usage_millicores{$__scope}) / sum by (ibm_codeengine_component_name) (ibm_codeengine_instance_cpu_limit_millicores)) * 100",
25+
"query": "(sum by (ibm_codeengine_component_name) (ibm_codeengine_instance_cpu_usage_millicores{$__scope}) / sum by (ibm_codeengine_component_name) (ibm_codeengine_instance_cpu_limit_millicores{$__scope})) * 100",
2626
"enabled": true,
2727
"displayInfo": {
2828
"displayName": "CPU %",

0 commit comments

Comments
 (0)