mirror of https://github.com/status-im/consul.git
docs: Add example of escaping tracing JSON using jq
This commit is contained in:
parent
26b8e8904b
commit
64d122b0a2
|
@ -401,7 +401,27 @@ For example, given a tracing config:
|
|||
```
|
||||
|
||||
JSON escape the value of `tracing` into a string, for example using [https://codebeautify.org/json-escape-unescape](https://codebeautify.org/json-escape-unescape),
|
||||
and then use that as the value for `envoy_tracing_json`:
|
||||
or using [jq](https://stedolan.github.io/jq/).
|
||||
|
||||
```shell
|
||||
$ cat <<EOF | jq '. | @json'
|
||||
{
|
||||
"http": {
|
||||
"name": "envoy.tracers.zipkin",
|
||||
"typedConfig": {
|
||||
"@type": "type.googleapis.com/envoy.config.trace.v3.ZipkinConfig",
|
||||
"collector_cluster": "zipkin",
|
||||
"collector_endpoint_version": "HTTP_JSON",
|
||||
"collector_endpoint": "/api/v1/spans",
|
||||
"shared_span_context": false
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
"{\"http\":{\"name\":\"envoy.tracers.zipkin\",\"typedConfig\":{\"@type\":\"type.googleapis.com/envoy.config.trace.v3.ZipkinConfig\",\"collector_cluster\":\"zipkin\",\"collector_endpoint_version\":\"HTTP_JSON\",\"collector_endpoint\":\"/api/v1/spans\",\"shared_span_context\":false}}}"
|
||||
```
|
||||
|
||||
Then use that as the value for `envoy_tracing_json`:
|
||||
|
||||
```json
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue