OpenTelemetry PHP

Predicate
in package
implements PredicateInterface

FinalYes

Closure based {@see PredicateInterface} with named constructors for the common conditions.

Tags
experimental

Table of Contents

Interfaces

PredicateInterface
A condition of a {@see ComposableRuleBased} rule.

Properties

$description  : string
$fn  : Closure

Methods

__construct()  : mixed
__toString()  : string
and()  : self
anySpan()  : self
attributePatterns()  : self
Matches when the attribute is present, its string representation matches one of the included patterns (any value if there are none) and none of the excluded patterns. Patterns are case-sensitive, `?` matches a single character and `*` any sequence of characters. For array attributes, a match of any item is a match.
attributeValues()  : self
Matches when the attribute is present and its string representation equals one of the values.
attributeValueToString()  : string
Booleans are compared as "true" and "false", everything else by its string cast.
hasLocalSpanParent()  : self
Matches spans with a valid, local parent. Root spans do not match.
hasRemoteParent()  : self
isRootSpan()  : self
Matches spans without a valid parent span context.
or()  : self
spanKindIn()  : self
spanMatches()  : bool
attributeStrings()  : array<int, string>
describe()  : string
matchesAny()  : bool
wildcardToRegex()  : non-empty-string

Properties

$description read-only

private string $description = ''

Methods

__toString()

public __toString() : string
Return values
string

anySpan()

public static anySpan() : self
Return values
self

attributePatterns()

Matches when the attribute is present, its string representation matches one of the included patterns (any value if there are none) and none of the excluded patterns. Patterns are case-sensitive, `?` matches a single character and `*` any sequence of characters. For array attributes, a match of any item is a match.

public static attributePatterns(string $key[, array<int, string> $included = [] ][, array<int, string> $excluded = [] ]) : self
Parameters
$key : string
$included : array<int, string> = []
$excluded : array<int, string> = []
Return values
self

attributeValues()

Matches when the attribute is present and its string representation equals one of the values.

public static attributeValues(string $key, array<int, string> $values) : self

For array attributes, a match of any item is a match.

Parameters
$key : string
$values : array<int, string>
Return values
self

attributeValueToString()

Booleans are compared as "true" and "false", everything else by its string cast.

public static attributeValueToString(mixed $value) : string
Parameters
$value : mixed
Return values
string

hasLocalSpanParent()

Matches spans with a valid, local parent. Root spans do not match.

public static hasLocalSpanParent() : self
Return values
self

hasRemoteParent()

public static hasRemoteParent() : self
Return values
self

isRootSpan()

Matches spans without a valid parent span context.

public static isRootSpan() : self
Return values
self

spanKindIn()

public static spanKindIn(int ...$spanKinds) : self
Parameters
$spanKinds : int
Return values
self

matchesAny()

private static matchesAny(array<int, non-empty-string> $regexes, string $candidate, bool $defaultIfEmpty) : bool
Parameters
$regexes : array<int, non-empty-string>
$candidate : string
$defaultIfEmpty : bool
Return values
bool

wildcardToRegex()

private static wildcardToRegex(string $pattern) : non-empty-string
Parameters
$pattern : string
Return values
non-empty-string
On this page

Search results