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

Config description changes for aggregate and anomaly detector processors. #4829

Merged
merged 5 commits into from
Aug 13, 2024

Conversation

kkondaka
Copy link
Collaborator

Description

Config description changes for aggregate and anomaly detector processors.

Issues Resolved

Resolves #[Issue number to be closed when this PR is merged]

Check List

  • New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
    • New functionality has javadoc added
  • [X ] Commits are signed with a real name per the DCO

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.

kkondaka and others added 3 commits August 12, 2024 22:46
Signed-off-by: Krishna Kondaka <[email protected]>
@JsonProperty("aggregated_events_tag")
private String aggregatedEventsTag;

@JsonPropertyDescription("A [conditional expression](https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), " +
Copy link
Member

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

@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.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This description is a little confusing. Why the combination of event.otel_metrics, and value.raw? Also there is a typo in OTel with caps

Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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("key")
@NotNull
String key;

@JsonPropertyDescription("The units for the values in the key.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this time units?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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("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.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above

import jakarta.validation.constraints.AssertTrue;

public class PercentSamplerAggregateActionConfig {
@JsonPropertyDescription("Percent value of the sampling to be done.")
Copy link
Member

Choose a reason for hiding this comment

The 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

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")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should capitalize the first letter on all of these

@JsonProperty("percent")
@NotNull
private Integer percent;

@JsonPropertyDescription("condition that determines if an event is error event or not")
Copy link
Member

Choose a reason for hiding this comment

The 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("wait_period")
@NotNull
private Duration waitPeriod;

@JsonPropertyDescription("percent value to use for sampling non error events.")
Copy link
Member

Choose a reason for hiding this comment

The 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.

@@ -25,22 +26,27 @@ public class RandomCutForestModeConfig {

public static final String VERSION_1_0 = "1.0";

@JsonPropertyDescription("The algorithm version number.")
Copy link
Member

Choose a reason for hiding this comment

The 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

Krishna Kondaka added 2 commits August 13, 2024 19:17
Signed-off-by: Krishna Kondaka <[email protected]>
Signed-off-by: Krishna Kondaka <[email protected]>
@kkondaka kkondaka merged commit 1487973 into opensearch-project:main Aug 13, 2024
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants