Skip to content

Commit

Permalink
go.d sd docker use well-known port for app identification too (netdat…
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyam8 authored Mar 15, 2024
1 parent eeb46d4 commit 23bc67f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ var prometheusPortAllocations = map[int]string{
9150: "memcached_exporter",
9151: "varnish_request_exporter",
9152: "command_runner_exporter",
9153: "coredns",
9154: "postfix_exporter",
9155: "vsphere_graphite",
9156: "webdriver_exporter",
Expand Down
31 changes: 14 additions & 17 deletions src/go/collectors/go.d.plugin/config/go.d/sd/docker.conf
Original file line number Diff line number Diff line change
Expand Up @@ -31,39 +31,37 @@ classify:
- tags: "coredns"
expr: '{{ match "sp" .Image "*/coredns */coredns:*" }}'
- tags: "couchbase"
expr: '{{ match "sp" .Image "couchbase couchbase:*" }}'
expr: '{{ or (eq .PrivatePort "8091") (match "sp" .Image "couchbase couchbase:*") }}'
- tags: "couchdb"
expr: '{{ match "sp" .Image "couchdb couchdb:*" }}'
expr: '{{ or (eq .PrivatePort "5984") (match "sp" .Image "couchdb couchdb:*") }}'
- tags: "elasticsearch"
expr: '{{ match "sp" .Image "elasticsearch elasticsearch:* */elasticsearch */elasticsearch:*" }}'
- tags: "opensearch"
expr: '{{ match "sp" .Image "*/opensearch */opensearch:*" }}'
expr: '{{ or (eq .PrivatePort "9200") (match "sp" .Image "elasticsearch elasticsearch:* */elasticsearch */elasticsearch:* */opensearch */opensearch:*") }}'
- tags: "lighttpd"
expr: '{{ match "sp" .Image "*/lighttpd */lighttpd:*" }}'
- tags: "mongodb"
expr: '{{ match "sp" .Image "mongo mongo:* */mongodb */mongodb:* */mongodb-community-server */mongodb-community-server:*" }}'
expr: '{{ or (eq .PrivatePort "27017") (match "sp" .Image "mongo mongo:* */mongodb */mongodb:* */mongodb-community-server */mongodb-community-server:*") }}'
- tags: "mysql"
expr: '{{ match "sp" .Image "mysql mysql:* */mysql */mysql:* mariadb mariadb:* */mariadb */mariadb:* percona percona:* */percona-mysql */percona-mysql:*" }}'
expr: '{{ or (eq .PrivatePort "3306") (match "sp" .Image "mysql mysql:* */mysql */mysql:* mariadb mariadb:* */mariadb */mariadb:* percona percona:* */percona-mysql */percona-mysql:*") }}'
- tags: "nginx"
expr: '{{ match "sp" .Image "nginx nginx:*" }}'
- tags: "pgbouncer"
expr: '{{ match "sp" .Image "*/pgbouncer */pgbouncer:*" }}'
expr: '{{ or (eq .PrivatePort "6432") (match "sp" .Image "*/pgbouncer */pgbouncer:*") }}'
- tags: "pika"
expr: '{{ match "sp" .Image "pikadb/pika pikadb/pika:*" }}'
- tags: "postgres"
expr: '{{ match "sp" .Image "postgres postgres:* */postgres */postgres:* */postgresql */postgresql:*" }}'
expr: '{{ or (eq .PrivatePort "5432") (match "sp" .Image "postgres postgres:* */postgres */postgres:* */postgresql */postgresql:*") }}'
- tags: "proxysql"
expr: '{{ match "sp" .Image "*/proxysql */proxysql:*" }}'
expr: '{{ or (eq .PrivatePort "6032") (match "sp" .Image "*/proxysql */proxysql:*") }}'
- tags: "rabbitmq"
expr: '{{ match "sp" .Image "rabbitmq rabbitmq:* */rabbitmq */rabbitmq:*" }}'
expr: '{{ or (eq .PrivatePort "15672") (match "sp" .Image "rabbitmq rabbitmq:* */rabbitmq */rabbitmq:*") }}'
- tags: "redis"
expr: '{{ match "sp" .Image "redis redis:* */redis */redis:*" }}'
expr: '{{ or (eq .PrivatePort "6379") (match "sp" .Image "redis redis:* */redis */redis:*") }}'
- tags: "tengine"
expr: '{{ match "sp" .Image "*/tengine */tengine:*" }}'
- tags: "vernemq"
expr: '{{ match "sp" .Image "*/vernemq */vernemq:*" }}'
- tags: "zookeeper"
expr: '{{ match "sp" .Image "*/zookeeper */zookeeper:*" }}'
expr: '{{ or (eq .PrivatePort "2181") (match "sp" .Image "*/zookeeper */zookeeper:*") }}'
compose:
- name: "Applications"
selector: "app"
Expand Down Expand Up @@ -107,15 +105,14 @@ compose:
template: |
module: elasticsearch
name: docker_{{.Name}}
{{ if glob .Image "*elastic*" -}}
url: http://{{.Address}}
- selector: "opensearch"
template: |
module: elasticsearch
name: docker_{{.Name}}
{{ else -}}
url: https://{{.Address}}
tls_skip_verify: yes
username: admin
password: admin
{{ end -}}
- selector: "lighttpd"
template: |
module: lighttpd
Expand Down

0 comments on commit 23bc67f

Please sign in to comment.