From c08a4036f9b9460503f898e5ee22ab4bd21c199b Mon Sep 17 00:00:00 2001 From: Adil Hafeez Date: Fri, 15 Nov 2024 10:08:00 -0800 Subject: [PATCH 1/5] Add additional tags Signed-off-by: Adil Hafeez --- jaeger-tracing/envoy.yaml | 28 ++++++++++++++++++++++++++++ jaeger-tracing/example.rst | 2 ++ 2 files changed, 30 insertions(+) diff --git a/jaeger-tracing/envoy.yaml b/jaeger-tracing/envoy.yaml index 02cd1b87..54cb8a5f 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..a19aac13 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 show how you can use custom_tags to to attach additional tags to the spans. + Step 1: Build the sandbox ************************* From 37bbd75c123230fdf427fe28fd85657d0de48ef7 Mon Sep 17 00:00:00 2001 From: Adil Hafeez Date: Fri, 15 Nov 2024 10:23:37 -0800 Subject: [PATCH 2/5] update rst Signed-off-by: Adil Hafeez --- jaeger-tracing/example.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jaeger-tracing/example.rst b/jaeger-tracing/example.rst index a19aac13..f1c965cb 100644 --- a/jaeger-tracing/example.rst +++ b/jaeger-tracing/example.rst @@ -36,7 +36,7 @@ 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 show how you can use custom_tags to to attach additional tags to the spans. +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 spans. Step 1: Build the sandbox ************************* From 0a81d68364fde0ae6ab40fb71e4dbe0eb50c5f4c Mon Sep 17 00:00:00 2001 From: Adil Hafeez Date: Fri, 15 Nov 2024 10:26:07 -0800 Subject: [PATCH 3/5] fix lint Signed-off-by: Adil Hafeez --- jaeger-tracing/envoy.yaml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/jaeger-tracing/envoy.yaml b/jaeger-tracing/envoy.yaml index 54cb8a5f..9e558871 100644 --- a/jaeger-tracing/envoy.yaml +++ b/jaeger-tracing/envoy.yaml @@ -25,23 +25,23 @@ static_resources: 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 + - 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 From bfa2d647413f3c17d9452f8fcb48e1998b2f1e41 Mon Sep 17 00:00:00 2001 From: Adil Hafeez Date: Fri, 15 Nov 2024 10:28:27 -0800 Subject: [PATCH 4/5] Apply suggestions from code review Signed-off-by: Adil Hafeez --- jaeger-tracing/example.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jaeger-tracing/example.rst b/jaeger-tracing/example.rst index f1c965cb..f3f3ef3d 100644 --- a/jaeger-tracing/example.rst +++ b/jaeger-tracing/example.rst @@ -36,7 +36,7 @@ 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 spans. +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 activate span. Step 1: Build the sandbox ************************* From b9722f91283ed6a21bedf03271f30a9ee0a6b3d9 Mon Sep 17 00:00:00 2001 From: Adil Hafeez Date: Fri, 15 Nov 2024 10:58:09 -0800 Subject: [PATCH 5/5] Update jaeger-tracing/example.rst Co-authored-by: phlax Signed-off-by: Adil Hafeez --- jaeger-tracing/example.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jaeger-tracing/example.rst b/jaeger-tracing/example.rst index f3f3ef3d..53916984 100644 --- a/jaeger-tracing/example.rst +++ b/jaeger-tracing/example.rst @@ -36,7 +36,7 @@ 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 activate span. +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 *************************