Skip to content

Commit 9078cbe

Browse files
authored
Minor changes on FlowMetrics doc (#2025)
1 parent 1339c41 commit 9078cbe

File tree

6 files changed

+28
-23
lines changed

6 files changed

+28
-23
lines changed

api/flowmetrics/v1alpha1/flowmetric_types.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const (
4343
)
4444

4545
type MetricFilter struct {
46-
// Name of the field to filter on
46+
// Name of the field to filter on (for example: `SrcK8S_Namespace`).
4747
// +required
4848
Field string `json:"field"`
4949

@@ -63,7 +63,7 @@ type MetricFilter struct {
6363
// usage of Prometheus workloads as this could potentially have a high impact. Cf https://rhobs-handbook.netlify.app/products/openshiftmonitoring/telemetry.md/#what-is-the-cardinality-of-a-metric<br>
6464
// To check the cardinality of all NetObserv metrics, run as `promql`: `count({__name__=~"netobserv.*"}) by (__name__)`.
6565
type FlowMetricSpec struct {
66-
// Name of the metric. In Prometheus, it is automatically prefixed with "netobserv_".
66+
// Name of the metric. In Prometheus, it is automatically prefixed with "netobserv_". Leave empty to generate the name based on the `FlowMetric` resource name.
6767
// +kubebuilder:validation:Pattern:="^[a-zA-Z_][a-zA-Z0-9:_]*$|^$"
6868
// +optional
6969
MetricName string `json:"metricName"`
@@ -72,11 +72,11 @@ type FlowMetricSpec struct {
7272
// Use "Counter" for any value that increases over time and on which you can compute a rate, such as Bytes or Packets.
7373
// Use "Histogram" for any value that must be sampled independently, such as latencies.
7474
// Use "Gauge" for other values that don't necessitate accuracy over time (gauges are sampled only every N seconds when Prometheus fetches the metric).
75-
// +kubebuilder:validation:Enum:="Counter";"Histogram"
75+
// +kubebuilder:validation:Enum:="Counter";"Histogram";"Gauge"
7676
// +required
7777
Type MetricType `json:"type"`
7878

79-
// `valueField` is the flow field that must be used as a value for this metric. This field must hold numeric values.
79+
// `valueField` is the flow field that must be used as a value for this metric (for example: `Bytes`). This field must hold numeric values.
8080
// Leave empty to count flows rather than a specific value per flow.
8181
// Refer to the documentation for the list of available fields: https://docs.redhat.com/en/documentation/openshift_container_platform/latest/html/network_observability/json-flows-format-reference.
8282
// +optional
@@ -87,7 +87,7 @@ type FlowMetricSpec struct {
8787
// +optional
8888
Filters []MetricFilter `json:"filters"`
8989

90-
// `labels` is a list of fields that should be used as Prometheus labels, also known as dimensions.
90+
// `labels` is a list of fields that should be used as Prometheus labels, also known as dimensions (for example: `SrcK8S_Namespace`).
9191
// From choosing labels results the level of granularity of this metric, and the available aggregations at query time.
9292
// It must be done carefully as it impacts the metric cardinality (cf https://rhobs-handbook.netlify.app/products/openshiftmonitoring/telemetry.md/#what-is-the-cardinality-of-a-metric).
9393
// In general, avoid setting very high cardinality labels such as IP or MAC addresses.

bundle/manifests/flows.netobserv.io_flowmetrics.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ spec:
162162
items:
163163
properties:
164164
field:
165-
description: Name of the field to filter on
165+
description: 'Name of the field to filter on (for example: `SrcK8S_Namespace`).'
166166
type: string
167167
matchType:
168168
default: Equal
@@ -194,7 +194,7 @@ spec:
194194
type: array
195195
labels:
196196
description: |-
197-
`labels` is a list of fields that should be used as Prometheus labels, also known as dimensions.
197+
`labels` is a list of fields that should be used as Prometheus labels, also known as dimensions (for example: `SrcK8S_Namespace`).
198198
From choosing labels results the level of granularity of this metric, and the available aggregations at query time.
199199
It must be done carefully as it impacts the metric cardinality (cf https://rhobs-handbook.netlify.app/products/openshiftmonitoring/telemetry.md/#what-is-the-cardinality-of-a-metric).
200200
In general, avoid setting very high cardinality labels such as IP or MAC addresses.
@@ -205,7 +205,8 @@ spec:
205205
type: array
206206
metricName:
207207
description: Name of the metric. In Prometheus, it is automatically
208-
prefixed with "netobserv_".
208+
prefixed with "netobserv_". Leave empty to generate the name based
209+
on the `FlowMetric` resource name.
209210
pattern: ^[a-zA-Z_][a-zA-Z0-9:_]*$|^$
210211
type: string
211212
remap:
@@ -225,10 +226,11 @@ spec:
225226
enum:
226227
- Counter
227228
- Histogram
229+
- Gauge
228230
type: string
229231
valueField:
230232
description: |-
231-
`valueField` is the flow field that must be used as a value for this metric. This field must hold numeric values.
233+
`valueField` is the flow field that must be used as a value for this metric (for example: `Bytes`). This field must hold numeric values.
232234
Leave empty to count flows rather than a specific value per flow.
233235
Refer to the documentation for the list of available fields: https://docs.redhat.com/en/documentation/openshift_container_platform/latest/html/network_observability/json-flows-format-reference.
234236
type: string

bundle/manifests/netobserv-operator.clusterserviceversion.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ metadata:
253253
categories: Monitoring, Networking, Observability
254254
console.openshift.io/plugins: '["netobserv-plugin"]'
255255
containerImage: quay.io/netobserv/network-observability-operator:1.9.2-community
256-
createdAt: "2025-09-18T08:50:21Z"
256+
createdAt: "2025-09-24T14:09:38Z"
257257
description: Network flows collector and monitoring solution
258258
operatorframework.io/initialization-resource: '{"apiVersion":"flows.netobserv.io/v1beta2",
259259
"kind":"FlowCollector","metadata":{"name":"cluster"},"spec": {}}'

config/crd/bases/flows.netobserv.io_flowmetrics.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ spec:
162162
items:
163163
properties:
164164
field:
165-
description: Name of the field to filter on
165+
description: 'Name of the field to filter on (for example: `SrcK8S_Namespace`).'
166166
type: string
167167
matchType:
168168
default: Equal
@@ -194,7 +194,7 @@ spec:
194194
type: array
195195
labels:
196196
description: |-
197-
`labels` is a list of fields that should be used as Prometheus labels, also known as dimensions.
197+
`labels` is a list of fields that should be used as Prometheus labels, also known as dimensions (for example: `SrcK8S_Namespace`).
198198
From choosing labels results the level of granularity of this metric, and the available aggregations at query time.
199199
It must be done carefully as it impacts the metric cardinality (cf https://rhobs-handbook.netlify.app/products/openshiftmonitoring/telemetry.md/#what-is-the-cardinality-of-a-metric).
200200
In general, avoid setting very high cardinality labels such as IP or MAC addresses.
@@ -205,7 +205,8 @@ spec:
205205
type: array
206206
metricName:
207207
description: Name of the metric. In Prometheus, it is automatically
208-
prefixed with "netobserv_".
208+
prefixed with "netobserv_". Leave empty to generate the name based
209+
on the `FlowMetric` resource name.
209210
pattern: ^[a-zA-Z_][a-zA-Z0-9:_]*$|^$
210211
type: string
211212
remap:
@@ -225,10 +226,11 @@ spec:
225226
enum:
226227
- Counter
227228
- Histogram
229+
- Gauge
228230
type: string
229231
valueField:
230232
description: |-
231-
`valueField` is the flow field that must be used as a value for this metric. This field must hold numeric values.
233+
`valueField` is the flow field that must be used as a value for this metric (for example: `Bytes`). This field must hold numeric values.
232234
Leave empty to count flows rather than a specific value per flow.
233235
Refer to the documentation for the list of available fields: https://docs.redhat.com/en/documentation/openshift_container_platform/latest/html/network_observability/json-flows-format-reference.
234236
type: string

docs/FlowMetric.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Use "Counter" for any value that increases over time and on which you can comput
100100
Use "Histogram" for any value that must be sampled independently, such as latencies.
101101
Use "Gauge" for other values that don't necessitate accuracy over time (gauges are sampled only every N seconds when Prometheus fetches the metric).<br/>
102102
<br/>
103-
<i>Enum</i>: Counter, Histogram<br/>
103+
<i>Enum</i>: Counter, Histogram, Gauge<br/>
104104
</td>
105105
<td>true</td>
106106
</tr><tr>
@@ -156,7 +156,7 @@ For instance, when flattening `Interfaces` on a bytes counter, a flow having Int
156156
<td><b>labels</b></td>
157157
<td>[]string</td>
158158
<td>
159-
`labels` is a list of fields that should be used as Prometheus labels, also known as dimensions.
159+
`labels` is a list of fields that should be used as Prometheus labels, also known as dimensions (for example: `SrcK8S_Namespace`).
160160
From choosing labels results the level of granularity of this metric, and the available aggregations at query time.
161161
It must be done carefully as it impacts the metric cardinality (cf https://rhobs-handbook.netlify.app/products/openshiftmonitoring/telemetry.md/#what-is-the-cardinality-of-a-metric).
162162
In general, avoid setting very high cardinality labels such as IP or MAC addresses.
@@ -168,7 +168,7 @@ Refer to the documentation for the list of available fields: https://docs.redhat
168168
<td><b>metricName</b></td>
169169
<td>string</td>
170170
<td>
171-
Name of the metric. In Prometheus, it is automatically prefixed with "netobserv_".<br/>
171+
Name of the metric. In Prometheus, it is automatically prefixed with "netobserv_". Leave empty to generate the name based on the `FlowMetric` resource name.<br/>
172172
</td>
173173
<td>false</td>
174174
</tr><tr>
@@ -182,7 +182,7 @@ Refer to the documentation for the list of available fields: https://docs.redhat
182182
<td><b>valueField</b></td>
183183
<td>string</td>
184184
<td>
185-
`valueField` is the flow field that must be used as a value for this metric. This field must hold numeric values.
185+
`valueField` is the flow field that must be used as a value for this metric (for example: `Bytes`). This field must hold numeric values.
186186
Leave empty to count flows rather than a specific value per flow.
187187
Refer to the documentation for the list of available fields: https://docs.redhat.com/en/documentation/openshift_container_platform/latest/html/network_observability/json-flows-format-reference.<br/>
188188
</td>
@@ -330,7 +330,7 @@ To learn more about `promQL`, refer to the Prometheus documentation: https://pro
330330
<td><b>field</b></td>
331331
<td>string</td>
332332
<td>
333-
Name of the field to filter on<br/>
333+
Name of the field to filter on (for example: `SrcK8S_Namespace`).<br/>
334334
</td>
335335
<td>true</td>
336336
</tr><tr>

helm/crds/flows.netobserv.io_flowmetrics.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ spec:
152152
items:
153153
properties:
154154
field:
155-
description: Name of the field to filter on
155+
description: 'Name of the field to filter on (for example: `SrcK8S_Namespace`).'
156156
type: string
157157
matchType:
158158
default: Equal
@@ -182,7 +182,7 @@ spec:
182182
type: array
183183
labels:
184184
description: |-
185-
`labels` is a list of fields that should be used as Prometheus labels, also known as dimensions.
185+
`labels` is a list of fields that should be used as Prometheus labels, also known as dimensions (for example: `SrcK8S_Namespace`).
186186
From choosing labels results the level of granularity of this metric, and the available aggregations at query time.
187187
It must be done carefully as it impacts the metric cardinality (cf https://rhobs-handbook.netlify.app/products/openshiftmonitoring/telemetry.md/#what-is-the-cardinality-of-a-metric).
188188
In general, avoid setting very high cardinality labels such as IP or MAC addresses.
@@ -192,7 +192,7 @@ spec:
192192
type: string
193193
type: array
194194
metricName:
195-
description: Name of the metric. In Prometheus, it is automatically prefixed with "netobserv_".
195+
description: Name of the metric. In Prometheus, it is automatically prefixed with "netobserv_". Leave empty to generate the name based on the `FlowMetric` resource name.
196196
pattern: ^[a-zA-Z_][a-zA-Z0-9:_]*$|^$
197197
type: string
198198
remap:
@@ -210,10 +210,11 @@ spec:
210210
enum:
211211
- Counter
212212
- Histogram
213+
- Gauge
213214
type: string
214215
valueField:
215216
description: |-
216-
`valueField` is the flow field that must be used as a value for this metric. This field must hold numeric values.
217+
`valueField` is the flow field that must be used as a value for this metric (for example: `Bytes`). This field must hold numeric values.
217218
Leave empty to count flows rather than a specific value per flow.
218219
Refer to the documentation for the list of available fields: https://docs.redhat.com/en/documentation/openshift_container_platform/latest/html/network_observability/json-flows-format-reference.
219220
type: string

0 commit comments

Comments
 (0)