Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: zirain <[email protected]>
  • Loading branch information
zirain committed Jul 5, 2024
1 parent 011c723 commit ddde265
Showing 1 changed file with 71 additions and 3 deletions.
74 changes: 71 additions & 3 deletions site/content/en/latest/tasks/observability/proxy-trace.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ title: "Proxy Tracing"
---

Envoy Gateway provides observability for the ControlPlane and the underlying EnvoyProxy instances.
This task show you how to config proxy traces.
This task show you how to config proxy tracing.

## Prerequisites

{{< boilerplate o11y_prerequisites >}}

Expose endpoints:
Expose Tempo endpoints:

```shell
TEMPO_IP=$(kubectl get svc tempo -n monitoring -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
Expand All @@ -21,10 +21,13 @@ By default, Envoy Gateway doesn't send traces to any sink.
You can enable traces by setting the `telemetry.tracing` in the [EnvoyProxy][envoy-proxy-crd] CRD.
Currently, Envoy Gateway support OpenTelemetry and [Zipkin](../../api/extension_types#zipkintracingprovider) tracer.

***Note:*** Envoy Gateway use 100% sample rate, which means all requests will be traced. This may cause performance issues, you can adjust the sample rate by setting the `telemetry.tracing.samplingRate` in the [EnvoyProxy][envoy-proxy-crd] CRD.
### Tracing Provider

The following configurations show how to apply proxy with different providers:

{{< tabpane text=true >}}
{{% tab header="OpenTelemetry" %}}

```shell
kubectl apply -f - <<EOF
apiVersion: gateway.networking.k8s.io/v1
Expand Down Expand Up @@ -162,4 +165,69 @@ curl -s "http://$TEMPO_IP:3100/api/traces/<trace_id>" | jq
```


### Sampling Rate

Envoy Gateway use 100% sample rate, which means all requests will be traced.
This may cause performance issues when traffic is very high, you can adjust
the sample rate by setting the `telemetry.tracing.samplingRate` in the [EnvoyProxy][envoy-proxy-crd] CRD.

The following configurations show how to apply proxy with 1% sample rates:

```shell
kubectl apply -f - <<EOF
apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
name: eg
spec:
controllerName: gateway.envoyproxy.io/gatewayclass-controller
parametersRef:
group: gateway.envoyproxy.io
kind: EnvoyProxy
name: otel
namespace: envoy-gateway-system
---
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyProxy
metadata:
name: otel
namespace: envoy-gateway-system
spec:
telemetry:
tracing:
# sample 1% of requests
samplingRate: 1
provider:
backendRefs:
- name: otel-collector
namespace: monitoring
port: 4317
type: OpenTelemetry
customTags:
# This is an example of using a literal as a tag value
provider:
type: Literal
literal:
value: "otel"
"k8s.pod.name":
type: Environment
environment:
name: ENVOY_POD_NAME
defaultValue: "-"
"k8s.namespace.name":
type: Environment
environment:
name: ENVOY_GATEWAY_NAMESPACE
defaultValue: "envoy-gateway-system"
# This is an example of using a header value as a tag value
header1:
type: RequestHeader
requestHeader:
name: X-Header-1
defaultValue: "-"
EOF
```



[envoy-proxy-crd]: ../../api/extension_types#envoyproxy

0 comments on commit ddde265

Please sign in to comment.