function MeterProvider::getMeter
Overrides MeterProviderInterface::getMeter
File
-
vendor/
open-telemetry/ sdk/ Metrics/ MeterProvider.php, line 59
Class
Namespace
OpenTelemetry\SDK\MetricsCode
public function getMeter(string $name, ?string $version = null, ?string $schemaUrl = null, iterable $attributes = []) : MeterInterface {
if ($this->closed || Sdk::isDisabled()) {
//@todo create meter provider from factory, and move Sdk::isDisabled() there
return new NoopMeter();
}
$meter = new Meter($this->metricFactory, $this->resource, $this->clock, $this->stalenessHandlerFactory, $this->metricReaders, $this->viewRegistry, $this->exemplarFilter, $this->instruments, $this->instrumentationScopeFactory
->create($name, $version, $schemaUrl, $attributes), $this->registry, $this->writer, $this->destructors, $this->configurator);
$this->meters
->offsetSet($meter, null);
return $meter;
}