-
Notifications
You must be signed in to change notification settings - Fork 902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update LogRecord batching processor behavior description #4409
base: main
Are you sure you want to change the base?
Changes from 7 commits
bb2add8
0b10e27
fe114f8
dea0d32
3fc4784
86aaf01
eb7868f
73500cb
8c22ecc
63df65c
3173b33
e929a07
85e53ef
b59eb0f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -421,6 +421,20 @@ representations to the configured `LogRecordExporter`. | |
The processor MUST synchronize calls to `LogRecordExporter`'s `Export` | ||
to make sure that they are not invoked concurrently. | ||
|
||
The processor SHOULD export a batch when any of the following happens AND the | ||
previous export call has returned: | ||
|
||
- `scheduledDelayMillis` after the processor is constructed OR the first `LogRecord` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Why export when first record is received 🤔 ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that the original author meant "delay after first record'. Probably this could be clarified, but I do not feel it has to be done in this PR. |
||
is received by the log record processor. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why would we want to have the 2nd part? Asking this question more coming from "why do we want to have complex rules instead of simple rules".
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was bringing this documentation in line with how the trace batching processor describes behaviour. I'm happy to make changes (with direction) in this PR or could there be another issue to address this part of the specification for both logs and trace batching? My original issue was with environment variables not referring back to related parts of the SDKs, and us finding this "missing" content for logs is extras that have been suggested as improvements. Typical case of the more you look, the more you find :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see that you were trying to get the spec from Trace and copy it to Log. But IMHO, the trace section itself is not very clear. (I am sure I have discussed this before, but not able to find that discussion anymore!!) https://github.com/open-telemetry/opentelemetry-specification/pull/4409/files#r1968141138 - This comment has my suggested wording for both trace/log. See if it is simpler and yet conveys the full intent. |
||
- `scheduledDelayMillis` after the previous export timer ends, OR the previous | ||
export completes, OR the first `LogRecord` is added to the queue after the previous | ||
export timer ends or previous batch completes. | ||
- The queue contains `maxExportBatchSize` or more `LogRecord`s. | ||
- `ForceFlush` is called. | ||
JDUNNIN marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
If the queue is empty when an export is triggered, the processor MAY export | ||
an empty batch OR skip the export and consider it to be completed immediately. | ||
|
||
**Configurable parameters:** | ||
|
||
* `exporter` - the exporter where the `LogRecord`s are pushed. | ||
|
@@ -431,7 +445,9 @@ to make sure that they are not invoked concurrently. | |
* `exportTimeoutMillis` - how long the export can run before it is cancelled. | ||
The default value is `30000`. | ||
* `maxExportBatchSize` - the maximum batch size of every export. It must be | ||
smaller or equal to `maxQueueSize`. The default value is `512`. | ||
smaller or equal to `maxQueueSize`. If the queue reaches `maxExportBatchSize` | ||
a batch will be exported even if `scheduledDelayMillis` milliseconds have not | ||
elapsed. The default value is `512`. | ||
pellared marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## LogRecordExporter | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Batching processor
This is an implementation of the
LogRecordProcessor
which create batchesof
LogRecord
s and passes the export-friendlyReadableLogRecord
representations to the configured
LogRecordExporter
.The processor MUST synchronize calls to
LogRecordExporter
'sExport
to make sure that they are not invoked concurrently.
A batch SHOULD be exported when any of the following conditions are met:
If the queue is empty when an export is triggered, the processor MAY either export an empty batch or skip the export and consider it complete immediately.
^Wording suggestion.
Additional notes from implementing this:
I don't think the spec has explicitly clarified the following, so I went with my own interpretations!
Or
T, T+e1+d, T+e2+2d... where e1,e2 represents the time take for the export itself