antimatter.builders.write_context_rule#

Module Contents#

Classes#

WriteContextRegexRuleBuilder

Builder class for creating a WriteContextRegexRule

class antimatter.builders.write_context_rule.WriteContextRegexRuleBuilder(pattern: str, match_on_key: bool = False)#

Builder class for creating a WriteContextRegexRule

add_span_tag(name: str, tag_type: str | antimatter.tags.TagType = TagType.Unary, value: str | None = None) WriteContextRegexRuleBuilder#

The span tag to add when the regex rule matches

Parameters:
  • name – The span tag name

  • tag_type – The span tag type; default ‘unary’

  • value – The span tag value, if the tag_type is not ‘unary’

Returns:

The builder instance

add_capsule_tag(name: str, tag_type: str | antimatter.tags.TagType = TagType.Unary, value: str | None = None) WriteContextRegexRuleBuilder#

The capsule tag to add when the regex rule matches

Parameters:
  • name – The capsule tag name

  • tag_type – The capsule tag type; default ‘unary’

  • value – The capsule tag value, if the tag_type is not ‘unary’

Returns:

The builder instance

build() antimatter.client.WriteContextRegexRule#

Build the rule.

Returns:

The built rule