-
Notifications
You must be signed in to change notification settings - Fork 202
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
Support otel_logs codec in S3 source (#5028) #5030
Support otel_logs codec in S3 source (#5028) #5030
Conversation
Signed-off-by: Daniel Li <[email protected]>
Signed-off-by: Daniel Li <[email protected]>
Signed-off-by: Daniel Li <[email protected]>
Signed-off-by: Daniel Li <[email protected]>
import java.util.function.Consumer; | ||
|
||
@DataPrepperPlugin(name = "opentelemetry_logs", pluginType = InputCodec.class) | ||
public class OTLPJsonLogsCodec extends OTLPJsonLogsDecoder implements InputCodec { |
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.
Can you rename this to OTelLogsCodec
? What was the reason for Json
in the name?
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.
Renamed it to OTelLogsInputCodec
.
import java.io.InputStream; | ||
import java.util.function.Consumer; | ||
|
||
@DataPrepperPlugin(name = "opentelemetry_logs", pluginType = InputCodec.class) |
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.
Maybe this should be otel_json_logs
or otel_logs_json
?
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.
Changed it to otel_logs
.
Signed-off-by: Daniel Li <[email protected]>
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.
Thank you @danhli . I have a few comments to help with documentation.
* Configuration class for {@link OTelLogsInputCodec}. | ||
*/ | ||
public class OTelLogsInputCodecConfig { | ||
static final String JSON_FORMAT = "json"; |
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.
This should be an enum
. It will help with our auto-generated schema and documentation.
I've submitted a few PRs to correct these, such as #5025 and #5035.
Please see these:
This is where it is used:
Lines 129 to 133 in 6e51f51
@JsonProperty("whitespace") | |
@JsonPropertyDescription("Specifies whether to be lenient or strict with the acceptance of " + | |
"unnecessary white space surrounding the configured value-split sequence. " + | |
"In this case, strict means that whitespace is trimmed and lenient means it is retained in the key name and in the value." + | |
"Default is <code>lenient</code>.") |
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.
Added OTelLogsFormatOption
.
/** | ||
* Configuration class for {@link OTelLogsInputCodec}. | ||
*/ | ||
public class OTelLogsInputCodecConfig { |
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.
Please add documentation:
See an example:
Lines 19 to 20 in 6e51f51
@JsonPropertyOrder | |
@JsonClassDescription("The <code>flatten</code> processor transforms nested objects inside of events into flattened structures.") |
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.
Done
static final String JSON_FORMAT = "json"; | ||
|
||
@JsonProperty("format") | ||
private String format = JSON_FORMAT; |
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.
Please add documentation:
Examples:
Lines 129 to 135 in 6e51f51
@JsonProperty("whitespace") | |
@JsonPropertyDescription("Specifies whether to be lenient or strict with the acceptance of " + | |
"unnecessary white space surrounding the configured value-split sequence. " + | |
"In this case, strict means that whitespace is trimmed and lenient means it is retained in the key name and in the value." + | |
"Default is <code>lenient</code>.") | |
@NotNull | |
private WhitespaceOption whitespace = DEFAULT_WHITESPACE; |
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.
Done
…t#5028) Signed-off-by: Daniel Li <[email protected]>
@dlvenable I have completed the documentation and enum changes. Please review. |
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.
Thank you @danhli for this great contribution!
Description
Add a new codec option,
otel_logs
, in S3 source. With this option, OTLP JSON files can be ingested and processed natively, similar to ingesting through http endpoint using otel_logs_source.Issues Resolved
Resolves #5028
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.