From 19fea9fb48a34512d59e0505d3ce3418dbc803fb Mon Sep 17 00:00:00 2001 From: MGSousa <31368750+MGSousa@users.noreply.github.com> Date: Wed, 20 Dec 2023 13:59:33 +0000 Subject: [PATCH] Updated README --- README.md | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 91 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 309f66c..a8e8ffc 100644 --- a/README.md +++ b/README.md @@ -25,5 +25,95 @@ curl -o prom-exporter.exe https://github.com/MGSousa/prom-exporter/releases/down ``` ## Usage + - About args ```sh -./prom-exporter -service-uri "REMOTE_HOST:PORT"-service-name "SERVICE_NAME" -service-metrics-path "REMOTE_PATH" +Usage of ./prom-exporter: + -debug + Enable debug mode. + -listen-address string + Address to listen on to be scraped. (default ":19100") + -service-metrics-path string + Service path to scrape metrics from. (default "metrics") + -service-name string + Remote service name to reference. + -service-port string + HTTP Port of the remote service. (default "80") + -service-protocol string + HTTP Schema of the remote service (http or https). (default "http") + -service-uri string + Endpoint address of the remote service. + -service-version-scrape + Enable whether the service will be internally scraped for fetching remote build version or not. + -telemetry-path string + Base path under which to expose metrics. (default "/metrics") +``` + + - Run it via docker compose / swarm +### filebeat.yaml +```yaml +fields_under_root: true +filebeat.autodiscover.providers: + - type: docker + templates: + - condition.and: + - not.contains: + docker.container.labels.name: "filebeat" + config: + - type: container + paths: + - "/var/lib/docker/containers/${data.docker.container.id}/*.log" +processors: + - add_docker_metadata: + host: "unix:///var/run/docker.sock" +output.console: + pretty: true +logging: + level: "info" + metrics.enabled: false +http: + enabled: true + host: 0.0.0.0 +``` +### compose.yaml +```yaml +# configuration example + +networks: + filebeat: + external: true + +services: + filebeat: + hostname: &filebeat_endpoint "CUSTOM_HOSTNAME" + container_name: filebeat + image: docker.elastic.co/beats/filebeat:8.11.1 + command: -environment container + user: root + volumes: + - ${PWD}/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro + - /var/lib/docker:/var/lib/docker:ro + - /var/run/docker.sock:/var/run/docker.sock + networks: + - filebeat + exporter: + container_name: filebeat_exporter + image: filebeat-exporter:latest + command: | + -listen-address ":9201" + -service-name "filebeat" + -service-port "5066" + -service-metrics-path "stats" + environment: + SERVICE_ENDPOINT: *filebeat_endpoint + networks: + - filebeat + ports: + - '9201:9201' +``` + - Run it via executable +```sh +./prom-exporter -service-name "SERVICE_NAME" -service-uri "REMOTE_HOST" -service-port REMOTE_PORT -service-metrics-path "REMOTE_PATH" +``` + +## TODO +[] Set desired metrics with custom ValueType (Gauge, Histogram, Counter, etc.) via mapping