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

fix: add ottl metric condition to expr package for use in sampling processor #1878

Merged
merged 5 commits into from
Sep 25, 2024

Conversation

colelaven
Copy link
Contributor

@colelaven colelaven commented Sep 24, 2024

Proposed Change

Adds OTTL Metric Condition, Statement, and Expression to the expr package. Changes the sampling processor to use a metric based condition instead of datapoint based condition.

Followup to: #1877

Checklist
  • Changes are tested
  • CI has passed

Copy link
Contributor

@BinaryFissionGames BinaryFissionGames left a comment

Choose a reason for hiding this comment

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

Looks good, just one comment on the go.mod

processor/samplingprocessor/go.mod Show resolved Hide resolved
Comment on lines 39 to 41
if cfg.Condition == "" {
cfg.Condition = "true"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we ever hit this case? We already set the default to this in createDefaultConfig. IMO we shouldn't modify the config in a "Validate" function, I wouldn't expect validation to mutate the config.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, I wasn't sure how the condition field would be set if it isn't passed in from the config, but I see now with some testing that it gets set to the default. Change has been pushed 👍

@colelaven colelaven merged commit 3535635 into release/v1.61.0 Sep 25, 2024
15 checks passed
@colelaven colelaven deleted the cole/bpop-790-followup branch September 25, 2024 14:15
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.

2 participants