ConsoleMetricExporter
in package
implements
PushMetricExporterInterface, AggregationTemporalitySelectorInterface
Console metrics exporter.
Note that the output is human-readable JSON, not compatible with OTLP.
Table of Contents
Interfaces
Properties
- $temporality : Temporality|string|null
Methods
- __construct() : mixed
- export() : bool
- forceFlush() : bool
- shutdown() : bool
- temporality() : string|Temporality|null
- Returns the temporality to use for the given metric.
- convertInstrumentationScope() : array<string|int, mixed>
- convertMetric() : array<string|int, mixed>
- convertResource() : array<string|int, mixed>
Properties
$temporality read-only
private
Temporality|string|null
$temporality
= null
Methods
__construct()
public
__construct([Temporality|string|null $temporality = null ]) : mixed
Parameters
- $temporality : Temporality|string|null = null
export()
public
export(iterable<string|int, mixed> $batch) : bool
Parameters
- $batch : iterable<string|int, mixed>
Tags
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
Parameters
- $metric : MetricMetadataInterface
Tags
Return values
string|Temporality|null —temporality to use, or null to signal that the given metric should not be exported by this exporter
convertInstrumentationScope()
private
convertInstrumentationScope(InstrumentationScopeInterface $scope) : array<string|int, mixed>
Parameters
- $scope : InstrumentationScopeInterface
Return values
array<string|int, mixed>convertMetric()
private
convertMetric(Metric $metric) : array<string|int, mixed>
Parameters
- $metric : Metric
Return values
array<string|int, mixed>convertResource()
private
convertResource(ResourceInfo $resource) : array<string|int, mixed>
Parameters
- $resource : ResourceInfo