Skip to content

Commit

Permalink
Schema revisions (#5260)
Browse files Browse the repository at this point in the history
* fix schemas

Signed-off-by: Katherine Shen <katshen@amazon.com>
  • Loading branch information
shenkw1 authored and sbose2k21 committed Dec 13, 2024
1 parent 320a3d3 commit e7138ac
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class AggregateProcessorConfig {

@JsonPropertyDescription("An unordered list by which to group events. Events with the same values as these keys are put into the same group. " +
"If an event does not contain one of the <code>identification_keys</code>, then the value of that key is considered to be equal to <code>null</code>. " +
"At least one <code>identification_key</code> is required. And example configuration is [\"sourceIp\", \"destinationIp\", \"port\"].")
"At least one <code>identification_key</code> is required. An example configuration is [\"sourceIp\", \"destinationIp\", \"port\"].")
@JsonProperty("identification_keys")
@NotEmpty
@ExampleValues({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,44 @@

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonClassDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import org.opensearch.dataprepper.model.annotations.ExampleValues;
import org.opensearch.dataprepper.model.annotations.ExampleValues.Example;
import java.util.Collections;
import java.util.List;
import org.opensearch.dataprepper.plugins.lambda.common.config.InvocationType;
import org.opensearch.dataprepper.plugins.lambda.common.config.LambdaCommonConfig;

@JsonPropertyOrder
@JsonClassDescription("The <code>aws_lambda</code> processor enables invocation of an AWS Lambda function within your Data Prepper pipeline in order to process events." +
"It supports both synchronous and asynchronous invocations based on your use case.")
public class LambdaProcessorConfig extends LambdaCommonConfig {
static final String DEFAULT_INVOCATION_TYPE = "request-response";

@JsonPropertyDescription("invocation type defines the way we want to call lambda function")
@JsonProperty("invocation_type")
@JsonPropertyDescription("Specifies the invocation type, either <code>request-response</code> or <code>event</code>. Default is <code>request-response</code>.")
@JsonProperty(value = "invocation_type", defaultValue = DEFAULT_INVOCATION_TYPE)
private InvocationType invocationType = InvocationType.REQUEST_RESPONSE;

@JsonPropertyDescription("Defines the way Data Prepper treats the response from Lambda")
@JsonPropertyDescription("Specifies how Data Prepper interprets and processes Lambda function responses. Default is <code>false</code>.")
@JsonProperty("response_events_match")
private boolean responseEventsMatch = false;

@JsonPropertyDescription("defines a condition for event to use this processor")
@JsonProperty("lambda_when")
private String whenCondition;

@JsonProperty("tags_on_failure")
@JsonPropertyDescription(
"A <code>List</code> of <code>String</code>s that specifies the tags to be set in the event when lambda fails to "
+
"or exception occurs. This tag may be used in conditional expressions in " +
"other parts of the configuration")
"other parts of the configuration.")
private List<String> tagsOnFailure = Collections.emptyList();

@JsonPropertyDescription("Defines a condition for event to use this processor.")
@ExampleValues({
@Example(value = "event['status'] == 'process'", description = "The processor will only run on this condition.")
})
@JsonProperty("lambda_when")
private String whenCondition;

public List<String> getTagsOnFailure() {
return tagsOnFailure;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ public class KeyValueProcessorConfig {
})
private Object nonMatchValue = DEFAULT_NON_MATCH_VALUE;

@JsonProperty(value = "include_keys", defaultValue = "[]")
@JsonProperty("include_keys")
@JsonPropertyDescription("An array specifying the keys that should be included in the destination field. " +
"By default, all keys will be added.")
@NotNull
private List<String> includeKeys = DEFAULT_INCLUDE_KEYS;

@JsonProperty(value = "exclude_keys", defaultValue = "[]")
@JsonProperty("exclude_keys")
@JsonPropertyDescription("An array specifying the parsed keys that should be excluded from the destination field. " +
"By default, no keys will be excluded.")
@NotNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import io.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;
import io.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse;
import io.opentelemetry.proto.collector.metrics.v1.MetricsServiceGrpc;
import io.opentelemetry.proto.collector.trace.v1.TraceServiceGrpc;
import io.opentelemetry.proto.metrics.v1.NumberDataPoint;

import io.opentelemetry.proto.common.v1.InstrumentationLibrary;
Expand Down

0 comments on commit e7138ac

Please sign in to comment.