Bånder

SpanBuilder
in package

Table of Contents

Properties

$attributes  : array<string|int, mixed>
$name  : string
$parentContext  : Context|null
$shouldActivate  : bool
$spanKind  : int|null
$startTime  : float|null
$tags  : array<string|int, mixed>
$telemetry  : OpenTelemetryManager

Methods

__construct()  : mixed
asClient()  : self
asConsumer()  : self
asInternal()  : self
asProducer()  : self
asServer()  : self
Convenience methods for common span kinds
attribute()  : self
Add single attribute
attributes()  : self
Add multiple attributes
cache()  : self
create()  : self
Static factory methods for common use cases
database()  : self
external()  : self
forCache()  : self
Cache-specific builder methods
forDatabase()  : self
Database-specific builder methods
forExternalService()  : self
External service call builder methods
forHttpRequest()  : self
HTTP-specific builder methods
forHttpResponse()  : self
forQueue()  : self
Queue-specific builder methods
http()  : self
job()  : self
kind()  : self
Set span kind
start()  : SpanInterface
Start the span and return it
startAt()  : self
Set start time
tag()  : self
Add tag (convenience method for string attributes)
tags()  : self
Add multiple tags
trace()  : mixed
Start span and execute callback with automatic cleanup
withoutActivation()  : self
Control span activation
withParent()  : self
Set parent context
extractSqlOperation()  : string
getResponseContentLength()  : int|null
Helper methods
getStatusClass()  : string
setResponseStatus()  : void

Properties

$attributes

private array<string|int, mixed> $attributes = []

$parentContext

private Context|null $parentContext = null

Methods

asClient()

public asClient() : self
Return values
self

asConsumer()

public asConsumer() : self
Return values
self

asInternal()

public asInternal() : self
Return values
self

asProducer()

public asProducer() : self
Return values
self

asServer()

Convenience methods for common span kinds

public asServer() : self
Return values
self

attribute()

Add single attribute

public attribute(string $key, mixed $value) : self
Parameters
$key : string
$value : mixed
Return values
self

attributes()

Add multiple attributes

public attributes(array<string|int, mixed> $attributes) : self
Parameters
$attributes : array<string|int, mixed>
Return values
self

cache()

public static cache(string $name) : self
Parameters
$name : string
Return values
self

create()

Static factory methods for common use cases

public static create(string $name) : self
Parameters
$name : string
Return values
self

database()

public static database(string $name) : self
Parameters
$name : string
Return values
self

external()

public static external(string $name) : self
Parameters
$name : string
Return values
self

forCache()

Cache-specific builder methods

public forCache(string $operation, string $key[, string $system = 'redis' ]) : self
Parameters
$operation : string
$key : string
$system : string = 'redis'
Return values
self

forDatabase()

Database-specific builder methods

public forDatabase(string $query[, string $system = 'postgresql' ][, string $connection = 'default' ]) : self
Parameters
$query : string
$system : string = 'postgresql'
$connection : string = 'default'
Return values
self

forExternalService()

External service call builder methods

public forExternalService(string $service, string $operation) : self
Parameters
$service : string
$operation : string
Return values
self

forHttpRequest()

HTTP-specific builder methods

public forHttpRequest(Request $request) : self
Parameters
$request : Request
Return values
self

forHttpResponse()

public forHttpResponse(Response $response) : self
Parameters
$response : Response
Return values
self

forQueue()

Queue-specific builder methods

public forQueue(string $jobClass[, string $queue = 'default' ]) : self
Parameters
$jobClass : string
$queue : string = 'default'
Return values
self

http()

public static http(string $name) : self
Parameters
$name : string
Return values
self

job()

public static job(string $name) : self
Parameters
$name : string
Return values
self

kind()

Set span kind

public kind(int $spanKind) : self
Parameters
$spanKind : int
Return values
self

start()

Start the span and return it

public start() : SpanInterface
Return values
SpanInterface

startAt()

Set start time

public startAt(float $timestamp) : self
Parameters
$timestamp : float
Return values
self

tag()

Add tag (convenience method for string attributes)

public tag(string $key, string $value) : self
Parameters
$key : string
$value : string
Return values
self

tags()

Add multiple tags

public tags(array<string|int, mixed> $tags) : self
Parameters
$tags : array<string|int, mixed>
Return values
self

trace()

Start span and execute callback with automatic cleanup

public trace(Closure $callback) : mixed
Parameters
$callback : Closure

withoutActivation()

Control span activation

public withoutActivation() : self
Return values
self

withParent()

Set parent context

public withParent(Context|null $parentContext) : self
Parameters
$parentContext : Context|null
Return values
self

extractSqlOperation()

private extractSqlOperation(string $query) : string
Parameters
$query : string
Return values
string

getResponseContentLength()

Helper methods

private getResponseContentLength(Response $response) : int|null
Parameters
$response : Response
Return values
int|null

getStatusClass()

private getStatusClass(int $statusCode) : string
Parameters
$statusCode : int
Return values
string

setResponseStatus()

private setResponseStatus(SpanInterface $span, Response $response) : void
Parameters
$span : SpanInterface
$response : Response

        
On this page

Search results