Skip to content

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
MGSousa authored Dec 20, 2023
1 parent 5f9a66f commit 19fea9f
Showing 1 changed file with 91 additions and 1 deletion.
92 changes: 91 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 19fea9f

Please sign in to comment.