function Meter::updateConfigurator
@internal
Overrides Configurable::updateConfigurator
File
-
vendor/
open-telemetry/ sdk/ Metrics/ Meter.php, line 79
Class
- Meter
- @internal
Namespace
OpenTelemetry\SDK\MetricsCode
public function updateConfigurator(Configurator $configurator) : void {
$this->config = $configurator->resolve($this->instrumentationScope);
$startTimestamp = $this->clock
->now();
foreach ($this->instruments->observers[self::instrumentationScopeId($this->instrumentationScope)] as [
$instrument,
$stalenessHandler,
$r,
]) {
if ($this->config
->isEnabled() && $r->dormant) {
$this->metricFactory
->createAsynchronousObserver($this->registry, $this->resource, $this->instrumentationScope, $instrument, $startTimestamp, $this->viewRegistrationRequests($instrument, $stalenessHandler));
$r->dormant = false;
}
if (!$this->config
->isEnabled() && !$r->dormant) {
$this->releaseStreams($instrument);
$r->dormant = true;
}
}
foreach ($this->instruments->writers[self::instrumentationScopeId($this->instrumentationScope)] as [
$instrument,
$stalenessHandler,
$r,
]) {
if ($this->config
->isEnabled() && $r->dormant) {
$this->metricFactory
->createSynchronousWriter($this->registry, $this->resource, $this->instrumentationScope, $instrument, $startTimestamp, $this->viewRegistrationRequests($instrument, $stalenessHandler), $this->exemplarFilter);
$r->dormant = false;
}
if (!$this->config
->isEnabled() && !$r->dormant) {
$this->releaseStreams($instrument);
$r->dormant = true;
}
}
}