docs: Add example of escaping tracing JSON using jq

This commit is contained in:
Blake Covarrubias 2021-06-12 15:21:07 -07:00 committed by Blake Covarrubias
parent 26b8e8904b
commit 64d122b0a2
1 changed files with 21 additions and 1 deletions

View File

@ -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
{