MetricExporter
in package
implements
PushMetricExporterInterface, AggregationTemporalitySelectorInterface
uses
LogsMessagesTrait
FinalYes
Tags
Table of Contents
Interfaces
Properties
- $serializer : ProtobufSerializer
- $temporality : string|Temporality|null
- $transport : TransportInterface
Methods
- __construct() : mixed
- export() : bool
- forceFlush() : bool
- shutdown() : bool
- temporality() : string|Temporality|null
- Returns the temporality to use for the given metric.
- logDebug() : void
- logError() : void
- logInfo() : void
- logNotice() : void
- logWarning() : void
- doLog() : void
- shouldLog() : bool
Properties
$serializer
private
ProtobufSerializer
$serializer
$temporality read-only
private
string|Temporality|null
$temporality
= null
$transport read-only
private
TransportInterface
$transport
Methods
__construct()
public
__construct(TransportInterface $transport[, string|Temporality|null $temporality = null ]) : mixed
Parameters
- $transport : TransportInterface
- $temporality : string|Temporality|null = null
Tags
export()
public
export(iterable<string|int, mixed> $batch) : bool
Parameters
- $batch : iterable<string|int, mixed>
Return values
boolforceFlush()
public
forceFlush() : bool
Return values
boolshutdown()
public
shutdown() : bool
Return values
booltemporality()
Returns the temporality to use for the given metric.
public
temporality(MetricMetadataInterface $metric) : string|Temporality|null
It is recommended to return MetricMetadataInterface::temporality() if the exporter does not require a specific temporality.
Parameters
- $metric : MetricMetadataInterface
Return values
string|Temporality|null —temporality to use, or null to signal that the given metric should not be exported by this exporter
logDebug()
protected
static logDebug(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
logError()
protected
static logError(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
logInfo()
protected
static logInfo(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
logNotice()
protected
static logNotice(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
logWarning()
protected
static logWarning(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
doLog()
private
static doLog(string $level, string $message, array<string|int, mixed> $context) : void
Parameters
- $level : string
- $message : string
- $context : array<string|int, mixed>
shouldLog()
private
static shouldLog(string $level) : bool
Parameters
- $level : string