diff --git a/documentation/examples/remote_storage/example_receiver/README.md b/documentation/examples/remote_storage/example_write_adapter/README.md similarity index 84% rename from documentation/examples/remote_storage/example_receiver/README.md rename to documentation/examples/remote_storage/example_write_adapter/README.md index 3a0be8c0ba..45f3e36857 100644 --- a/documentation/examples/remote_storage/example_receiver/README.md +++ b/documentation/examples/remote_storage/example_write_adapter/README.md @@ -1,4 +1,4 @@ -## Generic Remote Storage Example +## Remote Write Adapter Example This is a simple example of how to write a server to receive samples from the remote storage output. @@ -7,7 +7,7 @@ To use it: ``` go build -./example_receiver +./example_write_adapter ``` ...and then add the following to your `prometheus.yml`: diff --git a/documentation/examples/remote_storage/example_receiver/server.go b/documentation/examples/remote_storage/example_write_adapter/server.go similarity index 100% rename from documentation/examples/remote_storage/example_receiver/server.go rename to documentation/examples/remote_storage/example_write_adapter/server.go diff --git a/documentation/examples/remote_storage/remote_storage_adapter/README.md b/documentation/examples/remote_storage/remote_storage_adapter/README.md new file mode 100644 index 0000000000..f116e09666 --- /dev/null +++ b/documentation/examples/remote_storage/remote_storage_adapter/README.md @@ -0,0 +1,55 @@ +# Remote storage adapter + +This is a write adapter that receives samples via Prometheus's remote write +protocol and stores them in Graphite, InfluxDB, or OpenTSDB. It is meant as a +replacement for the built-in specific remote storage implementations that have +been removed from Prometheus. + +For InfluxDB, this binary is also a read adapter that supports reading back +data through Prometheus via Prometheus's remote read protocol. + +## Building + +``` +go build +``` + +## Running + +Graphite example: + +``` +./remote_storage_adapter -graphite-address=localhost:8080 +``` + +OpenTSDB example: + +``` +./remote_storage_adapter -opentsdb-url=http://localhost:8081/ +``` + +InfluxDB example: + +``` +./remote_storage_adapter -influxdb-url=http://localhost:8086/ -influxdb.database=prometheus -influxdb.retention-policy=autogen +``` + +To show all flags: + +``` +./remote_storage_adapter -h +``` + +## Configuring Prometheus + +To configure Prometheus to send samples to this binary, add the following to your `prometheus.yml`: + +```yaml +# 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" +``` diff --git a/documentation/examples/remote_storage/remote_storage_bridge/graphite/client.go b/documentation/examples/remote_storage/remote_storage_adapter/graphite/client.go similarity index 100% rename from documentation/examples/remote_storage/remote_storage_bridge/graphite/client.go rename to documentation/examples/remote_storage/remote_storage_adapter/graphite/client.go diff --git a/documentation/examples/remote_storage/remote_storage_bridge/graphite/client_test.go b/documentation/examples/remote_storage/remote_storage_adapter/graphite/client_test.go similarity index 100% rename from documentation/examples/remote_storage/remote_storage_bridge/graphite/client_test.go rename to documentation/examples/remote_storage/remote_storage_adapter/graphite/client_test.go diff --git a/documentation/examples/remote_storage/remote_storage_bridge/graphite/escape.go b/documentation/examples/remote_storage/remote_storage_adapter/graphite/escape.go similarity index 100% rename from documentation/examples/remote_storage/remote_storage_bridge/graphite/escape.go rename to documentation/examples/remote_storage/remote_storage_adapter/graphite/escape.go diff --git a/documentation/examples/remote_storage/remote_storage_bridge/influxdb/client.go b/documentation/examples/remote_storage/remote_storage_adapter/influxdb/client.go similarity index 100% rename from documentation/examples/remote_storage/remote_storage_bridge/influxdb/client.go rename to documentation/examples/remote_storage/remote_storage_adapter/influxdb/client.go diff --git a/documentation/examples/remote_storage/remote_storage_bridge/influxdb/client_test.go b/documentation/examples/remote_storage/remote_storage_adapter/influxdb/client_test.go similarity index 100% rename from documentation/examples/remote_storage/remote_storage_bridge/influxdb/client_test.go rename to documentation/examples/remote_storage/remote_storage_adapter/influxdb/client_test.go diff --git a/documentation/examples/remote_storage/remote_storage_bridge/main.go b/documentation/examples/remote_storage/remote_storage_adapter/main.go similarity index 98% rename from documentation/examples/remote_storage/remote_storage_bridge/main.go rename to documentation/examples/remote_storage/remote_storage_adapter/main.go index 7603511bcd..5bcf026621 100644 --- a/documentation/examples/remote_storage/remote_storage_bridge/main.go +++ b/documentation/examples/remote_storage/remote_storage_adapter/main.go @@ -33,9 +33,9 @@ import ( influx "github.com/influxdata/influxdb/client/v2" - "github.com/prometheus/prometheus/documentation/examples/remote_storage/remote_storage_bridge/graphite" - "github.com/prometheus/prometheus/documentation/examples/remote_storage/remote_storage_bridge/influxdb" - "github.com/prometheus/prometheus/documentation/examples/remote_storage/remote_storage_bridge/opentsdb" + "github.com/prometheus/prometheus/documentation/examples/remote_storage/remote_storage_adapter/graphite" + "github.com/prometheus/prometheus/documentation/examples/remote_storage/remote_storage_adapter/influxdb" + "github.com/prometheus/prometheus/documentation/examples/remote_storage/remote_storage_adapter/opentsdb" "github.com/prometheus/prometheus/storage/remote" ) diff --git a/documentation/examples/remote_storage/remote_storage_bridge/opentsdb/client.go b/documentation/examples/remote_storage/remote_storage_adapter/opentsdb/client.go similarity index 100% rename from documentation/examples/remote_storage/remote_storage_bridge/opentsdb/client.go rename to documentation/examples/remote_storage/remote_storage_adapter/opentsdb/client.go diff --git a/documentation/examples/remote_storage/remote_storage_bridge/opentsdb/client_test.go b/documentation/examples/remote_storage/remote_storage_adapter/opentsdb/client_test.go similarity index 100% rename from documentation/examples/remote_storage/remote_storage_bridge/opentsdb/client_test.go rename to documentation/examples/remote_storage/remote_storage_adapter/opentsdb/client_test.go diff --git a/documentation/examples/remote_storage/remote_storage_bridge/opentsdb/tagvalue.go b/documentation/examples/remote_storage/remote_storage_adapter/opentsdb/tagvalue.go similarity index 100% rename from documentation/examples/remote_storage/remote_storage_bridge/opentsdb/tagvalue.go rename to documentation/examples/remote_storage/remote_storage_adapter/opentsdb/tagvalue.go diff --git a/documentation/examples/remote_storage/remote_storage_bridge/opentsdb/tagvalue_test.go b/documentation/examples/remote_storage/remote_storage_adapter/opentsdb/tagvalue_test.go similarity index 100% rename from documentation/examples/remote_storage/remote_storage_bridge/opentsdb/tagvalue_test.go rename to documentation/examples/remote_storage/remote_storage_adapter/opentsdb/tagvalue_test.go diff --git a/documentation/examples/remote_storage/remote_storage_bridge/README.md b/documentation/examples/remote_storage/remote_storage_bridge/README.md deleted file mode 100644 index 4c48a7ddf3..0000000000 --- a/documentation/examples/remote_storage/remote_storage_bridge/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# Remote storage bridge - -This is a bridge that receives samples via Prometheus's remote write -protocol and stores them in Graphite, InfluxDB, or OpenTSDB. It is meant -as a replacement for the built-in specific remote storage implementations -that have been removed from Prometheus. - -For InfluxDB, this bridge also supports reading back data through -Prometheus via Prometheus's remote read protocol. - -## Building - -``` -go build -``` - -## Running - -Graphite example: - -``` -./remote_storage_bridge -graphite-address=localhost:8080 -``` - -OpenTSDB example: - -``` -./remote_storage_bridge -opentsdb-url=http://localhost:8081/ -``` - -InfluxDB example: - -``` -./remote_storage_bridge -influxdb-url=http://localhost:8086/ -influxdb.database=prometheus -influxdb.retention-policy=autogen -``` - -To show all flags: - -``` -./remote_storage_bridge -h -``` - -## Configuring Prometheus - -To configure Prometheus to send samples to this bridge, add the following to your `prometheus.yml`: - -```yaml -# 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" -``` \ No newline at end of file