This commit is contained in:
kev 2021-11-29 15:23:49 +08:00
parent d33a7d4379
commit be138ae446
7 changed files with 60 additions and 22 deletions

View File

@ -3,4 +3,6 @@ prometheus
[Prometheus][1] is an open-source systems monitoring and alerting toolkit originally built at SoundCloud.
![](http://www.robustperception.io/wp-content/uploads/2015/11/Replacing-Graphite-with-Prometheus.png)
[1]: https://prometheus.io/docs/introduction/overview/

View File

@ -0,0 +1,20 @@
mappings:
- match: test.dispatcher.*.*.*
name: dispatcher_events_total
labels:
action: $2
job: test_dispatcher
outcome: $3
processor: $1
- match: '*.signup.*.*'
name: signup_events_total
labels:
job: ${1}_server
outcome: $3
provider: $2
- match: 'servers\.(.*)\.networking\.subnetworks\.transmissions\.([a-z0-9-]+)\.(.*)'
match_type: regex
name: 'servers_networking_transmissions_${3}'
labels:
hostname: ${1}
device: ${2}

View File

@ -1,19 +1,16 @@
global:
scrape_interval: 15s # By default, scrape targets every 15 seconds.
# Attach these labels to any time series or alerts when communicating with
# external systems (federation, remote storage, Alertmanager).
scrape_interval: 15s
external_labels:
monitor: 'codelab-monitor'
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus'
# Override the global default and scrape targets from this job every 5 seconds.
scrape_interval: 5s
static_configs:
- targets: ['localhost:9090']
- job_name: 'graphite'
honor_labels: true
static_configs:
- targets:
- graphite:9108

View File

@ -1,15 +1,32 @@
version: "3.8"
services:
prometheus:
image: prom/prometheus:v2.31.1
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/var/lib/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/var/lib/prometheus"
- "--web.console.libraries=/usr/share/prometheus/console_libraries"
- "--web.console.templates=/usr/share/prometheus/consoles"
- "--web.external-url=http://127.0.0.1:9090"
- "--storage.tsdb.retention.time=1y"
ports:
- "9090:9090"
volumes:
- ./data/etc:/etc/prometheus
- ./data/var:/var/lib/prometheus
restart: unless-stopped
graphite:
image: prom/graphite-exporter
command:
- "--graphite.mapping-config=/etc/prometheus/graphite-mapping.yaml"
- "--graphite.mapping-strict-match"
ports:
- "9108:9108"
- "9109:9109"
- "9109:9109/udp"
volumes:
- ./data/etc:/etc/prometheus
restart: unless-stopped

View File

@ -5,13 +5,14 @@ trino
distributed over one or more heterogeneous data sources.
```bash
$ mkdir -m 777 data
$ mkdir data/{etc,data}
$ chown -R 1000:1000 data
$ docker-compose up -d
$ docker-compose exec trino trino
>>> show catalogs;
>>> show schemas from jmx;
>>> show tables from jmx.current;
>>> select * from jmx.current."java.lang:type=operatingsystem";
>>> show schemas from system;
>>> show tables from system.runtime;
>>> select * from system.runtime.queries;
>>> quit
```

View File

@ -1,3 +1,3 @@
node.environment=docker
node.data-dir=/var/lib/trino
node.data-dir=/usr/lib/trino/data
node.id=master

View File

@ -2,10 +2,11 @@ version: "3.8"
services:
trino:
image: trinodb/trino
command: ["/usr/lib/trino/bin/launcher", "run", "--etc-dir", "etc", "--data-dir", "data"]
command: ["bin/launcher", "run", "--etc-dir", "etc", "--data-dir", "data"]
ports:
- "8080:8080"
volumes:
- ./data:/opt/trino
working_dir: /opt/trino
- ./data/etc:/usr/lib/trino/etc
- ./data/data:/usr/lib/trino/data
working_dir: /usr/lib/trino
restart: unless-stopped