Skip to content

Commit

Permalink
api: access log types (envoyproxy#4170)
Browse files Browse the repository at this point in the history
* api: access log scopes

Signed-off-by: Guy Daich <[email protected]>

* renaming and merging all route types

Signed-off-by: Guy Daich <[email protected]>

* fix pointer

Signed-off-by: Guy Daich <[email protected]>

* explain behavior, rm backend log type

Signed-off-by: Guy Daich <[email protected]>

* change how types impact scope

Signed-off-by: Guy Daich <[email protected]>

---------

Signed-off-by: Guy Daich <[email protected]>
  • Loading branch information
guydc authored Sep 25, 2024
1 parent d667f2c commit 77c042c
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 0 deletions.
22 changes: 22 additions & 0 deletions api/v1alpha1/accesslogging_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,30 @@ type ProxyAccessLogSetting struct {
// +kubebuilder:validation:MinItems=1
// +kubebuilder:validation:MaxItems=50
Sinks []ProxyAccessLogSink `json:"sinks"`
// Type defines the component emitting the accesslog, such as Listener and Route.
// If type not defined, the setting would apply to:
// (1) All Routes.
// (2) Listeners if and only if Envoy does not find a matching route for a request.
// If type is defined, the accesslog settings would apply to the relevant component (as-is).
// +kubebuilder:validation:Enum=Listener;Route
// +optional
// +notImplementedHide
Type *ProxyAccessLogType `json:"type,omitempty"`
}

type ProxyAccessLogType string

const (
// ProxyAccessLogTypeListener defines the accesslog for Listeners.
// https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/listener/v3/listener.proto#envoy-v3-api-field-config-listener-v3-listener-access-log
ProxyAccessLogTypeListener ProxyAccessLogType = "Listener"
// ProxyAccessLogTypeRoute defines the accesslog for HTTP, GRPC, UDP and TCP Routes.
// https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/udp/udp_proxy/v3/udp_proxy.proto#envoy-v3-api-field-extensions-filters-udp-udp-proxy-v3-udpproxyconfig-access-log
// https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/network/tcp_proxy/v3/tcp_proxy.proto#envoy-v3-api-field-extensions-filters-network-tcp-proxy-v3-tcpproxy-access-log
// https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto#envoy-v3-api-field-extensions-filters-network-http-connection-manager-v3-httpconnectionmanager-access-log
ProxyAccessLogTypeRoute ProxyAccessLogType = "Route"
)

type ProxyAccessLogFormatType string

const (
Expand Down
5 changes: 5 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -12255,6 +12255,17 @@ spec:
maxItems: 50
minItems: 1
type: array
type:
description: |-
Type defines the component emitting the accesslog, such as Listener and Route.
If type not defined, the setting would apply to:
(1) All Routes.
(2) Listeners if and only if Envoy does not find a matching route for a request.
If type is defined, the accesslog settings would apply to the relevant component (as-is).
enum:
- Listener
- Route
type: string
required:
- sinks
type: object
Expand Down
15 changes: 15 additions & 0 deletions site/content/en/latest/api/extension_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -2955,6 +2955,21 @@ _Appears in:_
| `OpenTelemetry` | ProxyAccessLogSinkTypeOpenTelemetry defines the OpenTelemetry accesslog sink.<br />When the provider is Kubernetes, EnvoyGateway always sends `k8s.namespace.name`<br />and `k8s.pod.name` as additional attributes.<br /> |


#### ProxyAccessLogType

_Underlying type:_ _string_



_Appears in:_
- [ProxyAccessLogSetting](#proxyaccesslogsetting)

| Value | Description |
| ----- | ----------- |
| `Listener` | ProxyAccessLogTypeListener defines the accesslog for Listeners.<br />https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/listener/v3/listener.proto#envoy-v3-api-field-config-listener-v3-listener-access-log<br /> |
| `Route` | ProxyAccessLogTypeRoute defines the accesslog for HTTP, GRPC, UDP and TCP Routes.<br />https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/udp/udp_proxy/v3/udp_proxy.proto#envoy-v3-api-field-extensions-filters-udp-udp-proxy-v3-udpproxyconfig-access-log<br />https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/network/tcp_proxy/v3/tcp_proxy.proto#envoy-v3-api-field-extensions-filters-network-tcp-proxy-v3-tcpproxy-access-log<br />https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto#envoy-v3-api-field-extensions-filters-network-http-connection-manager-v3-httpconnectionmanager-access-log<br /> |


#### ProxyBootstrap


Expand Down
15 changes: 15 additions & 0 deletions site/content/zh/latest/api/extension_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -2955,6 +2955,21 @@ _Appears in:_
| `OpenTelemetry` | ProxyAccessLogSinkTypeOpenTelemetry defines the OpenTelemetry accesslog sink.<br />When the provider is Kubernetes, EnvoyGateway always sends `k8s.namespace.name`<br />and `k8s.pod.name` as additional attributes.<br /> |


#### ProxyAccessLogType

_Underlying type:_ _string_



_Appears in:_
- [ProxyAccessLogSetting](#proxyaccesslogsetting)

| Value | Description |
| ----- | ----------- |
| `Listener` | ProxyAccessLogTypeListener defines the accesslog for Listeners.<br />https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/listener/v3/listener.proto#envoy-v3-api-field-config-listener-v3-listener-access-log<br /> |
| `Route` | ProxyAccessLogTypeRoute defines the accesslog for HTTP, GRPC, UDP and TCP Routes.<br />https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/udp/udp_proxy/v3/udp_proxy.proto#envoy-v3-api-field-extensions-filters-udp-udp-proxy-v3-udpproxyconfig-access-log<br />https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/network/tcp_proxy/v3/tcp_proxy.proto#envoy-v3-api-field-extensions-filters-network-tcp-proxy-v3-tcpproxy-access-log<br />https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto#envoy-v3-api-field-extensions-filters-network-http-connection-manager-v3-httpconnectionmanager-access-log<br /> |


#### ProxyBootstrap


Expand Down

0 comments on commit 77c042c

Please sign in to comment.