Skip to content

Commit 547783d

Browse files
authored
chore(docs): Clarify when component received and sent bytes events should be emitted (#17464)
Also refactors the event lists so that they each have an `Emission` line. Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com> Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>
1 parent 1f54415 commit 547783d

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

docs/specs/component.md

+12-9
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ _All components_ MUST emit a `ComponentEventsReceived` event that represents
114114
the reception of Vector events from an upstream component.
115115

116116
- Emission
117-
- MUST emit immediately after creating or receiving Vector events.
117+
- MUST emit immediately after creating or receiving Vector events, before modification or metadata
118+
is added.
118119
- Properties
119120
- `count` - The count of Vector events.
120121
- `byte_size` - The estimated JSON byte size of all events received.
@@ -130,9 +131,11 @@ the reception of Vector events from an upstream component.
130131

131132
#### ComponentBytesReceived
132133

133-
*Sources* MUST emit a `ComponentBytesReceived` event immediately after receiving, decompressing
134-
and filtering bytes from the upstream source and before the creation of a Vector event.
134+
*Sources* MUST emit a `ComponentBytesReceived` event that represent the reception of bytes.
135135

136+
- Emission
137+
- MUST emit immediately after receiving, decompressing and filtering bytes from the upstream
138+
source and before the creation of a Vector event.
136139
- Properties
137140
- `byte_size`
138141
- For UDP, TCP, and Unix protocols, the total number of bytes received from
@@ -155,13 +158,13 @@ and filtering bytes from the upstream source and before the creation of a Vector
155158

156159
#### ComponentBytesSent
157160

158-
*Sinks* that send events downstream, MUST emit a `ComponentBytesSent` event immediately after
159-
sending bytes to the downstream target, if the transmission was successful. The reported bytes MUST
160-
be before compression.
161-
162-
Note that for sinks that simply expose data, but don't delete the data after
163-
sending it, like the `prometheus_exporter` sink, SHOULD NOT publish this metric.
161+
*Sinks* MUST emit a `ComponentBytesReceived` event that represent the transmission of bytes.
164162

163+
- Emission
164+
- MUST emit a `ComponentBytesSent` event immediately after sending bytes to the downstream target,
165+
if the transmission was successful. The reported bytes MUST be before compression.
166+
- Note that sinks that simply expose data, but don't delete the data after sending it, like the
167+
`prometheus_exporter` sink, SHOULD NOT emit this metric.
165168
- Properties
166169
- `byte_size`
167170
- For UDP, TCP, and Unix protocols, the total number of bytes placed on the

0 commit comments

Comments
 (0)