Skip to content
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

Remove code tags from processor names, fill in default values #5278

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@
@JsonClassDescription("The anomaly detector processor takes structured data and runs anomaly detection algorithms " +
"on fields that you can configure in that data.")
public class AnomalyDetectorProcessorConfig {
@JsonPropertyDescription("A non-ordered List<String> that is used as input to the ML algorithm to detect anomalies in the values of the keys in the list. At least one key is required.")
@JsonProperty("keys")
@NotEmpty
private List<String> keys;

@JsonPropertyDescription("The ML algorithm (or model) used to detect anomalies. You must provide a mode. See random_cut_forest mode.")
@JsonProperty("mode")
@NotNull
@UsesDataPrepperPlugin(pluginType = AnomalyDetectorMode.class)
private PluginModel detectorMode;

@JsonPropertyDescription("A non-ordered List<String> that is used as input to the ML algorithm to detect anomalies in the values of the keys in the list. At least one key is required.")
@JsonProperty("keys")
@NotEmpty
private List<String> keys;

@JsonPropertyDescription("If provided, anomalies will be detected within each unique instance of these keys. For example, if you provide the ip field, anomalies will be detected separately for each unique IP address.")
@JsonProperty("identification_keys")
@ExampleValues({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.util.HashSet;

public class RandomCutForestModeConfig {
public static final String DEFAULT_TYPE = "metrics";
public static final int DEFAULT_SHINGLE_SIZE = 4;
private static final int MIN_SHINGLE_SIZE = 1;
public static final int MAX_SHINGLE_SIZE = 60;
Expand All @@ -27,31 +28,31 @@ public class RandomCutForestModeConfig {
public static final String VERSION_1_0 = "1.0";

@JsonPropertyDescription("The algorithm version number. Default is 1.0.")
@JsonProperty("version")
@JsonProperty(value = "version", defaultValue = VERSION_1_0)
private String version = VERSION_1_0;

public static final Set<String> validVersions = new HashSet<>(Set.of(VERSION_1_0));

@JsonPropertyDescription("The type of data sent to the algorithm. Default is metrics type")
@JsonProperty("type")
@JsonProperty(value = "type", defaultValue = DEFAULT_TYPE)
private String type = RandomCutForestType.METRICS.toString();

public static final Set<String> validTypes = new HashSet<>(Set.of(RandomCutForestType.METRICS.toString()));

@JsonPropertyDescription("The shingle size used in the ML algorithm. Default is 60.")
@JsonProperty("shingle_size")
@JsonPropertyDescription("The shingle size used in the ML algorithm. Default is 4.")
@JsonProperty(value = "shingle_size", defaultValue = "" + DEFAULT_SHINGLE_SIZE)
private int shingleSize = DEFAULT_SHINGLE_SIZE;

@JsonPropertyDescription("The sample size used in the ML algorithm. Default is 256.")
@JsonProperty("sample_size")
@JsonProperty(value = "sample_size", defaultValue = "" + DEFAULT_SAMPLE_SIZE)
private int sampleSize = DEFAULT_SAMPLE_SIZE;

@JsonPropertyDescription("The time decay value used in the ML algorithm. Used as the mathematical expression timeDecay divided by SampleSize in the ML algorithm. Default is 0.1")
@JsonProperty("time_decay")
@JsonProperty(value = "time_decay", defaultValue = "" + DEFAULT_TIME_DECAY)
private double timeDecay = DEFAULT_TIME_DECAY;

@JsonPropertyDescription("Output after indicates the number of events to consume before outputting anamolies. Default is 32.")
@JsonProperty("output_after")
@JsonPropertyDescription("Output after indicates the number of events to consume before outputting anomalies. Default is 32.")
@JsonProperty(value = "output_after", defaultValue = "" + DEFAULT_OUTPUT_AFTER)
private int outputAfter = DEFAULT_OUTPUT_AFTER;

@AssertTrue(message = "Value of output_after must be less than or equal to the value of sample_size")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
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." +
@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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public static boolean isValidPattern(final String pattern) {
})
private List<DateMatch> match;

@JsonProperty("destination")
@JsonProperty(value = "destination", defaultValue = DEFAULT_DESTINATION)
@JsonPropertyDescription("The field used to store the timestamp parsed by the date processor. " +
"Can be used with both <code>match</code> and <code>from_time_received</code>. Default is <code>@timestamp</code>.")
private String destination = DEFAULT_DESTINATION;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ public static class Entry {
@NotEmpty
@NotNull
@JsonProperty("from_key")
@JsonPropertyDescription("The key of the entry to be copied.")
@JsonPropertyDescription("The key of the entry to be copied. Either <code>from_key</code> and " +
"<code>to_key</code> or <code>from_list</code> and <code>to_list</code> must be defined.")
private String fromKey;

@NotEmpty
@NotNull
@JsonProperty("to_key")
@JsonPropertyDescription("The key of the new entry to be added.")
@JsonPropertyDescription("The key of the new entry to be added. Either <code>from_key</code> and " +
"<code>to_key</code> or <code>from_list</code> and <code>to_list</code> must be defined.")
private String toKey;

@JsonProperty("overwrite_if_to_key_exists")
Expand Down Expand Up @@ -86,14 +88,16 @@ public Entry() {
private List<Entry> entries;

@JsonProperty(FROM_LIST_KEY)
@JsonPropertyDescription("The key of the list of objects to be copied. <code>to_list</code> must also be defined.")
@JsonPropertyDescription("The key of the list of objects to be copied. Either <code>from_key</code> and " +
"<code>to_key</code> or <code>from_list</code> and <code>to_list</code> must be defined.")
@AlsoRequired(values = {
@AlsoRequired.Required(name = TO_LIST_KEY)
})
private String fromList;

@JsonProperty(TO_LIST_KEY)
@JsonPropertyDescription("The key of the new list to be added. <code>from_list</code> must also be defined.")
@JsonPropertyDescription("The key of the new list to be added. Either <code>from_key</code> and " +
"<code>to_key</code> or <code>from_list</code> and <code>to_list</code> must be defined.")
@AlsoRequired(values = {
@AlsoRequired.Required(name = FROM_LIST_KEY)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.util.List;

@JsonPropertyOrder
@JsonClassDescription("The <code>obfuscate</code> process enables obfuscation of fields inside your documents in order to " +
@JsonClassDescription("The <code>obfuscate</code> processor enables obfuscation of fields inside your documents in order to " +
"protect sensitive data.")
public class ObfuscationProcessorConfig {

Expand Down
Loading