Documentation
Introduction
Configuration
- HTTPProxy Fundamentals
- Gateway API Support
- Ingress v1 Support
- Virtual Hosts
- Inclusion and Delegation
- TLS Termination
- Upstream TLS
- Request Routing
- External Service Routing
- Request Rewriting
- CORS
- Websockets
- Upstream Health Checks
- Client Authorization
- TLS Delegation
- Rate Limiting
- Access logging
- Cookie Rewriting
- Overload Manager
- JWT Verification
- IP Filtering
- Annotations Reference
- Slow Start Mode
- Tracing Support
- API Reference
Deployment
- Deployment Options
- Contour Configuration
- Upgrading Contour
- Enabling TLS between Envoy and Contour
- Redeploy Envoy
Guides
- Deploying Contour on AWS with NLB
- AWS Network Load Balancer TLS Termination with Contour
- Deploying HTTPS services with Contour and cert-manager
- External Authorization Support
- FIPS 140-2 in Contour
- Using Gatekeeper with Contour
- Using Gateway API with Contour
- Global Rate Limiting
- Configuring ingress to gRPC services with Contour
- Health Checking
- Creating a Contour-compatible kind cluster
- Collecting Metrics with Prometheus
- How to Configure PROXY Protocol v1/v2 Support
- Contour/Envoy Resource Limits
Troubleshooting
- Envoy Administration Access
- Contour Debug Logging
- Envoy Debug Logging
- Visualize the Contour Graph
- Show Contour xDS Resources
- Profiling Contour
- Envoy Container Stuck in Unready State
Resources
- Support Policy
- Compatibility Matrix
- Contour Deprecation Policy
- Release Process
- Frequently Asked Questions
- Tagging
Security
Contribute
Tracing Support
Overview
Envoy has rich support for distributed tracing,and supports exporting data to third-party providers (Zipkin, Jaeger, Datadog, etc.)
OpenTelemetry is a CNCF project which is working to become a standard in the space. It was formed as a merger of the OpenTracing and OpenCensus projects.
Contour supports configuring envoy to export data to OpenTelemetry, and allows users to customize some configurations.
- Custom service name, the default is
contour
. - Custom sampling rate, the default is
100
. - Custom the maximum length of the request path, the default is
256
. - Customize span tags from literal or request headers.
- Customize whether to include the pod’s hostname and namespace.
Tracing-config
In order to use this feature, you must first select and deploy an opentelemetry-collector to receive the tracing data exported by envoy.
First we should deploy an opentelemetry-collector to receive the tracing data exported by envoy
# install operator
kubectl apply -f https://github.com/open-telemetry/opentelemetry-operator/releases/latest/download/opentelemetry-operator.yaml
Install an otel collector instance, with verbose logging exporter enabled:
kubectl apply -f - <<EOF
apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryCollector
metadata:
name: simplest
namespace: projectcontour
spec:
config: |
receivers:
otlp:
protocols:
grpc:
http:
exporters:
logging:
verbosity: detailed
service:
pipelines:
traces:
receivers: [otlp]
exporters: [logging]
EOF
Define extension service:
kubectl apply -f - <<EOF
apiVersion: projectcontour.io/v1alpha1
kind: ExtensionService
metadata:
name: otel-collector
namespace: projectcontour
spec:
protocol: h2c
services:
- name: simplest-collector
port: 4317
EOF
Update Contour config (needs a Contour deployment restart afterwards):
kubectl apply -f - <<EOF
apiVersion: v1
kind: ConfigMap
metadata:
name: contour
namespace: projectcontour
data:
contour.yaml: |
tracing:
# Whether to send the namespace and instance where envoy is located to open, the default is true.
includePodDetail: true
# The extensionService and namespace and name defined above in the format of namespace/name.
extensionService: projectcontour/otel-collector
# The service name that envoy sends to openTelemetry-collector, the default is contour.
serviceName: some-service-name
# A custom set of tags.
customTags:
# envoy will send the tagName to the collector.
- tagName: custom-tag
# fixed tag value.
literal: foo
- tagName: header-tag
# The tag value obtained from the request header,
# if the request header does not exist, this tag will not be sent.
requestHeaderName: X-Custom-Header
EOF
Install httpbin and test it:
kubectl apply -f https://projectcontour.io/examples/httpbin.yaml
Access the api and view the logs of simplest:
kubectl logs deploy/simplest-collector -n projectcontour
Now you should be able to see traces in the logs of the otel collector.