contour
contour copied to clipboard
How can I convert unit millisecond to seconds in access log
I want to customize access log , convert %DURATION% and %RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)% millisecond unit to seconds unit. Is there anyway to do it ?
json-fields:
- "request_time=%DURATION%"
- "upstream_response_time=%RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)%"
Use seconds unit in access log
There are some guidelines on this page for converting an operator like %DURATION%
to a different unit: https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log/usage#command-operators (see the section about customizing %START_TIME%
)
I'm not entirely sure you can do the same with a value grabbed from a request/response header, but worth a try
There are some guidelines on this page for converting an operator like
%DURATION%
to a different unit: https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log/usage#command-operators (see the section about customizing%START_TIME%
)I'm not entirely sure you can do the same with a value grabbed from a request/response header, but worth a try
I try format like below, but report not support.
"request_time=%DURATION(%s.%3f)%"
access log: time="2022-09-17T02:11:16Z" level=error msg="Error adding/updating listener(s) ingress_http: Not supported field in StreamInfo: DURATION(%s.%3f)\n" code=13 connection=134 context=xds node_id=envoy-sc62c node_version=v1.19.1 response_nonce=1 version_info=2
The Contour project currently lacks enough contributors to adequately respond to all Issues.
This bot triages Issues according to the following rules:
- After 60d of inactivity, lifecycle/stale is applied
- After 30d of inactivity since lifecycle/stale was applied, the Issue is closed
You can:
- Mark this Issue as fresh by commenting
- Close this Issue
- Offer to help out with triage
Please send feedback to the #contour channel in the Kubernetes Slack
The Contour project currently lacks enough contributors to adequately respond to all Issues.
This bot triages Issues according to the following rules:
- After 60d of inactivity, lifecycle/stale is applied
- After 30d of inactivity since lifecycle/stale was applied, the Issue is closed
You can:
- Mark this Issue as fresh by commenting
- Close this Issue
- Offer to help out with triage
Please send feedback to the #contour channel in the Kubernetes Slack