From febe502cf45a97de5d44babbff7a46e03dce765e Mon Sep 17 00:00:00 2001 From: ChrisChinchilla Date: Wed, 16 Sep 2020 15:34:17 +0200 Subject: [PATCH] Fix paths Signed-off-by: ChrisChinchilla --- docs/content/coordinator/api/remote.md | 2 +- docs/content/how_to/query.md | 2 +- docs/content/m3coordinator/api/remote.md | 119 ++++++++++++++++++ .../{query_engine => m3query}/_index.md | 0 .../{query_engine => m3query}/api/query.md | 0 .../architecture/_index.md | 0 .../architecture/blocks.md | 0 .../architecture/fanout.md | 0 .../architecture/functions.md | 0 .../config/_index.md | 0 .../config/annotated_config.md | 0 .../config/annotated_config.yaml | 0 .../{query_engine => m3query}/roadmap.md | 0 docs/content/overview/components.md | 2 +- 14 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 docs/content/m3coordinator/api/remote.md rename docs/content/{query_engine => m3query}/_index.md (100%) rename docs/content/{query_engine => m3query}/api/query.md (100%) rename docs/content/{query_engine => m3query}/architecture/_index.md (100%) rename docs/content/{query_engine => m3query}/architecture/blocks.md (100%) rename docs/content/{query_engine => m3query}/architecture/fanout.md (100%) rename docs/content/{query_engine => m3query}/architecture/functions.md (100%) rename docs/content/{query_engine => m3query}/config/_index.md (100%) rename docs/content/{query_engine => m3query}/config/annotated_config.md (100%) rename docs/content/{query_engine => m3query}/config/annotated_config.yaml (100%) rename docs/content/{query_engine => m3query}/roadmap.md (100%) diff --git a/docs/content/coordinator/api/remote.md b/docs/content/coordinator/api/remote.md index edaf81f39c..3279adeaa0 100644 --- a/docs/content/coordinator/api/remote.md +++ b/docs/content/coordinator/api/remote.md @@ -73,7 +73,7 @@ promremotecli_log 2019/06/25 04:13:56 write success # quay.io/m3db/prometheus_remote_client_golang@sha256:fc56df819bff9a5a087484804acf3a584dd4a78c68900c31a28896ed66ca7e7b ``` -For more details on querying data in PromQL that was written using this endpoint, see the [query API documentation](/../query_engine/api/). +For more details on querying data in PromQL that was written using this endpoint, see the [query API documentation](/../m3query/api/). ## Remote Read diff --git a/docs/content/how_to/query.md b/docs/content/how_to/query.md index 514572c590..3fed496d27 100644 --- a/docs/content/how_to/query.md +++ b/docs/content/how_to/query.md @@ -5,7 +5,7 @@ weight: 4 --- -m3query is used to query data that is stored in M3DB. For instance, if you are using the Prometheus remote write endpoint with [m3coordinator](/integrations/prometheus), you can use m3query instead of the Prometheus remote read endpoint. By doing so, you get all of the benefits of m3query's engine such as [block processing](http://m3db.github.io/m3/query_engine/architecture/blocks/). Furthermore, since m3query provides a Prometheus compatible API, you can use 3rd party graphing and alerting solutions like Grafana. +m3query is used to query data that is stored in M3DB. For instance, if you are using the Prometheus remote write endpoint with [m3coordinator](/integrations/prometheus), you can use m3query instead of the Prometheus remote read endpoint. By doing so, you get all of the benefits of m3query's engine such as [block processing](http://m3db.github.io/m3/m3query/architecture/blocks/). Furthermore, since m3query provides a Prometheus compatible API, you can use 3rd party graphing and alerting solutions like Grafana. ## Configuration diff --git a/docs/content/m3coordinator/api/remote.md b/docs/content/m3coordinator/api/remote.md new file mode 100644 index 0000000000..44ebd6635d --- /dev/null +++ b/docs/content/m3coordinator/api/remote.md @@ -0,0 +1,119 @@ +--- +title: "API" +weight: 1 +--- + +The M3 Coordinator implements the Prometheus Remote Read and Write HTTP endpoints, they also can be used however as general purpose metrics write and read APIs. Any metrics that are written to the remote write API can be queried using PromQL through the query APIs as well as being able to be read back by the Prometheus Remote Read endpoint. + +## Remote Write + +Write a Prometheus Remote write query to M3. + +### URL + +`/api/v1/prom/remote/write` + +### Method + +`POST` + +### URL Params + +None. + +### Header Params + +#### Optional + +{{% fileinclude file="/includes/headers_optional_read_write_all.md" %}} + +{{% fileinclude file="/includes/headers_optional_write_all.md" %}} + +### Data Params + +Binary [snappy compressed](http://google.github.io/snappy/) Prometheus [WriteRequest protobuf message](https://github.com/prometheus/prometheus/blob/10444e8b1dc69ffcddab93f09ba8dfa6a4a2fddb/prompb/remote.proto#L22-L24). + +### Available Tuning Params + +Refer [here](https://prometheus.io/docs/practices/remote_write/) for an up to date list of remote tuning parameters. + +### Sample Call + +There isn't a straightforward way to Snappy compress and marshal a Prometheus WriteRequest protobuf message using just shell, so this example uses a specific command line utility instead. + +This sample call is made using `promremotecli` which is a command line tool that uses a [Go client](https://github.com/m3db/prometheus_remote_client_golang) to Prometheus Remote endpoints. For more information visit the [GitHub repository](https://github.com/m3db/prometheus_remote_client_golang). + +There is also a [Java client](https://github.com/m3dbx/prometheus_remote_client_java) that can be used to make requests to the endpoint. + +Each `-t` parameter specifies a label (dimension) to add to the metric. + +The `-h` parameter can be used as many times as necessary to add headers to the outgoing request in the form of "Header-Name: HeaderValue". + +Here is an example of writing the datapoint at the current unix timestamp with value 123.456: + + + +```bash +docker run -it --rm \ + quay.io/m3db/prometheus_remote_client_golang:latest \ + -u http://host.docker.internal:7201/api/v1/prom/remote/write \ + -t __name__:http_requests_total \ + -t code:200 \ + -t handler:graph \ + -t method:get \ + -d $(date +"%s"),123.456 +promremotecli_log 2019/06/25 04:13:56 writing datapoint [2019-06-25 04:13:55 +0000 UTC 123.456] +promremotecli_log 2019/06/25 04:13:56 labelled [[__name__ http_requests_total] [code 200] [handler graph] [method get]] +promremotecli_log 2019/06/25 04:13:56 writing to http://host.docker.internal:7201/api/v1/prom/remote/write +{"success":true,"statusCode":200} +promremotecli_log 2019/06/25 04:13:56 write success + +# If you are paranoid about image tags being hijacked/replaced with nefarious code, you can use this SHA256 tag: +# quay.io/m3db/prometheus_remote_client_golang@sha256:fc56df819bff9a5a087484804acf3a584dd4a78c68900c31a28896ed66ca7e7b +``` + +<<<<<<< HEAD:docs/content/m3coordinator/api/remote.md +For more details on querying data in PromQL that was written using this endpoint, see the [query API documentation](/../m3query/api/). +======= +For more details on querying data in PromQL that was written using this endpoint, see the [query API documentation](../../m3query/api/). +>>>>>>> master:docs/m3coordinator/api/remote.md + +## Remote Read + +Read Prometheus metrics from M3. + +### URL + +`/api/v1/prom/remote/read` + +### Method + +`POST` + +### URL Params + +None. + +### Header Params + +#### Optional + +<<<<<<< HEAD:docs/content/m3coordinator/api/remote.md +\--8<-- +docs/common/headers_optional_read_write.md +\--8<-- +======= +--8<-- +docs/common/headers_optional_read_write_all.md +--8<-- +--8<-- +docs/common/headers_optional_read_all.md +--8<-- +>>>>>>> master:docs/m3coordinator/api/remote.md + +### Data Params + +Binary [snappy compressed](http://google.github.io/snappy/) Prometheus [WriteRequest protobuf message](https://github.com/prometheus/prometheus/blob/10444e8b1dc69ffcddab93f09ba8dfa6a4a2fddb/prompb/remote.proto#L26-L28). diff --git a/docs/content/query_engine/_index.md b/docs/content/m3query/_index.md similarity index 100% rename from docs/content/query_engine/_index.md rename to docs/content/m3query/_index.md diff --git a/docs/content/query_engine/api/query.md b/docs/content/m3query/api/query.md similarity index 100% rename from docs/content/query_engine/api/query.md rename to docs/content/m3query/api/query.md diff --git a/docs/content/query_engine/architecture/_index.md b/docs/content/m3query/architecture/_index.md similarity index 100% rename from docs/content/query_engine/architecture/_index.md rename to docs/content/m3query/architecture/_index.md diff --git a/docs/content/query_engine/architecture/blocks.md b/docs/content/m3query/architecture/blocks.md similarity index 100% rename from docs/content/query_engine/architecture/blocks.md rename to docs/content/m3query/architecture/blocks.md diff --git a/docs/content/query_engine/architecture/fanout.md b/docs/content/m3query/architecture/fanout.md similarity index 100% rename from docs/content/query_engine/architecture/fanout.md rename to docs/content/m3query/architecture/fanout.md diff --git a/docs/content/query_engine/architecture/functions.md b/docs/content/m3query/architecture/functions.md similarity index 100% rename from docs/content/query_engine/architecture/functions.md rename to docs/content/m3query/architecture/functions.md diff --git a/docs/content/query_engine/config/_index.md b/docs/content/m3query/config/_index.md similarity index 100% rename from docs/content/query_engine/config/_index.md rename to docs/content/m3query/config/_index.md diff --git a/docs/content/query_engine/config/annotated_config.md b/docs/content/m3query/config/annotated_config.md similarity index 100% rename from docs/content/query_engine/config/annotated_config.md rename to docs/content/m3query/config/annotated_config.md diff --git a/docs/content/query_engine/config/annotated_config.yaml b/docs/content/m3query/config/annotated_config.yaml similarity index 100% rename from docs/content/query_engine/config/annotated_config.yaml rename to docs/content/m3query/config/annotated_config.yaml diff --git a/docs/content/query_engine/roadmap.md b/docs/content/m3query/roadmap.md similarity index 100% rename from docs/content/query_engine/roadmap.md rename to docs/content/m3query/roadmap.md diff --git a/docs/content/overview/components.md b/docs/content/overview/components.md index 7a057df3c0..7233ac2358 100644 --- a/docs/content/overview/components.md +++ b/docs/content/overview/components.md @@ -13,7 +13,7 @@ M3DB is a distributed time series database that provides scalable storage and a ## M3 Query -M3 Query is a service that houses a distributed query engine for querying both realtime and historical metrics, supporting several different query languages. It is designed to support both low latency realtime queries and queries that can take longer to execute, aggregating over much larger datasets, for analytical use cases. For more details, see the [query engine documentation](/query_engine/). +M3 Query is a service that houses a distributed query engine for querying both realtime and historical metrics, supporting several different query languages. It is designed to support both low latency realtime queries and queries that can take longer to execute, aggregating over much larger datasets, for analytical use cases. For more details, see the [query engine documentation](/m3query/). ## M3 Aggregator