summaryrefslogtreecommitdiff
path: root/src/frontend-proxy/envoy.tmpl.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend-proxy/envoy.tmpl.yaml')
-rw-r--r--src/frontend-proxy/envoy.tmpl.yaml258
1 files changed, 258 insertions, 0 deletions
diff --git a/src/frontend-proxy/envoy.tmpl.yaml b/src/frontend-proxy/envoy.tmpl.yaml
new file mode 100644
index 0000000..79f9ce9
--- /dev/null
+++ b/src/frontend-proxy/envoy.tmpl.yaml
@@ -0,0 +1,258 @@
+# Copyright The OpenTelemetry Authors
+# SPDX-License-Identifier: Apache-2.0
+
+
+static_resources:
+ listeners:
+ - address:
+ socket_address:
+ address: 0.0.0.0
+ port_value: ${ENVOY_PORT}
+ filter_chains:
+ - filters:
+ - name: envoy.filters.network.http_connection_manager
+ typed_config:
+ "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
+ codec_type: AUTO
+ stat_prefix: ingress_http
+ tracing:
+ spawn_upstream_span: true
+ provider:
+ name: envoy.tracers.opentelemetry
+ typed_config:
+ "@type": type.googleapis.com/envoy.config.trace.v3.OpenTelemetryConfig
+ grpc_service:
+ envoy_grpc:
+ cluster_name: opentelemetry_collector_grpc
+ timeout: 0.250s
+ service_name: ${OTEL_SERVICE_NAME}
+ resource_detectors:
+ - name: envoy.tracers.opentelemetry.resource_detectors.environment
+ typed_config:
+ "@type": type.googleapis.com/envoy.extensions.tracers.opentelemetry.resource_detectors.v3.EnvironmentResourceDetectorConfig
+ route_config:
+ name: local_route
+ virtual_hosts:
+ - name: frontend
+ domains:
+ - "*"
+ routes:
+ - match: { path: "/loadgen" }
+ redirect: { path_redirect: "/loadgen/" }
+ - match: { prefix: "/loadgen/" }
+ route: { cluster: loadgen, prefix_rewrite: "/" }
+ - match: { prefix: "/otlp-http/" }
+ route: { cluster: opentelemetry_collector_http, prefix_rewrite: "/" }
+ - match: { path: "/jaeger" }
+ redirect: { path_redirect: "/jaeger/" }
+ - match: { prefix: "/jaeger/" }
+ route: { cluster: jaeger }
+ - match: { path: "/grafana" }
+ redirect: { path_redirect: "/grafana/" }
+ - match: { prefix: "/grafana/" }
+ route: { cluster: grafana }
+ - match: { prefix: "/images/" }
+ route: { cluster: image-provider, prefix_rewrite: "/" }
+ - match: { prefix: "/flagservice/" }
+ route: { cluster: flagservice, prefix_rewrite: "/", timeout: 0s }
+ - match: { prefix: "/feature" }
+ route:
+ cluster: flagd-ui
+ prefix_rewrite: "/"
+ upgrade_configs:
+ - upgrade_type: websocket
+ - match: { prefix: "/" } # Default/catch-all route - keep last since prefix:"/" matches everything
+ route: { cluster: frontend }
+ http_filters:
+ - name: envoy.filters.http.fault
+ typed_config:
+ "@type": type.googleapis.com/envoy.extensions.filters.http.fault.v3.HTTPFault
+ max_active_faults: 100
+ delay:
+ header_delay: {}
+ percentage:
+ numerator: 100
+ - name: envoy.filters.http.router
+ typed_config:
+ "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
+ access_log:
+ - name: envoy.access_loggers.open_telemetry
+ typed_config:
+ "@type": "type.googleapis.com/envoy.extensions.access_loggers.open_telemetry.v3.OpenTelemetryAccessLogConfig"
+ common_config:
+ log_name: "otel_envoy_access_log"
+ grpc_service:
+ envoy_grpc:
+ cluster_name: opentelemetry_collector_grpc
+ transport_api_version: "V3"
+ body:
+ # yamllint disable-line rule:line-length
+ string_value: "[%START_TIME%] \"%REQ(:METHOD)% %REQ(X-ENVOY-ORIGINAL-PATH?:PATH)% %PROTOCOL%\" %RESPONSE_CODE% %RESPONSE_FLAGS% %RESPONSE_CODE_DETAILS% %CONNECTION_TERMINATION_DETAILS% \"%UPSTREAM_TRANSPORT_FAILURE_REASON%\" %BYTES_RECEIVED% %BYTES_SENT% %DURATION% %RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)% \"%REQ(X-FORWARDED-FOR)%\" \"%REQ(USER-AGENT)%\" \"%REQ(X-REQUEST-ID)%\" \"%REQ(:AUTHORITY)%\" \"%UPSTREAM_HOST%\" %UPSTREAM_CLUSTER% %UPSTREAM_LOCAL_ADDRESS% %DOWNSTREAM_LOCAL_ADDRESS% %DOWNSTREAM_REMOTE_ADDRESS% %REQUESTED_SERVER_NAME% %ROUTE_NAME%\n"
+ resource_attributes:
+ values:
+ - key: "service.name"
+ value:
+ string_value: ${OTEL_SERVICE_NAME}
+ attributes:
+ values:
+ - key: "destination.address"
+ value:
+ string_value: "%UPSTREAM_REMOTE_ADDRESS_WITHOUT_PORT%"
+ - key: "event.name"
+ value:
+ string_value: "proxy.access"
+ - key: "server.address"
+ value:
+ string_value: "%DOWNSTREAM_LOCAL_ADDRESS%"
+ - key: "source.address"
+ value:
+ string_value: "%DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT%"
+ - key: "upstream.cluster"
+ value:
+ string_value: "%UPSTREAM_CLUSTER%"
+ - key: "upstream.host"
+ value:
+ string_value: "%UPSTREAM_HOST%"
+ - key: "user_agent.original"
+ value:
+ string_value: "%REQ(USER-AGENT)%"
+ - key: "url.full"
+ value:
+ string_value: "%REQ(:SCHEME)%://%REQ(:AUTHORITY)%%REQ(:PATH)%"
+ - key: "url.path"
+ value:
+ string_value: "%REQ(:PATH)%"
+ - key: "url.query"
+ value:
+ string_value: "%REQ(:QUERY)%"
+ - key: "url.template"
+ value:
+ string_value: "%ROUTE_NAME%"
+ clusters:
+ - name: opentelemetry_collector_grpc
+ type: STRICT_DNS
+ lb_policy: ROUND_ROBIN
+ typed_extension_protocol_options:
+ envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
+ "@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
+ explicit_http_config:
+ http2_protocol_options: {}
+ load_assignment:
+ cluster_name: opentelemetry_collector_grpc
+ endpoints:
+ - lb_endpoints:
+ - endpoint:
+ address:
+ socket_address:
+ address: ${OTEL_COLLECTOR_HOST}
+ port_value: ${OTEL_COLLECTOR_PORT_GRPC}
+ - name: opentelemetry_collector_http
+ type: STRICT_DNS
+ lb_policy: ROUND_ROBIN
+ load_assignment:
+ cluster_name: opentelemetry_collector_http
+ endpoints:
+ - lb_endpoints:
+ - endpoint:
+ address:
+ socket_address:
+ address: ${OTEL_COLLECTOR_HOST}
+ port_value: ${OTEL_COLLECTOR_PORT_HTTP}
+ - name: frontend
+ type: STRICT_DNS
+ lb_policy: ROUND_ROBIN
+ load_assignment:
+ cluster_name: frontend
+ endpoints:
+ - lb_endpoints:
+ - endpoint:
+ address:
+ socket_address:
+ address: ${FRONTEND_HOST}
+ port_value: ${FRONTEND_PORT}
+ - name: image-provider
+ type: STRICT_DNS
+ lb_policy: ROUND_ROBIN
+ load_assignment:
+ cluster_name: image-provider
+ endpoints:
+ - lb_endpoints:
+ - endpoint:
+ address:
+ socket_address:
+ address: ${IMAGE_PROVIDER_HOST}
+ port_value: ${IMAGE_PROVIDER_PORT}
+ - name: flagservice
+ type: STRICT_DNS
+ lb_policy: ROUND_ROBIN
+ load_assignment:
+ cluster_name: flagservice
+ endpoints:
+ - lb_endpoints:
+ - endpoint:
+ address:
+ socket_address:
+ address: ${FLAGD_HOST}
+ port_value: ${FLAGD_PORT}
+ - name: flagd-ui
+ type: STRICT_DNS
+ lb_policy: ROUND_ROBIN
+ load_assignment:
+ cluster_name: flagd-ui
+ endpoints:
+ - lb_endpoints:
+ - endpoint:
+ address:
+ socket_address:
+ address: ${FLAGD_UI_HOST}
+ port_value: ${FLAGD_UI_PORT}
+ - name: loadgen
+ type: STRICT_DNS
+ lb_policy: ROUND_ROBIN
+ load_assignment:
+ cluster_name: loadgen
+ endpoints:
+ - lb_endpoints:
+ - endpoint:
+ address:
+ socket_address:
+ address: ${LOCUST_WEB_HOST}
+ port_value: ${LOCUST_WEB_PORT}
+ - name: grafana
+ type: STRICT_DNS
+ lb_policy: ROUND_ROBIN
+ load_assignment:
+ cluster_name: grafana
+ endpoints:
+ - lb_endpoints:
+ - endpoint:
+ address:
+ socket_address:
+ address: ${GRAFANA_HOST}
+ port_value: ${GRAFANA_PORT}
+ - name: jaeger
+ type: STRICT_DNS
+ lb_policy: ROUND_ROBIN
+ load_assignment:
+ cluster_name: jaeger
+ endpoints:
+ - lb_endpoints:
+ - endpoint:
+ address:
+ socket_address:
+ address: ${JAEGER_HOST}
+ port_value: ${JAEGER_UI_PORT}
+admin:
+ address:
+ socket_address:
+ address: 0.0.0.0
+ port_value: ${ENVOY_ADMIN_PORT}
+layered_runtime:
+ layers:
+ - name: static_layer_0
+ static_layer:
+ envoy:
+ resource_limits:
+ listener:
+ example_listener_name:
+ connection_limit: 10000