go.d: local-listeners sd: trust known ports to identify an app (#17205)
Ilya Mashchenko committed
Mar 20, 2024 at 12:45 UTC
eb1b5478c200a402ebb6b395ab523045ac087187
1 file changed
+16
-23
src/go/collectors/go.d.plugin/config/go.d/sd/net_listeners.conf
+16
-23
@@ -29,9 +29,9 @@ classify:
29
- tags: "coredns"
30
expr: '{{ and (eq .Port "9153") (eq .Comm "coredns") }}'
31
- tags: "couchbase"
32
- expr: '{{ and (eq .Port "8091") (glob .Cmdline "*couchbase*") }}'
32
+ expr: '{{ or (eq .Port "8091") (glob .Cmdline "*couchbase*") }}'
33
- tags: "couchdb"
34
- expr: '{{ and (eq .Port "5984") (glob .Cmdline "*couchdb*") }}'
34
+ expr: '{{ or (eq .Port "5984") (glob .Cmdline "*couchdb*") }}'
35
- tags: "dnsdist"
36
expr: '{{ and (eq .Port "8083") (eq .Comm "dnsdist") }}'
37
- tags: "dnsmasq"
@@ -39,9 +39,7 @@ classify:
39
- tags: "docker_engine"
40
expr: '{{ and (eq .Port "9323") (eq .Comm "dockerd") }}'
41
- tags: "elasticsearch"
42
- expr: '{{ and (eq .Port "9200") (glob .Cmdline "*elasticsearch*") }}'
43
- - tags: "opensearch"
44
- expr: '{{ and (eq .Port "9200") (glob .Cmdline "*opensearch*") }}'
42
+ expr: '{{ or (eq .Port "9200") (glob .Cmdline "*elasticsearch*" "*opensearch*") }}'
43
- tags: "envoy"
44
expr: '{{ and (eq .Port "9901") (eq .Comm "envoy") }}'
45
- tags: "fluentd"
@@ -65,33 +63,33 @@ classify:
63
- tags: "logstash"
64
expr: '{{ and (eq .Port "9600") (glob .Cmdline "*logstash*") }}'
65
- tags: "mongodb"
68
- expr: '{{ and (eq .Port "27017") (eq .Comm "mongod") }}'
66
+ expr: '{{ or (eq .Port "27017") (eq .Comm "mongod") }}'
67
- tags: "mysql"
70
- expr: '{{ and (eq .Port "3306") (eq .Comm "mysqld" "mariadb") }}'
68
+ expr: '{{ or (eq .Port "3306") (eq .Comm "mysqld" "mariadb") }}'
69
- tags: "nginx"
70
expr: '{{ and (eq .Port "80" "8080") (eq .Comm "nginx" "nginx:") }}'
71
- tags: "ntpd"
74
- expr: '{{ and (eq .Port "123") (eq .Comm "ntpd") }}'
72
+ expr: '{{ or (eq .Port "123") (eq .Comm "ntpd") }}'
73
- tags: "openvpn"
74
expr: '{{ and (eq .Port "7505") (eq .Comm "openvpn") }}'
75
- tags: "pgbouncer"
78
- expr: '{{ and (eq .Port "6432") (eq .Comm "pgbouncer") }}'
76
+ expr: '{{ or (eq .Port "6432") (eq .Comm "pgbouncer") }}'
77
- tags: "pihole"
78
expr: '{{ and (eq .Port "53") (eq .Comm "pihole-FTL") }}'
79
- tags: "pika"
80
expr: '{{ and (eq .Port "9221") (eq .Comm "pika") }}'
81
- tags: "postgres"
84
- expr: '{{ and (eq .Port "5432") (eq .Comm "postgres") }}'
82
+ expr: '{{ or (eq .Port "5432") (eq .Comm "postgres") }}'
83
- tags: "powerdns"
84
expr: '{{ and (eq .Port "8081") (eq .Comm "pdns_server") }}'
85
- tags: "powerdns_recursor"
86
expr: '{{ and (eq .Port "8081") (eq .Comm "pdns_recursor") }}'
87
- tags: "proxysql"
90
- expr: '{{ and (eq .Port "6032") (eq .Comm "proxysql") }}'
88
+ expr: '{{ or (eq .Port "6032") (eq .Comm "proxysql") }}'
89
- tags: "rabbitmq"
92
- expr: '{{ and (eq .Port "15672") (glob .Cmdline "*rabbitmq*") }}'
90
+ expr: '{{ or (eq .Port "15672") (glob .Cmdline "*rabbitmq*") }}'
91
- tags: "redis"
94
- expr: '{{ and (eq .Port "6379") (eq .Comm "redis-server") }}'
92
+ expr: '{{ or (eq .Port "6379") (eq .Comm "redis-server") }}'
93
- tags: "supervisord"
94
expr: '{{ and (eq .Port "9001") (eq .Comm "supervisord") }}'
95
- tags: "traefik"
@@ -99,13 +97,11 @@ classify:
97
- tags: "unbound"
98
expr: '{{ and (eq .Port "8953") (eq .Comm "unbound") }}'
99
- tags: "upsd"
102
- expr: '{{ and (eq .Port "3493") (eq .Comm "upsd") }}'
100
+ expr: '{{ or (eq .Port "3493") (eq .Comm "upsd") }}'
101
- tags: "vernemq"
102
expr: '{{ and (eq .Port "8888") (glob .Cmdline "*vernemq*") }}'
103
- tags: "zookeeper"
106
- expr: '{{ and (eq .Port "2181" "2182") (glob .Cmdline "*zookeeper*") }}'
107
- - tags: "zookeeper"
108
- expr: '{{ and (eq .Port "2181" "2182") (glob .Cmdline "*zookeeper*") }}'
104
+ expr: '{{ or (eq .Port "2181" "2182") (glob .Cmdline "*zookeeper*") }}'
105
- name: "Prometheus exporters"
106
selector: "unknown"
107
tags: "-unknown exporter"
@@ -190,17 +186,14 @@ compose:
186
template: |
187
module: elasticsearch
188
name: local
189
+ {{ if glob .Cmdline "*elastic*" -}}
190
url: http://{{.Address}}
194
- cluster_mode: no
195
- - selector: "opensearch"
196
- template: |
197
- module: elasticsearch
198
- name: local
191
+ {{ else -}}
192
url: https://{{.Address}}
200
- cluster_mode: no
193
tls_skip_verify: yes
194
username: admin
195
password: admin
196
+ {{ end -}}
197
- selector: "envoy"
198
template: |
199
module: envoy