-
Notifications
You must be signed in to change notification settings - Fork 190
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
Config description changes for aggregate and anomaly detector processors. #4829
Changes from 3 commits
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 |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
import java.util.List; | ||
import java.util.Set; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.annotation.JsonPropertyDescription; | ||
|
||
public class CountAggregateActionConfig { | ||
static final String SUM_METRIC_NAME = "count"; | ||
|
@@ -17,21 +18,27 @@ public class CountAggregateActionConfig { | |
public static final String DEFAULT_END_TIME_KEY = "aggr._end_time"; | ||
public static final Set<String> validOutputFormats = new HashSet<>(Set.of(OutputFormat.OTEL_METRICS.toString(), OutputFormat.RAW.toString())); | ||
|
||
@JsonPropertyDescription("Key used for storing the count. Default name is aggr._count.") | ||
@JsonProperty("count_key") | ||
String countKey = DEFAULT_COUNT_KEY; | ||
|
||
@JsonPropertyDescription("Metric name to be used when otel format is used.") | ||
@JsonProperty("metric_name") | ||
String metricName = SUM_METRIC_NAME; | ||
|
||
@JsonPropertyDescription("List of unique keys to count.") | ||
@JsonProperty("unique_keys") | ||
List<String> uniqueKeys = null; | ||
|
||
@JsonPropertyDescription("Key used for storing the start time. Default name is aggr._start_time.") | ||
@JsonProperty("start_time_key") | ||
String startTimeKey = DEFAULT_START_TIME_KEY; | ||
|
||
@JsonPropertyDescription("Key used for storing the end time. Default name is aggr._end_time.") | ||
@JsonProperty("end_time_key") | ||
String endTimeKey = DEFAULT_END_TIME_KEY; | ||
|
||
@JsonPropertyDescription("Format of the aggregated event.otel_metrics: Default output format. Outputs in OTel metrics SUM type with count as value.raw - Generates a JSON object with the count_key field as a count value and the start_time_key field with aggregation start time as value.") | ||
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. This description is a little confusing. Why the combination of 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. This is directly copied from https://opensearch.org/docs/latest/data-prepper/pipelines/configuration/processors/aggregate/. But there is some ambiguity here due to formatting. I will fix it. |
||
@JsonProperty("output_format") | ||
String outputFormat = OutputFormat.OTEL_METRICS.toString(); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
import java.util.List; | ||
import java.util.HashSet; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.annotation.JsonPropertyDescription; | ||
import jakarta.validation.constraints.NotNull; | ||
|
||
public class HistogramAggregateActionConfig { | ||
|
@@ -25,27 +26,34 @@ public class HistogramAggregateActionConfig { | |
public static final String DURATION_KEY = "duration"; | ||
public static final Set<String> validOutputFormats = new HashSet<>(Set.of(OutputFormat.OTEL_METRICS.toString(), OutputFormat.RAW.toString())); | ||
|
||
@JsonPropertyDescription("Name of the field in the events the histogram generates.") | ||
@JsonProperty("key") | ||
@NotNull | ||
String key; | ||
|
||
@JsonPropertyDescription("The units for the values in the key.") | ||
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. Is this time units? 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. It can be anything. It is the name of the units. It could be "bytes", "MB" and so on. |
||
@JsonProperty("units") | ||
@NotNull | ||
String units; | ||
|
||
@JsonPropertyDescription("Metric name to be used when otel format is used.") | ||
@JsonProperty("metric_name") | ||
String metricName = HISTOGRAM_METRIC_NAME; | ||
|
||
@JsonPropertyDescription("key_prefix used by all the fields created in the aggregated event. Having a prefix ensures that the names of the histogram event do not conflict with the field names in the event.") | ||
@JsonProperty("generated_key_prefix") | ||
String generatedKeyPrefix = DEFAULT_GENERATED_KEY_PREFIX; | ||
|
||
@JsonPropertyDescription("A list of buckets (values of type double) indicating the buckets in the histogram.") | ||
@JsonProperty("buckets") | ||
@NotNull | ||
List<Number> buckets; | ||
|
||
@JsonPropertyDescription("Format of the aggregated event.otel_metrics: Default output format. Outputs in OTel metrics SUM type with count as value.raw - Generates a JSON object with the count_key field as a count value and the start_time_key field with aggregation start time as value.") | ||
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. Same comment as above |
||
@JsonProperty("output_format") | ||
String outputFormat = OutputFormat.OTEL_METRICS.toString(); | ||
|
||
@JsonPropertyDescription("A Boolean value indicating whether the histogram should include the min and max of the values in the aggregation.") | ||
@JsonProperty("record_minmax") | ||
boolean recordMinMax = false; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,11 @@ | |
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import jakarta.validation.constraints.NotNull; | ||
import com.fasterxml.jackson.annotation.JsonPropertyDescription; | ||
import jakarta.validation.constraints.AssertTrue; | ||
|
||
public class PercentSamplerAggregateActionConfig { | ||
@JsonPropertyDescription("Percent value of the sampling to be done.") | ||
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. Should mention this must be greater than 0.0 and less than 100.0 |
||
@JsonProperty("percent") | ||
@NotNull | ||
private double percent; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,20 +6,24 @@ | |
package org.opensearch.dataprepper.plugins.processor.aggregate.actions; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.annotation.JsonPropertyDescription; | ||
import jakarta.validation.constraints.NotNull; | ||
import jakarta.validation.constraints.AssertTrue; | ||
|
||
import java.time.Duration; | ||
|
||
public class TailSamplerAggregateActionConfig { | ||
@JsonPropertyDescription("period to wait before considering that a trace event is complete") | ||
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. Should capitalize the first letter on all of these |
||
@JsonProperty("wait_period") | ||
@NotNull | ||
private Duration waitPeriod; | ||
|
||
@JsonPropertyDescription("percent value to use for sampling non error events.") | ||
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. Should mention this is Integer between 0 and 100 as there is another percent parameter with double. |
||
@JsonProperty("percent") | ||
@NotNull | ||
private Integer percent; | ||
|
||
@JsonPropertyDescription("condition that determines if an event is error event or not") | ||
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. Should link to the expression documentation and be clear if this is a Data Prepper conditional expression |
||
@JsonProperty("condition") | ||
private String condition; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
package org.opensearch.dataprepper.plugins.processor.anomalydetector.modes; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.annotation.JsonPropertyDescription; | ||
import jakarta.validation.constraints.AssertTrue; | ||
|
||
import java.util.Set; | ||
|
@@ -25,22 +26,27 @@ public class RandomCutForestModeConfig { | |
|
||
public static final String VERSION_1_0 = "1.0"; | ||
|
||
@JsonPropertyDescription("The algorithm version number.") | ||
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. Might be nice to mention the default of all of these in the JsonPropertyDescription |
||
@JsonProperty("version") | ||
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.") | ||
@JsonProperty("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.") | ||
@JsonProperty("shingle_size") | ||
private int shingleSize = DEFAULT_SHINGLE_SIZE; | ||
|
||
@JsonPropertyDescription("The sample size used in the ML algorithm.") | ||
@JsonProperty("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.") | ||
@JsonProperty("time_decay") | ||
private double timeDecay = DEFAULT_TIME_DECAY; | ||
|
||
|
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 copied the markdown string conditional expression