envoyproxy / envoyproxy/gateway

Output service name in gateway access logs

Open
#7,712 7 comments 3 reactions 0 assignees View on GitHub
area/observability stale
Dominant language
Go
Stars
3k
Forks
864
Avg merge
2d 2h
Merged PRs (30d)
140

Description

*Description*:
I am facing an issue where I cannot output the upstream service name in gateway access logs which will help me understand the traffic flow a lot better. There's no out of the box command operators that I can use to get the expected output. Closest thing will be `%UPSTREAM_HOST_NAME%` however this only outputs the pod IP and port as there is no dns solution locally within the kubernetes cluster.

In nginx ingress im able to use `$proxy_upstream_name` which is - name of the upstream. The format is `$namespace-$servicename-$service-port`. I'm hoping i can do something similar using envoy.

envoy proxy config:

```
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyProxy
spec:
telemetry:
accessLog:
settings:
- format:
json:
duration: '%DURATION%'
host: '%UPSTREAM_HOST_NAME%'
timestamp: '%START_TIME%'
type: JSON
sinks:
- file:
path: /dev/stdout
type: File
```

gateway log output:

```
envoy {"duration":2,"host":"10.0.0.1:8080","timestamp":"2025-12-10T10:38:29.162Z"}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.