diff --git a/README.md b/README.md index eabcd3d54..426010d39 100644 --- a/README.md +++ b/README.md @@ -1237,6 +1237,24 @@ curl http://source-victoriametrics:8428/api/v1/export -d 'match={__name__!=""}' curl -X POST http://destination-victoriametrics:8428/api/v1/import -T exported_data.jsonl ``` +The structure of the JSON line format from the previous example is below: +``` +cat exported_data.jsonl + +{"metric":{"__name__":"go_cgo_calls_count","job":"victoria-metrics","instance":"self"},"values":[5],"timestamps":[1696323409458 +]} +{"metric":{"__name__":"go_gc_forced_count","job":"victoria-metrics","instance":"self"},"values":[0],"timestamps":[1696323409458]} +{"metric":{"__name__":"vm_merges_total","job":"victoria-metrics","type":"storage/big","instance":"self"},"values":[0],"timestamps":[1696323409458]} +{"metric":{"__name__":"vm_http_request_errors_total","job":"victoria-metrics","instance":"self"},"values":[0],"timestamps":[1696323409458]} +``` + +The JSON line format allows having multiple lines in one batch. On ingestion, it is recommended to batch up to multiple +thousands of lines in one payload. Every line is represented by the following objects: +* `metric` - describes a [time series](https://docs.victoriametrics.com/keyConcepts.html#time-series) with arbitrary +number of [labels](https://docs.victoriametrics.com/keyConcepts.html#labels). Please note, `__name__` label is required. +* `values` - list of [values](https://docs.victoriametrics.com/keyConcepts.html#raw-samples) belonging to this time series; +* `timestamps` - list of unix timestamps in milliseconds associated with each value from `values` list according to their order. + Pass `Content-Encoding: gzip` HTTP request header to `/api/v1/import` for importing gzipped data: ```console diff --git a/docs/README.md b/docs/README.md index 0e2363871..ccfcab8f5 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1240,6 +1240,24 @@ curl http://source-victoriametrics:8428/api/v1/export -d 'match={__name__!=""}' curl -X POST http://destination-victoriametrics:8428/api/v1/import -T exported_data.jsonl ``` +The structure of the JSON line format from the previous example is below: +``` +cat exported_data.jsonl + +{"metric":{"__name__":"go_cgo_calls_count","job":"victoria-metrics","instance":"self"},"values":[5],"timestamps":[1696323409458 +]} +{"metric":{"__name__":"go_gc_forced_count","job":"victoria-metrics","instance":"self"},"values":[0],"timestamps":[1696323409458]} +{"metric":{"__name__":"vm_merges_total","job":"victoria-metrics","type":"storage/big","instance":"self"},"values":[0],"timestamps":[1696323409458]} +{"metric":{"__name__":"vm_http_request_errors_total","job":"victoria-metrics","instance":"self"},"values":[0],"timestamps":[1696323409458]} +``` + +The JSON line format allows having multiple lines in one batch. On ingestion, it is recommended to batch up to multiple +thousands of lines in one payload. Every line is represented by the following objects: +* `metric` - describes a [time series](https://docs.victoriametrics.com/keyConcepts.html#time-series) with arbitrary +number of [labels](https://docs.victoriametrics.com/keyConcepts.html#labels). Please note, `__name__` label is required. +* `values` - list of [values](https://docs.victoriametrics.com/keyConcepts.html#raw-samples) belonging to this time series; +* `timestamps` - list of unix timestamps in milliseconds associated with each value from `values` list according to their order. + Pass `Content-Encoding: gzip` HTTP request header to `/api/v1/import` for importing gzipped data: ```console diff --git a/docs/Single-server-VictoriaMetrics.md b/docs/Single-server-VictoriaMetrics.md index 801efcba4..10ae23565 100644 --- a/docs/Single-server-VictoriaMetrics.md +++ b/docs/Single-server-VictoriaMetrics.md @@ -1248,6 +1248,24 @@ curl http://source-victoriametrics:8428/api/v1/export -d 'match={__name__!=""}' curl -X POST http://destination-victoriametrics:8428/api/v1/import -T exported_data.jsonl ``` +The structure of the JSON line format from the previous example is below: +``` +cat exported_data.jsonl + +{"metric":{"__name__":"go_cgo_calls_count","job":"victoria-metrics","instance":"self"},"values":[5],"timestamps":[1696323409458 +]} +{"metric":{"__name__":"go_gc_forced_count","job":"victoria-metrics","instance":"self"},"values":[0],"timestamps":[1696323409458]} +{"metric":{"__name__":"vm_merges_total","job":"victoria-metrics","type":"storage/big","instance":"self"},"values":[0],"timestamps":[1696323409458]} +{"metric":{"__name__":"vm_http_request_errors_total","job":"victoria-metrics","instance":"self"},"values":[0],"timestamps":[1696323409458]} +``` + +The JSON line format allows having multiple lines in one batch. On ingestion, it is recommended to batch up to multiple +thousands of lines in one payload. Every line is represented by the following objects: +* `metric` - describes a [time series](https://docs.victoriametrics.com/keyConcepts.html#time-series) with arbitrary +number of [labels](https://docs.victoriametrics.com/keyConcepts.html#labels). Please note, `__name__` label is required. +* `values` - list of [values](https://docs.victoriametrics.com/keyConcepts.html#raw-samples) belonging to this time series; +* `timestamps` - list of unix timestamps in milliseconds associated with each value from `values` list according to their order. + Pass `Content-Encoding: gzip` HTTP request header to `/api/v1/import` for importing gzipped data: ```console