Skip to content

Commit d8ee459

Browse files
Updated OCP-Haproxy router with PromScrape V2 config (#139)
* Updated OCP-Haproxy router with PromScrape V2 config. * Fixed typo
1 parent 5667b22 commit d8ee459

File tree

3 files changed

+90
-17
lines changed

3 files changed

+90
-17
lines changed

resources/openshift-haproxy-router/INSTALL.v3.11.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,19 @@ kubectl -n default get deploymentConfig router -o json | jq -r '.spec.template.s
1313
>Note: to execute these commands ou will need the tool [jq](https://stedolan.github.io/jq/)
1414
1515
# Sysdig Agent configuration
16-
To set up the configuration of the Sysdig Agent to collect the metrics from the HAProxy router in OpenShift 3.11 you have to add the following configuration changing the `USER` and `PASSWORD` by the values extracted in the previous step:
16+
To set up the configuration of the Sysdig Agent to collect the metrics from the HAProxy router in OpenShift 3.11 you have to add in the job of the `prometheus.yaml`file the following configuration changing the `USER` and `PASSWORD` by the values extracted in the previous step:
1717
```yaml
18-
prometheus:
19-
process_filter:
20-
- include:
21-
port: 1936
22-
conf:
23-
username: "USER"
24-
password: "PASSWORD"
18+
scrape_configs:
19+
- job_name: 'haproxy-router'
20+
basic_auth:
21+
username: USER
22+
password: PASSWORD
23+
relabel_configs:
24+
- action: keep
25+
source_labels:
26+
- __meta_kubernetes_namespace
27+
- __meta_kubernetes_pod_name
28+
separator: '/'
29+
regex: 'default/router-1-.+'
2530
```
31+
You can check a configuration example below.

resources/openshift-haproxy-router/INSTALL.v4.3.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,19 @@ kubectl -n openshift-ingress get secret router-stats-default -o json | jq -r '.d
1313
>Note: to execute these commands ou will need the tool [jq](https://stedolan.github.io/jq/)
1414
1515
# Sysdig Agent configuration
16-
To set up the configuration of the Sysdig Agent to collect the metrics from the HAProxy router in OpenShift 4.3 you have to add the following configuration changing the `USER` and `PASSWORD` by the values extracted in the previous step:
16+
To set up the configuration of the Sysdig Agent to collect the metrics from the HAProxy router in OpenShift 4.3 you have to add in the job of the `prometheus.yaml`file the following configuration changing the `USER` and `PASSWORD` by the values extracted in the previous step:
1717
```yaml
18-
prometheus:
19-
process_filter:
20-
- include:
21-
port: 1936
22-
conf:
23-
username: "USER"
24-
password: "PASSWORD"
18+
scrape_configs:
19+
- job_name: 'haproxy-router'
20+
basic_auth:
21+
username: USER
22+
password: PASSWORD
23+
relabel_configs:
24+
- action: keep
25+
source_labels:
26+
- __meta_kubernetes_namespace
27+
- __meta_kubernetes_pod_name
28+
separator: '/'
29+
regex: 'default/router-1-.+'
2530
```
31+
You can check a configuration example below.
Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,62 @@
1-
#
1+
apiVersion: v1
2+
data:
3+
dragent.yaml: |
4+
new_k8s: true
5+
k8s_cluster_name: your-cluster-name
6+
metrics_excess_log: true
7+
10s_flush_enable: true
8+
app_checks_enabled: false
9+
use_promscrape: true
10+
new_k8s: true
11+
promscrape_fastproto: true
12+
prometheus:
13+
enabled: true
14+
prom_service_discovery: true
15+
log_errors: true
16+
max_metrics: 200000
17+
max_metrics_per_process: 200000
18+
max_tags_per_metric: 100
19+
ingest_raw: true
20+
ingest_calculated: false
21+
snaplen: 512
22+
tags: role:cluster
23+
prometheus.yaml: |
24+
global:
25+
scrape_interval: 10s
26+
scrape_configs:
27+
- job_name: 'haproxy-router'
28+
basic_auth:
29+
username: USER
30+
password: PASSWORD
31+
tls_config:
32+
insecure_skip_verify: true
33+
kubernetes_sd_configs:
34+
- role: pod
35+
relabel_configs:
36+
# Trying to ensure we only scrape local targets
37+
# We need the wildcard at the end because in AWS the node name is the FQDN,
38+
# whereas in Azure the node name is the base host name
39+
- action: keep
40+
source_labels: [__meta_kubernetes_pod_host_ip]
41+
regex: __HOSTIPS__
42+
- action: keep
43+
source_labels:
44+
- __meta_kubernetes_namespace
45+
- __meta_kubernetes_pod_name
46+
separator: '/'
47+
regex: 'default/router-1-.+'
48+
# Holding on to pod-id and container name so we can associate the metrics
49+
# with the container (and cluster hierarchy)
50+
- action: replace
51+
source_labels: [__meta_kubernetes_pod_uid]
52+
target_label: sysdig_k8s_pod_uid
53+
- action: replace
54+
source_labels: [__meta_kubernetes_pod_container_name]
55+
target_label: sysdig_k8s_pod_container_name
56+
57+
kind: ConfigMap
58+
metadata:
59+
labels:
60+
app: sysdig-agent
61+
name: sysdig-agent
62+
namespace: sysdig-agent

0 commit comments

Comments
 (0)