Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show how to set custom_tags for tracing #293

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions jaeger-tracing/envoy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions jaeger-tracing/example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 spans.
adilhafeez marked this conversation as resolved.
Show resolved Hide resolved

Step 1: Build the sandbox
*************************

Expand Down