Skip to content

Commit

Permalink
remove code tags from processor names in descriptions, add missing de…
Browse files Browse the repository at this point in the history
…fault values

Signed-off-by: Katherine Shen <[email protected]>
  • Loading branch information
shenkw1 committed Dec 23, 2024
1 parent 708843c commit bc04bd1
Show file tree
Hide file tree
Showing 33 changed files with 54 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.util.List;

@JsonPropertyOrder
@JsonClassDescription("The <code>aggregate</code> processor groups events based on the values of identification_keys. " +
@JsonClassDescription("The aggregate processor groups events based on the values of identification_keys. " +
"Then, the processor performs an action on each group, helping reduce unnecessary log volume and " +
"creating aggregated logs over time.")
public class AggregateProcessorConfig {
Expand Down
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 AWS Lambda 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 @@ -21,7 +21,7 @@
*/

@JsonPropertyOrder
@JsonClassDescription("The <code>csv</code> processor parses comma-separated values (CSVs) strings into structured data.")
@JsonClassDescription("The CSV processor parses comma-separated values (CSVs) strings into structured data.")
public class CsvProcessorConfig {
static final String DEFAULT_SOURCE = "message";
static final String DEFAULT_DELIMITER = ",";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
)
})
@JsonPropertyOrder
@JsonClassDescription("The <code>date</code> processor adds a default timestamp to an event, parses timestamp fields, " +
@JsonClassDescription("The date processor adds a default timestamp to an event, parses timestamp fields, " +
"and converts timestamp information to the International Organization for Standardization (ISO) 8601 format. " +
"This timestamp information can be used as an event timestamp.")
public class DateProcessorConfig {
Expand Down 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 @@ -20,7 +20,7 @@
import java.util.List;

@JsonPropertyOrder
@JsonClassDescription("The <code>decompress</code> processor decompresses any Base64-encoded " +
@JsonClassDescription("The decompress processor decompresses any Base64-encoded " +
"compressed fields inside of an event.")
public class DecompressProcessorConfig {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import java.util.stream.Collectors;

@JsonPropertyOrder
@JsonClassDescription("The <code>dissect</code> processor extracts values from an event and maps them to individual fields " +
@JsonClassDescription("The dissect processor extracts values from an event and maps them to individual fields " +
"based on user-defined <code>dissect</code> patterns. The processor is well suited for field extraction from log " +
"messages with a known structure.")
public class DissectProcessorConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import org.opensearch.dataprepper.model.event.HandleFailedEventsOption;

@JsonPropertyOrder
@JsonClassDescription("The <code>drop_events</code> processor conditionally drops events.")
@JsonClassDescription("The drop events processor conditionally drops events.")
public class DropEventProcessorConfig {

@JsonPropertyDescription("A <a href=\"https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/\">conditional expression</a> such as <code>/log_type == \"DEBUG\"</code>. " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.util.List;

@JsonPropertyOrder
@JsonClassDescription("The <code>flatten</code> processor transforms nested objects inside of events into flattened structures.")
@JsonClassDescription("The flatten processor transforms nested objects inside of events into flattened structures.")
public class FlattenProcessorConfig {
static final String REMOVE_LIST_INDICES_KEY = "remove_list_indices";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* An implementation class of GeoIP Processor configuration
*/
@JsonPropertyOrder
@JsonClassDescription("The <code>geoip</code> processor enriches events with geographic information extracted from IP addresses " +
@JsonClassDescription("The geoip processor enriches events with geographic information extracted from IP addresses " +
"contained in the events.")
public class GeoIPProcessorConfig {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import java.util.Map;

@JsonPropertyOrder
@JsonClassDescription("The <code>grok</code> processor uses pattern matching to structure and extract important keys from " +
@JsonClassDescription("The grok processor uses pattern matching to structure and extract important keys from " +
"unstructured data.")
public class GrokProcessorConfig {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.util.Map;

@JsonPropertyOrder
@JsonClassDescription("You can use the <code>key_value</code> processor to create structured data by parsing key-value pairs from strings.")
@JsonClassDescription("You can use the key-value processor to create structured data by parsing key-value pairs from strings.")
public class KeyValueProcessorConfig {
static final String VALUE_GROUPING_KEY = "value_grouping";
static final String FIELD_DELIMITER_REGEX_KEY = "field_delimiter_regex";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
)
})
@JsonPropertyOrder
@JsonClassDescription("The <code>add_entries</code> processor adds entries to an event.")
@JsonClassDescription("The add entries processor adds entries to an event.")
public class AddEntryProcessorConfig {
static final String VALUE_EXPRESSION_KEY = "value_expression";
static final String METADATA_KEY_KEY = "metadata_key";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
)
})
@JsonPropertyOrder
@JsonClassDescription("The <code>convert_type</code> processor converts a value associated with the specified key in " +
@JsonClassDescription("The convert type processor converts a value associated with the specified key in " +
"a event to the specified type. It is a casting processor that changes the types of specified fields in events.")
public class ConvertEntryTypeProcessorConfig implements ConverterArguments {
static final String KEY_KEY = "key";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.util.List;

@JsonPropertyOrder
@JsonClassDescription("The <code>copy_values</code> processor copies values within an event to other fields within the event.")
@JsonClassDescription("The copy values processor copies values within an event to other fields within the event.")
public class CopyValueProcessorConfig {
static final String FROM_LIST_KEY = "from_list";
static final String TO_LIST_KEY = "to_list";
Expand All @@ -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 @@ -20,7 +20,7 @@
import java.util.List;

@JsonPropertyOrder
@JsonClassDescription("The <code>delete_entries</code> processor deletes fields from events. " +
@JsonClassDescription("The delete entries processor deletes fields from events. " +
"You can define the keys you want to delete in the <code>with_keys</code> configuration. " +
"Those keys and their values are deleted from events.")
public class DeleteEntryProcessorConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
)
})
@JsonPropertyOrder
@JsonClassDescription("The <code>list_to_map</code> processor converts a list of objects from an event, " +
@JsonClassDescription("The list to map processor converts a list of objects from an event, " +
"where each object contains a <code>key</code> field, into a map of target keys.")
public class ListToMapProcessorConfig {
public enum FlattenedElement {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import java.util.List;

@JsonPropertyOrder
@JsonClassDescription("The <code>map_to_list</code> processor converts a map of key-value pairs to a list of objects. " +
@JsonClassDescription("The map to list processor converts a map of key-value pairs to a list of objects. " +
"Each object contains the key and value in separate fields.")
public class MapToListProcessorConfig {
private static final String DEFAULT_KEY_NAME = "key";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.regex.Pattern;

@JsonPropertyOrder
@JsonClassDescription("The <code>rename_keys</code> processor renames keys in an event.")
@JsonClassDescription("The rename keys processor renames keys in an event.")
public class RenameKeyProcessorConfig {
@JsonPropertyOrder
public static class Entry {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import java.util.List;

@JsonPropertyOrder
@JsonClassDescription("The <code>select_entries</code> processor selects entries from an event.")
@JsonClassDescription("The select entries processor selects entries from an event.")
public class SelectEntriesProcessorConfig {
@NotEmpty
@NotNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import java.util.List;

@JsonPropertyOrder
@JsonClassDescription("The <code>replace_string</code> processor replaces all occurrence of substring in key’s value with a " +
@JsonClassDescription("The replace string processor replaces all occurrence of substring in key’s value with a " +
"replacement string.")
public class ReplaceStringProcessorConfig implements StringProcessorConfig<ReplaceStringProcessorConfig.Entry> {
@JsonPropertyOrder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
)
})
@JsonPropertyOrder
@JsonClassDescription("The <code>split_string</code> processor splits a field into an array using a delimiting character.")
@JsonClassDescription("The split string processor splits a field into an array using a delimiting character.")
public class SplitStringProcessorConfig implements StringProcessorConfig<SplitStringProcessorConfig.Entry> {
@JsonPropertyOrder
public static class Entry {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import java.util.List;

@JsonPropertyOrder
@JsonClassDescription("The <code>substitute_string</code> processor matches a key’s value against a regular expression and " +
@JsonClassDescription("The substitute string processor matches a key’s value against a regular expression and " +
"replaces all matches with a replacement string.")
public class SubstituteStringProcessorConfig implements StringProcessorConfig<SubstituteStringProcessorConfig.Entry> {
@JsonPropertyOrder
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 obfuscate processor enables obfuscation of fields inside your documents in order to " +
"protect sensitive data.")
public class ObfuscationProcessorConfig {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import com.fasterxml.jackson.annotation.JsonPropertyOrder;

@JsonPropertyOrder
@JsonClassDescription("The <code>otel_metrics</code> processor serializes a collection of <code>ExportMetricsServiceRequest</code> records " +
@JsonClassDescription("The OTel metrics processor serializes a collection of <code>ExportMetricsServiceRequest</code> records " +
"sent from the <a href=\"https://opensearch.org/docs/latest/data-prepper/pipelines/configuration/sources/otel-metrics-source/\">OTel metrics source</a> into a collection of string records.")
public class OtelMetricsRawProcessorConfig {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import java.time.Duration;

@JsonPropertyOrder
@JsonClassDescription("The <code>otel_traces</code> processor completes trace-group-related fields in all incoming " +
@JsonClassDescription("The OTel traces processor completes trace-group-related fields in all incoming " +
"span records by state caching the root span information for each <code>traceId</code>.")
public class OtelTraceRawProcessorConfig {
static final long DEFAULT_TG_FLUSH_INTERVAL_SEC = 180L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
)
})
@JsonPropertyOrder
@JsonClassDescription("The <code>split_event</code> processor is used to split events based on a delimiter and " +
@JsonClassDescription("The split event processor is used to split events based on a delimiter and " +
"generates multiple events from a user-specified field.")
public class SplitEventProcessorConfig {
static final String DELIMITER_REGEX_KEY = "delimiter_regex";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.fasterxml.jackson.annotation.JsonClassDescription;

@JsonClassDescription("The <code>trace_peer_forwarder</code> processor is used with peer forwarder to reduce by half " +
@JsonClassDescription("The trace peer forwarder processor is used with peer forwarder to reduce by half " +
"the number of events forwarded in a <a href=\"https://opensearch.org/docs/latest/data-prepper/common-use-cases/trace-analytics/\">Trace Analytics</a> pipeline.")
public class TracePeerForwarderProcessorConfig {
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import java.util.Objects;

@JsonPropertyOrder
@JsonClassDescription("The <code>translate</code> processor transforms values in events into preconfigured values.")
@JsonClassDescription("The translate processor transforms values in events into preconfigured values.")
public class TranslateProcessorConfig {

@JsonProperty("file")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import java.util.List;

@JsonPropertyOrder
@JsonClassDescription("The <code>truncate</code> processor truncates a key's value at the beginning, the end, " +
@JsonClassDescription("The truncate processor truncates a key's value at the beginning, the end, " +
"or on both sides of the value string, based on the processor’s configuration.")
public class TruncateProcessorConfig {
public static class Entry {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import java.util.List;

@JsonPropertyOrder
@JsonClassDescription("The <code>user_agent</code> processor parses any user agent (UA) string in an event and then adds the " +
@JsonClassDescription("The user agent processor parses any user agent (UA) string in an event and then adds the " +
"parsed results to the event.")
public class UserAgentProcessorConfig {

Expand Down
Loading

0 comments on commit bc04bd1

Please sign in to comment.