Skip to content

Commit bcca2bc

Browse files
committed
Code review round 2
1 parent 694e813 commit bcca2bc

File tree

1 file changed

+17
-22
lines changed

1 file changed

+17
-22
lines changed

docs/proposals/gateway-settings.md

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -67,35 +67,32 @@ type GatewaySettings struct {
6767

6868
// Spec defines the desired state of the GatewaySettings.
6969
Spec GatewaySettingsSpec `json:"spec"`
70-
71-
// Status defines the state of the GatewaySettings.
72-
Status GatewaySettingsStatus `json:"status,omitempty"`
7370
}
7471

7572
type GatewaySettingsSpec struct {
76-
// OtelExporter specifies OpenTelemetry export parameters.
73+
// Telemetry specifies the OpenTelemetry configuration.
7774
// +optional
78-
OtelExporter *OtelExporter `json:"otelExporter,omitempty"`
75+
Telemetry *Telemetry `json:"telemetry,omitempty"`
76+
}
7977

80-
// OtelServiceName is the "service.name" attribute of the Otel resourc.
81-
// Default is 'nginx-gateway-fabric:<gateway-name>'.
78+
// Telemetry specifies the OpenTelemetry configuration.
79+
type Telemetry struct {
80+
// Exporter specifies OpenTelemetry export parameters.
8281
// +optional
83-
OtelServiceName *string `json:"otelServiceName,omitempty"`
82+
Exporter *Exporter `json:"exporter,omitempty"`
8483

85-
// OtelSpanAttributes are custom key/value attributes that are added to each span.
86-
// Variables can be included in the values.
84+
// ServiceName is the "service.name" attribute of the OpenTelemetry resource.
85+
// Default is 'nginx-gateway-fabric:<gateway-name>'.
8786
// +optional
88-
OtelSpanAttributes map[string]string `json:"otelSpanAttributes,omitempty"`
89-
}
87+
ServiceName *string `json:"serviceName,omitempty"`
9088

91-
type GatewaySettingsStatus struct {
92-
// Conditions describe the current conditions of the GatewaySettings.
89+
// SpanAttributes are custom key/value attributes that are added to each span.
9390
// +optional
94-
Conditions []metav1.Condition `json:"conditions,omitempty"`
91+
SpanAttributes map[string]string `json:"spanAttributes,omitempty"`
9592
}
9693

97-
// OtelExporter specifies OpenTelemetry export parameters.
98-
type OtelExporter struct {
94+
// Exporter specifies OpenTelemetry export parameters.
95+
type Exporter struct {
9996
// Interval is the maximum interval between two exports, by default is 5 seconds.
10097
// +optional
10198
Interval *Duration `json:"interval,omitempty"`
@@ -121,13 +118,11 @@ type Duration string
121118

122119
### Status
123120

124-
#### Conditions
125-
126-
The `Accepted` Condition must be populated on the `GatewaySettings` CRD using the reasons defined in the [PolicyCondition API](https://github.com/kubernetes-sigs/gateway-api/blob/main/apis/v1alpha2/policy_types.go). If these reasons are not sufficient, we can add implementation-specific reasons.
121+
#### GatewayClass
127122

128-
#### GatewayClass Status
123+
> Note: This is subject to change, will not merge until ironed out.
129124
130-
While this status does not officially exist, in order to be consistent with other resources with object refs we should add a custom `ResolvedRefs` Condition to the `GatewayClass` when the `parametersRef` is in use.
125+
In order to be consistent with other resources with object refs, we should add the `ResolvedRefs` Condition to the `GatewayClass` when the `parametersRef` is in use. If the `GatewaySettings` config is invalid, then the condition is set to `False` with a reason why.
131126

132127
NGINX Gateway Fabric must set this Condition on the GatewayClass affected by a `GatewaySettings`.
133128
Below is an example of what this Condition may look like:

0 commit comments

Comments
 (0)