From 8f061cf26c38b1aa04e67d480f215575d9771e2d Mon Sep 17 00:00:00 2001 From: Jan Fuhrer Date: Tue, 25 Jun 2024 19:58:57 +0200 Subject: [PATCH] feat: change default port to 10019 --- .dockerignore | 6 ------ README.md | 4 ++-- docker-compose-secrets.yaml | 2 +- docker-compose.yaml | 2 +- main.go | 2 +- prometheus/static-config/multiple-exporter.yaml | 4 ++-- prometheus/static-config/multiple-targets.yaml | 4 ++-- prometheus/static-config/single-target.yaml | 6 +++--- 8 files changed, 12 insertions(+), 18 deletions(-) delete mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index b306da5..0000000 --- a/.dockerignore +++ /dev/null @@ -1,6 +0,0 @@ -assets/ -README.md -SECURITY.md -CODE_OF_CONDUCT.md -CODEOWNERS -LICENSE diff --git a/README.md b/README.md index d41c9d7..6fb267a 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ You can use the following flags to configure the exporter. All flags can also be | `pbs.timeout` | `PBS_TIMEOUT` | Timeout for requests to Proxmox Backup Server | `5s` | | `pbs.insecure` | `PBS_INSECURE` | Disable TLS certificate verification | `false` | | `pbs.metrics-path` | `PBS_METRICS_PATH` | Path under which to expose metrics | `/metrics` | -| `pbs.web.listen-address` | `PBS_LISTEN_ADDRESS` | Address to listen on for web interface and telemetry | `:9101` | +| `pbs.web.listen-address` | `PBS_LISTEN_ADDRESS` | Address to listen on for web interface and telemetry | `:10019` | ### Docker secrets @@ -78,7 +78,7 @@ The variables `PBS_API_TOKEN`, `PBS_API_TOKEN_NAME`, and `PBS_USERNAME` take pre ## Multiple Proxmox Backup Servers -If you want to monitor multiple Proxmox Backup Servers, you can use the `targets` parameter in the query string. Instead of setting the `pbs.endpoint` flag (or `PBS_ENDPOINT` env), you can use the `target` parameter in the query string to specify the Proxmox Backup Server to monitor. You would then use following URL to scrape metrics: `http://localhost:9101/metrics?target=http://10.10.10.10:8007`. +If you want to monitor multiple Proxmox Backup Servers, you can use the `targets` parameter in the query string. Instead of setting the `pbs.endpoint` flag (or `PBS_ENDPOINT` env), you can use the `target` parameter in the query string to specify the Proxmox Backup Server to monitor. You would then use following URL to scrape metrics: `http://localhost:10019/metrics?target=http://10.10.10.10:8007`. This is useful if you are using Prometheus and want to monitor multiple Proxmox Backup Servers with one "pbs-exporter" instance. You find examples for Prometheus static configuration in the [prometheus/static-config](prometheus/static-config) directory. diff --git a/docker-compose-secrets.yaml b/docker-compose-secrets.yaml index ac58aaf..d162133 100644 --- a/docker-compose-secrets.yaml +++ b/docker-compose-secrets.yaml @@ -6,7 +6,7 @@ services: user: '65534' restart: always ports: - - "9101:9101" + - "10019:10019" environment: - PBS_ENDPOINT=https://pbs-server:8007 - PBS_INSECURE=false diff --git a/docker-compose.yaml b/docker-compose.yaml index c82b678..c4618ce 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -5,7 +5,7 @@ services: user: '65534' restart: always ports: - - "9101:9101" + - "10019:10019" environment: - PBS_API_TOKEN= - PBS_ENDPOINT=https://pbs-server:8007 diff --git a/main.go b/main.go index 7f661a9..6d3b6db 100644 --- a/main.go +++ b/main.go @@ -55,7 +55,7 @@ var ( "Proxmox Backup Server insecure") metricsPath = flag.String("pbs.metrics-path", "/metrics", "Path under which to expose metrics") - listenAddress = flag.String("pbs.listen-address", ":9101", + listenAddress = flag.String("pbs.listen-address", ":10019", "Address on which to expose metrics") loglevel = flag.String("pbs.loglevel", "info", "Loglevel") diff --git a/prometheus/static-config/multiple-exporter.yaml b/prometheus/static-config/multiple-exporter.yaml index 9f23f7c..c79ea1f 100644 --- a/prometheus/static-config/multiple-exporter.yaml +++ b/prometheus/static-config/multiple-exporter.yaml @@ -14,5 +14,5 @@ scheme: http static_configs: - targets: - - 'pbs-exporter-1:9101' # PBS_ENDPOINT set to target 1 - - 'pbs-exporter-2:9101' # PBS_ENDPOINT set to target 2 + - 'pbs-exporter-1:10019' # PBS_ENDPOINT set to target 1 + - 'pbs-exporter-2:10019' # PBS_ENDPOINT set to target 2 diff --git a/prometheus/static-config/multiple-targets.yaml b/prometheus/static-config/multiple-targets.yaml index a4a3541..8d40b98 100644 --- a/prometheus/static-config/multiple-targets.yaml +++ b/prometheus/static-config/multiple-targets.yaml @@ -2,7 +2,7 @@ # important: env PBS_ENDPOINT not set! # # Setup: -# - exporter instance: pbs-exporter:9101 +# - exporter instance: pbs-exporter:10019 # - first PBS target: https://10.10.10.10:8007 # - second PBS target: https://10.10.10.11:8007 @@ -23,4 +23,4 @@ scrape_configs: - source_labels: [__param_target] target_label: instance - target_label: __address__ - replacement: pbs-exporter:9101 # pbs-exporter address + replacement: pbs-exporter:10019 # pbs-exporter address diff --git a/prometheus/static-config/single-target.yaml b/prometheus/static-config/single-target.yaml index 10eac62..fc7ff91 100644 --- a/prometheus/static-config/single-target.yaml +++ b/prometheus/static-config/single-target.yaml @@ -1,7 +1,7 @@ # Use Case: single Proxmox Backup Server # # Setup: -# - exporter instance: pbs-exporter:9101 +# - exporter instance: pbs-exporter:10019 # - PBS target set in env PBS_ENDPOINT scrape_configs: @@ -13,7 +13,7 @@ scrape_configs: scheme: http static_configs: - targets: - - 'pbs-exporter:9101' # PBS_ENDPOINT set to target + - 'pbs-exporter:10019' # PBS_ENDPOINT set to target # example with relablings to have the host name (e.g. host-001) as metric label "instance" @@ -33,5 +33,5 @@ scrape_configs: target_label: instance - source_labels: [ __address__ ] regex: '(.*)@.*' - replacement: ${1}:9101 + replacement: ${1}:10019 target_label: __address__