# curl -XPOST 'http://172.29.225.32:8086/query?pretty=true' --data-urlencode "q=SHOW DATABASES"
{
"results": [
{
"statement_id": 0,
"series": [
{
"name": "databases",
"columns": [
"name"
],
"values": [
[
"_internal"
],
[
"prometheus"
],
[
"mydb"
]
]
}
]
}
]
}./remote_storage_adapter -influxdb-url=http://localhost:8086/ -influxdb.database=prometheus -influxdb.retention-policy=autogen# netstat -tulpn | grep 9201
tcp6 0 0 :::9201 :::* LISTEN 14322/./remote_stor global:
scrape_interval: 15s # By default, scrape targets every 15 seconds.
# Remote write configuration (for Graphite, OpenTSDB, or InfluxDB).
remote_write:
- url: "http://localhost:9201/write"
# Remote read configuration (for InfluxDB only at the moment).
remote_read:
- url: "http://localhost:9201/read"
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']# ./prometheus -config.file=prometheus.yml -log.level=debug
INFO[0000] Starting prometheus (version=1.6.3, branch=master, revision=c580b60c67f2c5f6b638c3322161bcdf6d68d7fc) source=main.go:88
INFO[0000] Build context (go=go1.8.1, user=root@a6410e65f5c7, date=20170522-09:15:06) source=main.go:89
INFO[0000] Loading configuration file prometheus.yml source=main.go:251
INFO[0000] Loading series map and head chunks... source=storage.go:421
INFO[0000] 3513 series loaded. source=storage.go:432
INFO[0000] Starting target manager... source=targetmanager.go:61
INFO[0000] Listening on :9090 source=web.go:259
INFO[0300] Checkpointing in-memory metrics and chunks... source=persistence.go:633
INFO[0300] Done checkpointing in-memory metrics and chunks in 279.603534ms. source=persistence.go:665
git clone https://github.com/prometheus/prometheus.git
# ./prometheus -version
prometheus, version 1.6.2 (branch: master, revision: e0f046396a163913ee3c40030a7f42fbdcf1cbd5)
build user: root@supportserver
build date: 20170530-16:43:14
go version: go1.8.3# /usr/local/go/src/github.com/prometheus/prometheus/documentation/examples/remote_storage/remote_storage_adapter/remote_storage_adapter -influxdb-url=http://localhost:8086/ -influxdb.database=prometheus -influxdb.retention-policy=autogen -log.level=debug -log.format=logger:stdout?json=trueTo configure Prometheus to send samples to this binary, add the following to your prometheus.yml:
# Remote write configuration (for Graphite, OpenTSDB, or InfluxDB). remote_write: - url: "http://localhost:9201/write" # Remote read configuration (for InfluxDB only at the moment). remote_read: - url: "http://localhost:9201/read"