Skip to main content

GetMeterProvider

Returns the meter provider for the given service name.

def GetMeterProvider(
serviceName: string
) - > rawmetric.MeterProvider

Returns the meter provider for the given service name. Callers use this to retrieve the appropriate meter provider for a specific service, ensuring metrics are collected and reported correctly for that service.

Parameters

NameTypeDescription
serviceNamestringThe name of the service for which to retrieve the meter provider. This name is used to look up a pre-configured meter provider.

Returns

TypeDescription
rawmetric.MeterProviderThe meter provider associated with the service name, or a no-op meter provider if no specific provider is found.