mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 16:30:55 +01:00
docs: add more details explaining JSON line format
See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5083 Signed-off-by: hagen1778 <roman@victoriametrics.com>
This commit is contained in:
parent
dc71db9470
commit
c0b478d47f
@ -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
|
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:
|
Pass `Content-Encoding: gzip` HTTP request header to `/api/v1/import` for importing gzipped data:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
|
@ -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
|
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:
|
Pass `Content-Encoding: gzip` HTTP request header to `/api/v1/import` for importing gzipped data:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
|
Loading…
Reference in New Issue
Block a user