Skip to content

feat: Add is_log and is_metric conditions#1950

Merged
Jeffail merged 1 commit intomasterfrom
is_type_conditions
Feb 28, 2020
Merged

feat: Add is_log and is_metric conditions#1950
Jeffail merged 1 commit intomasterfrom
is_type_conditions

Conversation

@Jeffail
Copy link
Contributor

@Jeffail Jeffail commented Feb 27, 2020

This adds two new conditions is_log and is_metric, which are fairly self explanatory. They will allow writers of unit tests to check the actual type of an event coming out of certain transforms.

It will also allow users to create swimlanes that separate logs from metrics to different outputs. However, for swimlanes this currently isn't useful at all as it is forced to deal only in logs until #421 is solved.

@Jeffail Jeffail requested a review from binarylogic as a code owner February 27, 2020 15:49
@Jeffail Jeffail changed the title feat(conditions): Add is_log and is_metric conditions feat: Add is_log and is_metric conditions Feb 27, 2020
Copy link
Contributor

@binarylogic binarylogic left a comment

Choose a reason for hiding this comment

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

This makes sense! I like it. Would check_fields apply to metrics tags or would we add a new check_tags type?

@Jeffail
Copy link
Contributor Author

Jeffail commented Feb 27, 2020

Yeah check_fields tests against tags when it receives metrics.

@binarylogic
Copy link
Contributor

Ah, yeah our terminology isn't consistent here. Ex: add_fields and add_tags transforms. We previously talked about unifiying the term but felt it was misleading since they operate differently. I'm curious what you think.

@Jeffail
Copy link
Contributor Author

Jeffail commented Feb 27, 2020

For transforms I'd say it helps to be more explicit. Right now conditions are kind of hidden in that you can live a successful and enriched life without knowing there's anything other than check_fields (and you might not even know it's called that).

As we expand it might be worth eventually making an explicit check_tags condition, not because it's super important to be explicit but more so for discoverability. If we end up with a list of conditions we want people to know they're able to check metric tags by glancing at the types.

Signed-off-by: Ashley Jeffs <ash@jeffail.uk>
@Jeffail Jeffail merged commit 5ecbc28 into master Feb 28, 2020
@Jeffail Jeffail deleted the is_type_conditions branch February 28, 2020 10:47
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