Skip to content

Commit 4020bd2

Browse files
authored
Merge pull request #5188 from npinaeva/observ-docs
[docs] update ovn-observability with some more details
2 parents 03c3e5f + f559df1 commit 4020bd2

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

docs/observability/ovn-observability.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,11 @@ No API changes were done.
6868
### OVN sampling details
6969

7070
OVN has 3 main db tables that are used for sampling:
71-
- `Sample_collector`: This table is used to define the sampling collector. It defines the sampling rate and collectorID,
72-
which is used to set up collectors in the OVS.
71+
- `Sample_collector`: This table is used to define the sampling collector. It defines the sampling rate via `Probability` field
72+
and collectorID via `SetID` field, which is used to set up collectors in the OVS.
7373
- `Sampling_app`: This table is used to set `ID`s for existing OVN sampling applications, that are sent together with the samples.
74+
There is a supported set of `Sampling_app` types, for example `acl-new` app is used to sample new connections matched by an ACL.
75+
`Sampling_app.ID` is a way to identify the application that generated the sample.
7476
- `Sample`: This table is used to define required samples and point to the collectors.
7577
Every sample has `Metadata` that is sent together with the sample.
7678

@@ -84,15 +86,21 @@ that is decoded by `go-controller/observability-lib`.
8486
When one of the supported objects (for example, network policy) is created, ovn-kuberentes generates an nbdb `Sample` for it.
8587

8688
To decode the samples into human-readable information, `go-controller/observability-lib` is used. It finds `Sample`
87-
by the attached `Sample.Metadata` and then gets corresponding db object based on `Sampling_add.ID` and `Sample.UUID`.
88-
The message is then constructed using db object `external_ids`.
89-
90-
### Full stack architecture
89+
by the attached `Sample.Metadata` and then gets corresponding db object (e.g. ACL) based on `Sampling_app.ID` and `Sample.UUID`.
90+
The message is then constructed using db object (e.g. ACL) `external_ids`.
9191

9292
![ovnkube-observ](../images/ovnkube-observ.png)
9393

9494
The diagram shows how all involved components (kernel, OVS, OVN, ovn-kubernetes) are connected.
9595

96+
#### Enabling collectors
97+
98+
Currently, we have only 1 default collector with hard-coded ID, which is set via the `Sample_collector.SetID` field.
99+
To make OVS start sending samples for an existing `Sample_collector`, a new OVSDB `Flow_Sample_Collector_Set` entry
100+
needs to be created with `Flow_Sample_Collector_Set.ID` value of `Sample_collector.SetID`.
101+
This is done by the `go-controller/observability-lib` and it is important to note that only one `Flow_Sample_Collector_Set`
102+
should be created for a given `Sample_collector.SetID` value at a time. But if such entry already exists, it can be reused.
103+
96104
## Best Practices
97105

98106
TDB
@@ -126,6 +134,9 @@ This applies to
126134

127135
in both cases ANP will have only first-packet sample.
128136

137+
Use caution when running the `ovnkube-observe` tool. Currently it has poor resource management and consumes a lot of
138+
CPU when many packets are sent. Tracked here https://github.com/ovn-kubernetes/ovn-kubernetes/issues/5203
139+
129140
## References
130141

131142
NONE

0 commit comments

Comments
 (0)