-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: update EG control-plane metrics design & usage (#3346)
* comment polish and doc update Signed-off-by: shawnh2 <shawnhxh@outlook.com> * fix doc lint Signed-off-by: shawnh2 <shawnhxh@outlook.com> * revert go file changes Signed-off-by: shawnh2 <shawnhxh@outlook.com> * add eg cp metrics usage doc Signed-off-by: shawnh2 <shawnhxh@outlook.com> * update prometheus metrics usage doc Signed-off-by: shawnh2 <shawnhxh@outlook.com> --------- Signed-off-by: shawnh2 <shawnhxh@outlook.com>
- Loading branch information
Showing
8 changed files
with
208 additions
and
16 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
8 changes: 6 additions & 2 deletions
8
...tent/en/contributions/design/accesslog.md → ...n/contributions/design/proxy-accesslog.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
8 changes: 7 additions & 1 deletion
8
...ontent/en/contributions/design/metrics.md → .../en/contributions/design/proxy-metrics.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
2 changes: 1 addition & 1 deletion
2
...ontent/en/contributions/design/tracing.md → .../en/contributions/design/proxy-tracing.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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: "Observability: Tracing" | ||
title: "Data Plane Observability: Tracing" | ||
--- | ||
|
||
## Overview | ||
|
182 changes: 182 additions & 0 deletions
182
site/content/en/latest/tasks/observability/gateway-observability.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,182 @@ | ||
--- | ||
title: "Gateway Observability" | ||
--- | ||
|
||
Envoy Gateway provides observability for the ControlPlane and the underlying EnvoyProxy instances. | ||
This task show you how to config gateway control-plane observability, includes metrics. | ||
|
||
## Prerequisites | ||
|
||
Follow the steps from the [Quickstart](../quickstart) to install Envoy Gateway and the example manifest. | ||
Before proceeding, you should be able to query the example backend using HTTP. | ||
|
||
[OpenTelemetry Collector](https://opentelemetry.io/docs/collector/) offers a vendor-agnostic implementation of how to receive, process and export telemetry data. | ||
Install OTel-Collector: | ||
|
||
```shell | ||
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts | ||
helm repo update | ||
helm upgrade --install otel-collector open-telemetry/opentelemetry-collector -f https://raw.githubusercontent.com/envoyproxy/gateway/latest/examples/otel-collector/helm-values.yaml -n monitoring --create-namespace --version 0.60.0 | ||
``` | ||
|
||
## Metrics | ||
|
||
The default installation of Envoy Gateway installs a default [EnvoyGateway][] configuration and attaches it | ||
using a `ConfigMap`. In this section, we will update this resource to enable various ways to retrieve metrics | ||
from Envoy Gateway. | ||
|
||
### Retrieve Prometheus Metrics from Envoy Gateway | ||
|
||
By default, prometheus metric is enabled. You can directly retrieve metrics from Envoy Gateway: | ||
|
||
```shell | ||
export ENVOY_POD_NAME=$(kubectl get pod -n envoy-gateway-system --selector=control-plane=envoy-gateway,app.kubernetes.io/instance=eg -o jsonpath='{.items[0].metadata.name}') | ||
kubectl port-forward pod/$ENVOY_POD_NAME -n envoy-gateway-system 19001:19001 | ||
|
||
# check metrics | ||
curl localhost:19001/metrics | ||
``` | ||
|
||
The following is an example to disable prometheus metric for Envoy Gateway. | ||
|
||
{{< tabpane text=true >}} | ||
{{% tab header="Apply from stdin" %}} | ||
|
||
```shell | ||
cat <<EOF | kubectl apply -f - | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: envoy-gateway-config | ||
namespace: envoy-gateway-system | ||
data: | ||
envoy-gateway.yaml: | | ||
apiVersion: gateway.envoyproxy.io/v1alpha1 | ||
kind: EnvoyGateway | ||
provider: | ||
type: Kubernetes | ||
gateway: | ||
controllerName: gateway.envoyproxy.io/gatewayclass-controller | ||
telemetry: | ||
metrics: | ||
prometheus: | ||
disable: true | ||
EOF | ||
``` | ||
|
||
{{% /tab %}} | ||
{{% tab header="Apply from file" %}} | ||
Save and apply the following resource to your cluster: | ||
|
||
```yaml | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: envoy-gateway-config | ||
namespace: envoy-gateway-system | ||
data: | ||
envoy-gateway.yaml: | | ||
apiVersion: gateway.envoyproxy.io/v1alpha1 | ||
kind: EnvoyGateway | ||
provider: | ||
type: Kubernetes | ||
gateway: | ||
controllerName: gateway.envoyproxy.io/gatewayclass-controller | ||
telemetry: | ||
metrics: | ||
prometheus: | ||
disable: true | ||
``` | ||
{{% /tab %}} | ||
{{< /tabpane >}} | ||
After updating the `ConfigMap`, you will need to restart the `envoy-gateway` deployment so the configuration kicks in: | ||
|
||
```shell | ||
kubectl rollout restart deployment envoy-gateway -n envoy-gateway-system | ||
``` | ||
|
||
### Enable Open Telemetry sink in Envoy Gateway | ||
|
||
The following is an example to send metric via Open Telemetry sink to OTEL gRPC Collector. | ||
|
||
{{< tabpane text=true >}} | ||
{{% tab header="Apply from stdin" %}} | ||
|
||
```shell | ||
cat <<EOF | kubectl apply -f - | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: envoy-gateway-config | ||
namespace: envoy-gateway-system | ||
data: | ||
envoy-gateway.yaml: | | ||
apiVersion: gateway.envoyproxy.io/v1alpha1 | ||
kind: EnvoyGateway | ||
provider: | ||
type: Kubernetes | ||
gateway: | ||
controllerName: gateway.envoyproxy.io/gatewayclass-controller | ||
telemetry: | ||
metrics: | ||
sinks: | ||
- type: OpenTelemetry | ||
openTelemetry: | ||
host: otel-collector.monitoring.svc.cluster.local | ||
port: 4317 | ||
protocol: grpc | ||
EOF | ||
``` | ||
|
||
{{% /tab %}} | ||
{{% tab header="Apply from file" %}} | ||
Save and apply the following resource to your cluster: | ||
|
||
```yaml | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: envoy-gateway-config | ||
namespace: envoy-gateway-system | ||
data: | ||
envoy-gateway.yaml: | | ||
apiVersion: gateway.envoyproxy.io/v1alpha1 | ||
kind: EnvoyGateway | ||
provider: | ||
type: Kubernetes | ||
gateway: | ||
controllerName: gateway.envoyproxy.io/gatewayclass-controller | ||
telemetry: | ||
metrics: | ||
sinks: | ||
- type: OpenTelemetry | ||
openTelemetry: | ||
host: otel-collector.monitoring.svc.cluster.local | ||
port: 4317 | ||
protocol: grpc | ||
``` | ||
|
||
{{% /tab %}} | ||
{{< /tabpane >}} | ||
|
||
After updating the `ConfigMap`, you will need to restart the `envoy-gateway` deployment so the configuration kicks in: | ||
|
||
```shell | ||
kubectl rollout restart deployment envoy-gateway -n envoy-gateway-system | ||
``` | ||
|
||
Verify OTel-Collector metrics: | ||
|
||
```shell | ||
export OTEL_POD_NAME=$(kubectl get pod -n monitoring --selector=app.kubernetes.io/name=opentelemetry-collector -o jsonpath='{.items[0].metadata.name}') | ||
kubectl port-forward pod/$OTEL_POD_NAME -n monitoring 19001:19001 | ||
# check metrics | ||
curl localhost:19001/metrics | ||
``` | ||
|
||
[EnvoyGateway]: ../../api/extension_types#envoygateway |
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
Oops, something went wrong.