docs: Add example of escaping tracing JSON using jq

release/1.10.0-rc
Blake Covarrubias 2021-06-12 15:21:07 -07:00 committed by hc-github-team-consul-core
parent 028996a308
commit d8f9789c26
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), 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 ```json
{ {