diff --git a/jaeger-tracing/envoy.yaml b/jaeger-tracing/envoy.yaml index 02cd1b87..9e558871 100644 --- a/jaeger-tracing/envoy.yaml +++ b/jaeger-tracing/envoy.yaml @@ -23,6 +23,26 @@ static_resources: collector_endpoint: "/api/v2/spans" shared_span_context: false collector_endpoint_version: HTTP_JSON + + custom_tags: + - tag: tag_literal + literal: + value: literal value + - tag: tag_request_header + request_header: + name: ":path" + - tag: tag_env_hostname + environment: + name: "HOSTNAME" + - tag: tag_metadata + metadata: + kind: + request: {} + metadata_key: + key: custom_tag + path: + - key: tag_metadata + codec_type: AUTO stat_prefix: ingress_http route_config: @@ -39,6 +59,14 @@ static_resources: decorator: operation: checkAvailability http_filters: + - name: envoy.filters.http.lua + typed_config: + '@type': type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua + default_source_code: + inline_string: | + function envoy_on_request(response_handle) + response_handle:streamInfo():dynamicMetadata():set("custom_tag", "tag_metadata", "hello from lua") + end - name: envoy.filters.http.router typed_config: "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router diff --git a/jaeger-tracing/example.rst b/jaeger-tracing/example.rst index 0c387ba3..53916984 100644 --- a/jaeger-tracing/example.rst +++ b/jaeger-tracing/example.rst @@ -36,6 +36,8 @@ calls to other services. In the sandbox we have provided, the simple ``aiohttp`` (see trace function in :download:`examples/shared/python/tracing/service.py <_include/shared/python/tracing/service.py>`) acting as service1 propagates the trace headers while making an outbound call to service2. +This demo also shows how you can use ``custom_tags`` to to attach additional tags of type literal, request header, environment and metadata to the active span. + Step 1: Build the sandbox *************************