Skip to content

LISTENER_METADATA attribute path not being populated #42043

@kaih-w

Description

@kaih-w

Title: One line description
LISTENER_METADATA attribute path not being populated: while trying to populate tags for ingress metrics, accessing the LISTENER_METADATA path returns an empty object.

Description:
While trying to use a wasm filter to emit custom metrics, I am able to retrieve metadata from the CLUSTER_METADATA and ROUTE_METADATA paths, but when I try to do the same for the LISTENER_METADATA, I am returned an empty object.

Somewhere between Envoy version 1.29.12 (previously used version) and 1.34.4 (version we're trying to upgrade to), we're seeing that this attribute is no longer getting populated.

Repro steps:
Code snipped of path definitions:

pub(crate) const LISTENER_METADATA: Path<'static> = Path::from_slice(&[
    "xds",
    "listener_metadata",
    "filter_metadata",
    "aws.appmesh.aggregate_stats",
    "config",
]);

pub(crate) const CLUSTER_METADATA: Path<'static> = Path::from_slice(&[
    "xds",
    "cluster_metadata",
    "filter_metadata",
    "aws.appmesh.aggregate_stats",
    "config",
]);

pub(crate) const ROUTE_METADATA: Path<'static> = Path::from_slice(&[
    "xds",
    "route_metadata",
    "filter_metadata",
    "aws.appmesh.aggregate_stats",
    "config",
]);

Logs showing empty metadata:

[2025-11-14 19:15:03.354][21][info][main] [source/server/server.cc:734] Starting admin HTTP server at /tmp/envoy_admin.sock
[2025-11-14 19:15:03.354][21][info][admin] [source/server/admin/admin.cc:65] admin address: /tmp/envoy_admin.sock
[2025-11-14 19:15:03.355][21][info][config] [source/server/configuration_impl.cc:173] loading tracing configuration
[2025-11-14 19:15:03.355][21][info][config] [source/server/configuration_impl.cc:124] loading 0 static secret(s)
[2025-11-14 19:15:03.355][21][info][config] [source/server/configuration_impl.cc:130] loading 0 cluster(s)
[2025-11-14 19:15:03.357][21][info][config] [source/server/configuration_impl.cc:140] loading 0 listener(s)
[2025-11-14 19:15:03.357][21][info][config] [source/server/configuration_impl.cc:156] loading stats configuration
[2025-11-14 19:15:03.357][21][info][runtime] [source/common/runtime/runtime_impl.cc:555] RTDS has finished initialization
[2025-11-14 19:15:03.357][21][info][upstream] [source/common/upstream/cluster_manager_impl.cc:260] cm init: initializing cds
[2025-11-14 19:15:03.438][21][warning][main] [source/server/server.cc:970] There is no configured limit to the number of allowed active downstream connections. Configure a limit in `envoy.resource_monitors.global_downstream_max_connections` resource monitor.
[2025-11-14 19:15:03.438][21][info][main] [source/server/server.cc:1012] starting main dispatch loop
[2025-11-14 19:15:03.627][21][info][upstream] [source/common/upstream/cds_api_helper.cc:34] cds: response indicates 20 added/updated cluster(s), 0 removed cluster(s); applying changes
[2025-11-14 19:15:04.039][21][info][upstream] [source/common/upstream/cds_api_helper.cc:87] cds: added/updated 20 cluster(s) (skipped 0 unmodified cluster(s)); removed 0 cluster(s)
[2025-11-14 19:15:04.039][21][info][upstream] [source/common/upstream/cluster_manager_impl.cc:238] cm init: initializing secondary clusters
[2025-11-14 19:15:09.653][21][info][upstream] [source/common/upstream/cluster_manager_impl.cc:264] cm init: all clusters initialized
[2025-11-14 19:15:09.653][21][info][main] [source/server/server.cc:992] all clusters initialized. initializing init manager
[2025-11-14 19:15:09.661][21][debug][wasm] [source/extensions/common/wasm/wasm.cc:80] Base Wasm created 1 now active
[2025-11-14 19:15:11.244][21][debug][wasm] [source/extensions/common/wasm/wasm.cc:96] Thread-Local Wasm created 2 now active
[2025-11-14 19:15:11.245][21][debug][wasm] [source/extensions/common/wasm/wasm.cc:139] ~Wasm 1 remaining active
[2025-11-14 19:15:11.246][21][debug][wasm] [source/extensions/common/wasm/wasm.cc:96] Thread-Local Wasm created 2 now active
[2025-11-14 19:15:11.253][21][debug][wasm] [source/extensions/common/wasm/wasm.cc:96] Thread-Local Wasm created 3 now active
[2025-11-14 19:15:11.254][21][error][wasm] [source/extensions/common/wasm/context.cc:1143] wasm log: generate_stats: Starting to generate ingress HTTP stats
[2025-11-14 19:15:11.254][21][error][wasm] [source/extensions/common/wasm/context.cc:1143] wasm log: generate_stats: LISTENER_METADATA path = Path(Slice(["listener_metadata", "filter_metadata", "aws.appmesh.aggregate_stats", "config"]))
[2025-11-14 19:15:11.254][21][error][wasm] [source/extensions/common/wasm/context.cc:1143] wasm log: generate_stats: Attempting to read listener metadata
[2025-11-14 19:15:11.254][21][error][wasm] [source/extensions/common/wasm/context.cc:1143] wasm log: generate_stats: No listener metadata found - LISTENER_METADATA returned None
[2025-11-14 19:15:11.254][21][error][wasm] [source/extensions/common/wasm/context.cc:1143] wasm log: generate_stats: Creating stats with 0tags
[2025-11-14 19:15:11.254][21][debug][wasm] [source/extensions/common/wasm/wasm.cc:139] ~Wasm 2 remaining active

Envoy config where listener metadata is set.

"listener": {
              "@type": "type.googleapis.com/envoy.config.listener.v3.Listener",
              "name": "ingress-frontend-service-c431iv2j-ruhdo169",
              "address": {
                "socket_address": {
                  "address": "0.0.0.0",
                  "port_value": 35525
                }
              },
              "metadata": {
                "filter_metadata": {
                  "aws.appmesh.aggregate_stats": {
                    "config": "{\"tags\":[{\"key\":\"ClusterName\",\"value\":\"cluster-c431iv2j-ruhdo169\"},{\"key\":\"ServiceName\",\"value\":\"test-tls-frontend-service-c431iv2j-ruhdo169\"},{\"key\":\"DiscoveryName\",\"value\":\"frontend-service-c431iv2j-ruhdo169\"},{\"key\":\"Direction\",\"value\":\"ingress\"}]}"
                  }
                }
              }, 

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugtriageIssue requires triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions