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

Enable to specify annotations property on segment_fields for type.googleapis.com/envoy.config.trace.v3.XRayConfig #35147

Closed
y-isono opened this issue Jul 11, 2024 · 6 comments
Labels
area/tracing enhancement Feature requests. Not bugs or questions. stale stalebot believes this issue/PR has not been touched recently

Comments

@y-isono
Copy link

y-isono commented Jul 11, 2024

Title: Enable to specify annotations property on segment_fields for type.googleapis.com/envoy.config.trace.v3.XRayConfig

Description:
It seems that only origin or aws property can be specified on segment_fields or type.googleapis.com/envoy.config.trace.v3.XRayConfig[1]-[2] now so we would be happy if we can specify annotations on segment_fields[3].

[1]

message SegmentFields {
// The type of AWS resource, e.g. "AWS::AppMesh::Proxy".
string origin = 1;
// AWS resource metadata dictionary.
// See: `X-Ray Segment Document documentation <https://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html#api-segmentdocuments-aws>`__
google.protobuf.Struct aws = 2;
}

[2] https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/trace/v3/xray.proto#extension-envoy-tracers-xray

[3] Use the X-Ray API - Explore the X-Ray API - https://docs.aws.amazon.com/xray/latest/devguide/aws-xray-interface-api.html#xray-api

X-Ray segment documents
・・・
Annotations
・・・
  "aws": {
    "ec2": {
      "availability_zone": "us-west-2c",
      "instance_id": "i-0b5a4678fc325bg98"
    },
    "xray": {
        "sdk_version": "2.11.0 for Java"
    },
  },
  "annotations": {
    "customer_category" : 124,
    "zip_code" : 98101,
    "country" : "United States",
    "internal" : false
  },
@y-isono y-isono added enhancement Feature requests. Not bugs or questions. triage Issue requires triage labels Jul 11, 2024
@nezdolik nezdolik added area/tracing and removed triage Issue requires triage labels Jul 11, 2024
@nezdolik
Copy link
Member

cc @suniltheta @mattklein123

@nbaws
Copy link
Contributor

nbaws commented Jul 14, 2024

i'll take a look at this one

@nbaws
Copy link
Contributor

nbaws commented Jul 18, 2024

@y-isono The xray tracer will add custom tags as annotations, as well as some other related metadata as annotations. Documentation for configuring custom tags can be found here https://www.envoyproxy.io/docs/envoy/latest/api-v3/type/tracing/v3/custom_tag.proto#envoy-v3-api-msg-type-tracing-v3-customtag

Here is an xray trace I generated, with a single custom tag added:

{
    "Id": "1-6698980d-e829ae270ab34b69b488b098",
    "Duration": 0.016,
    "LimitExceeded": false,
    "Segments": [
        {
            "Id": "15d65e5ced8dfe76",
            "Document": {
                "id": "15d65e5ced8dfe76",
                "name": "envoyfe-test",
                "start_time": 1721276429.410355,
                "trace_id": "1-6698980d-e829ae270ab34b69b488b098",
                "end_time": 1721276429.426068,
                "fault": true,
                "http": {
                    "request": {
                        "url": "http://app2.application.internal/app1",
                        "method": "GET",
                        "user_agent": "curl/8.5.0",
                        "client_ip": "127.0.0.1",
                        "x_forwarded_for": false
                    },
                    "response": {
                        "status": 503,
                        "content_length": 216
                    }
                },
                "aws": {},
                "annotations": {
                    "response_flags": "UF",
                    "component": "proxy",
                    "upstream_cluster": "outbound_proxy",
                    "custom1": "testing",
                    "http.protocol": "HTTP/1.1",
                    "request_size": "0",
                    "downstream_cluster": "-",
                    "direction": "ingress",
                    "upstream_cluster.name": "outbound_proxy"
                }
            }
        }
    ]
}

The custom tag is added using the following configuration (trimmed)

  - name: http_connect
    address:
      socket_address:
        protocol: TCP
        address: 0.0.0.0
        port_value: 8099
    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
          stat_prefix: ingress_http
          tracing:
            custom_tags:
              tag: custom1
              literal:
                value: testing
          route_config:
            name: local_route

Given that this took me scouring the source code to work out the behaviour, I think a documentation improvement is in order. I'll add some supporting documentation and you can see if that assists in configuration.

@nbaws
Copy link
Contributor

nbaws commented Jul 24, 2024

Copy link

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label Aug 24, 2024
Copy link

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tracing enhancement Feature requests. Not bugs or questions. stale stalebot believes this issue/PR has not been touched recently
Projects
None yet
Development

No branches or pull requests

3 participants