-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* make boilerplates versioned Signed-off-by: zirain <[email protected]> * docs: zikpin tracer Signed-off-by: zirain <[email protected]> * comment Signed-off-by: zirain <[email protected]> * update boilerplate Signed-off-by: zirain <[email protected]> --------- Signed-off-by: zirain <[email protected]>
- Loading branch information
Showing
9 changed files
with
253 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
3 changes: 2 additions & 1 deletion
3
...ent/en/boilerplates/o11y_prerequisites.md → ...latest/boilerplates/o11y_prerequisites.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
233 changes: 233 additions & 0 deletions
233
site/content/en/latest/tasks/observability/proxy-trace.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,233 @@ | ||
--- | ||
title: "Proxy Tracing" | ||
--- | ||
|
||
Envoy Gateway provides observability for the ControlPlane and the underlying EnvoyProxy instances. | ||
This task show you how to config proxy tracing. | ||
|
||
## Prerequisites | ||
|
||
{{< boilerplate o11y_prerequisites >}} | ||
|
||
Expose Tempo endpoints: | ||
|
||
```shell | ||
TEMPO_IP=$(kubectl get svc tempo -n monitoring -o jsonpath='{.status.loadBalancer.ingress[0].ip}') | ||
``` | ||
|
||
## Traces | ||
|
||
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. | ||
|
||
### 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 | ||
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 100% of requests | ||
samplingRate: 100 | ||
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 | ||
``` | ||
|
||
Verify OpenTelemetry traces from tempo: | ||
|
||
```shell | ||
curl -s "http://$TEMPO_IP:3100/api/search?tags=component%3Dproxy+provider%3Dotel" | jq .traces | ||
``` | ||
|
||
{{% /tab %}} | ||
{{% tab header="Zipkin" %}} | ||
|
||
```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: zipkin | ||
namespace: envoy-gateway-system | ||
--- | ||
apiVersion: gateway.envoyproxy.io/v1alpha1 | ||
kind: EnvoyProxy | ||
metadata: | ||
name: zipkin | ||
namespace: envoy-gateway-system | ||
spec: | ||
telemetry: | ||
tracing: | ||
# sample 100% of requests | ||
samplingRate: 100 | ||
provider: | ||
backendRefs: | ||
- name: otel-collector | ||
namespace: monitoring | ||
port: 9411 | ||
type: Zipkin | ||
zipkin: | ||
enable128BitTraceId: true | ||
customTags: | ||
# This is an example of using a literal as a tag value | ||
provider: | ||
type: Literal | ||
literal: | ||
value: "zipkin" | ||
"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 | ||
``` | ||
|
||
Verify zipkin traces from tempo: | ||
|
||
```shell | ||
curl -s "http://$TEMPO_IP:3100/api/search?tags=component%3Dproxy+provider%3Dzipkin" | jq .traces | ||
``` | ||
|
||
{{% /tab %}} | ||
{{< /tabpane >}} | ||
|
||
Query trace by trace id: | ||
|
||
```shell | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters