function Meter::viewRegistrationRequests
Return value
iterable<array{ViewProjection, MetricRegistrationInterface}>
3 calls to Meter::viewRegistrationRequests()
- Meter::createAsynchronousObserver in vendor/
open-telemetry/ sdk/ Metrics/ Meter.php - Meter::createSynchronousWriter in vendor/
open-telemetry/ sdk/ Metrics/ Meter.php - Meter::updateConfigurator in vendor/
open-telemetry/ sdk/ Metrics/ Meter.php - @internal
File
-
vendor/
open-telemetry/ sdk/ Metrics/ Meter.php, line 399
Class
- Meter
- @internal
Namespace
OpenTelemetry\SDK\MetricsCode
private function viewRegistrationRequests(Instrument $instrument, StalenessHandlerInterface $stalenessHandler) : iterable {
$views = $this->viewRegistry
->find($instrument, $this->instrumentationScope) ?? [
new ViewProjection($instrument->name, $instrument->unit, $instrument->description, null, null),
];
$compositeRegistration = new MultiRegistryRegistration($this->metricRegistries, $stalenessHandler);
foreach ($views as $view) {
if ($view->aggregation !== null) {
(yield [
$view,
$compositeRegistration,
]);
}
else {
foreach ($this->metricRegistries as $metricRegistry) {
(yield [
new ViewProjection($view->name, $view->unit, $view->description, $view->attributeKeys, $metricRegistry->defaultAggregation($instrument->type, $instrument->advisory)),
new RegistryRegistration($metricRegistry, $stalenessHandler),
]);
}
}
}
}