Auto-commit 2026-04-29 16:31
This commit is contained in:
201
node_modules/@opentelemetry/api/LICENSE
generated
vendored
Normal file
201
node_modules/@opentelemetry/api/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
117
node_modules/@opentelemetry/api/README.md
generated
vendored
Normal file
117
node_modules/@opentelemetry/api/README.md
generated
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
# OpenTelemetry API for JavaScript
|
||||
|
||||
<p align="center">
|
||||
<strong>
|
||||
<a href="https://open-telemetry.github.io/opentelemetry-js/modules/_opentelemetry_api.html">API Reference</a>
|
||||
•
|
||||
<a href="https://opentelemetry.io/docs/instrumentation/js/">Documentation</a>
|
||||
</br>
|
||||
<a href="https://github.com/open-telemetry/opentelemetry-js/releases">
|
||||
<img alt="NPM Release" src="https://img.shields.io/npm/v/@opentelemetry/api?color=brightgreen&logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAIRlWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAACQAAAAAQAAAJAAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAABigAwAEAAAAAQAAABgAAAAA8A2UOAAAAAlwSFlzAAAWJQAAFiUBSVIk8AAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAABK5JREFUSA2dVm1sFEUYfmd2b%2Ff2Pkqghn5eEQWKrRgjpkYgpoRCLC0oxV5apAiGUDEpJvwxEQ2raWPU%2BKf8INU%2FRtEedwTCR9tYPloxGNJYTTQUwYqJ1aNpaLH3sXu3t7vjvFevpSqt7eSyM%2B%2FczvM8877PzB3APBoLgoDLsNePF56LBwqa07EKlDGg84CcWsI4CEbhNnDpAd951lXE2NkiNknCCTLv4HtzZuvPm1C%2FIKv4oDNXqNDHragety2XVzjECZsJARuBMyRzJrh1O0gQwLXuxofxsPSj4hG8fMLQo7bl9JJD8XZfC1E5yWFOMtd07dvX5kDwg6%2B2%2B%2BChq8txHGtfPoAp0gOFmhYoNFkHjn2TNUmrwRdna7W1QSkU8hvbGk4uThLrapaiLA2E6QY4u%2FlS9ItHfvJkxYsTMVtnAJLipYIWtVrcdX%2B8%2Bb8IVnPl%2FR81prbuPZ1jpYw%2B0aEUGSkdFsgyBIaFTXCm6nyaxMtJ4n%2BTeDhJzGqZtQZcuYDgqDwDbqb0JF9oRpIG1Oea3bC1Y6N3x%2FWV8Zh83emhCs%2B%2BhlaghDw%2B8w5UlYKq2lU7Pl8IkvS9KDqXmKmEwdMppVPKwGSEilmyAwJhRwWcq7wYC6z4wZ1rrEoMWxecdOjZWXeAQClBcYDN3NwVwD9pGwqUSyQgclcmxpNJqCuwLmDh3WtvPqXdlt%2B6Oz70HPGDNSNBee%2FEOen%2BrGbEFqDENBPDbtdCp0ukPANmzO0QQJYUpyS5IJJI3Hqt4maS%2BEB3199ozm8EDU%2F6fVNU2dQpdx3ZnKzeFXyaUTiasEV%2FgZMzJMjr3Z%2BWvAdQ%2Bhs%2Fzw9savimxUntDSaBdZ2f%2BIdbm1rlNY8esFffBit9HtK5%2FMejsrJVxikOXlb1Ukir2X%2BRbdkd1KG2Ixfn2Ql4JRmELnYK9mEM8G36fAA3xEQ89fxXihC8q%2BsAKi9jhHxNqagY2hiaYgRCm0f0QP7H4Fp11LSXiuBY2aYFlh0DeDIVVFUJQn5rCnpiNI2gvLxHnASn9DIVHJJlm5rXvQAGEo4zvKq2w5G1NxENN7jrft1oxMdekETjxdH2Z3x%2BVTVYsPb%2BO0C%2F9%2FauN6v2hNZw5b2UOmSbG5%2FrkC3LBA%2B1PdxFxORjxpQ81GcxKc%2BybVjEBvUJvaGJ7p7n5A5KSwe4AzkasA%2BcrmzFtowoIVTiLjANm8GDsrWW35ScI3JY8Urv83tnkF8JR0yLvEt2hO%2F0qNyy3Jb3YKeHeHeLeOuVLRpNF%2Bpkf85OW7%2FzJxWdXsbsKBUk2TC0BCPwMq5Q%2FCPvaJFkNS%2F1l1qUPe%2BuH3oD59erYGI%2FY4sce6KaXYElAIOLt%2B0O3t2%2B%2FxJDF1XvOlWGC1W1B8VMszbGfOvT5qaRRAIFK3BCO164nZ0uYLH2YjNN8thXS2v2BK9gTfD7jHVxzHr4roOlEvYYz9QIz%2BVl%2FsLDXInsctFsXjqIRnO2ZO387lxmIboLDZCJ59KLFliNIgh9ipt6tLg9SihpRPDO1ia5byw7de1aCQmF5geOQtK509rzfdwxaKOIq%2B73AvwCC5%2F5fcV4vo3%2B3LpMdtWHh0ywsJC%2FZGoCb8%2F9D8F%2FifgLLl8S8QWfU8cAAAAASUVORK5CYII%3D">
|
||||
</a>
|
||||
</strong>
|
||||
</p>
|
||||
|
||||
This package provides everything needed to interact with the OpenTelemetry API, including all TypeScript interfaces, enums, and no-op implementations. It is intended for use both on the server and in the browser.
|
||||
|
||||
The methods in this package perform no operations by default. This means they can be safely called by a library or end-user application whether there is an SDK registered or not. In order to generate and export telemetry data, you will also need an SDK such as the [OpenTelemetry JS SDK][opentelemetry-js].
|
||||
|
||||
## Tracing Quick Start
|
||||
|
||||
### You Will Need
|
||||
|
||||
- An application you wish to instrument
|
||||
- [OpenTelemetry JS SDK][opentelemetry-js]
|
||||
- Node.js >=8.5.0 (14+ is preferred) or an ECMAScript 5+ compatible browser
|
||||
|
||||
**Note:** ECMAScript 5+ compatibility is for this package only. Please refer to the documentation for the SDK you are using to determine its minimum ECMAScript version.
|
||||
|
||||
**Note for library authors:** Only your end users will need an OpenTelemetry SDK. If you wish to support OpenTelemetry in your library, you only need to use the OpenTelemetry API. For more information, please read the [tracing documentation][docs-tracing].
|
||||
|
||||
### Install Dependencies
|
||||
|
||||
```sh
|
||||
npm install @opentelemetry/api @opentelemetry/sdk-trace-base
|
||||
```
|
||||
|
||||
### Trace Your Application
|
||||
|
||||
In order to get started with tracing, you will need to first register an SDK. The SDK you are using may provide a convenience method which calls the registration methods for you, but if you would like to call them directly they are documented here: [SDK registration methods][docs-sdk-registration].
|
||||
|
||||
Once you have registered an SDK, you can start and end spans. A simple example of basic SDK registration and tracing a simple operation is below. The example should export spans to the console once per second. For more information, see the [tracing documentation][docs-tracing].
|
||||
|
||||
```javascript
|
||||
const { trace } = require("@opentelemetry/api");
|
||||
const { BasicTracerProvider, ConsoleSpanExporter, SimpleSpanProcessor } = require("@opentelemetry/sdk-trace-base");
|
||||
|
||||
// Create and register an SDK
|
||||
const provider = new BasicTracerProvider({
|
||||
spanProcessors: [new SimpleSpanProcessor(new ConsoleSpanExporter())]
|
||||
});
|
||||
trace.setGlobalTracerProvider(provider);
|
||||
|
||||
// Acquire a tracer from the global tracer provider which will be used to trace the application
|
||||
const name = 'my-application-name';
|
||||
const version = '0.1.0';
|
||||
const tracer = trace.getTracer(name, version);
|
||||
|
||||
// Trace your application by creating spans
|
||||
async function operation() {
|
||||
const span = tracer.startSpan("do operation");
|
||||
|
||||
// mock some work by sleeping 1 second
|
||||
await new Promise((resolve, reject) => {
|
||||
setTimeout(resolve, 1000);
|
||||
})
|
||||
|
||||
span.end();
|
||||
}
|
||||
|
||||
async function main() {
|
||||
while (true) {
|
||||
await operation();
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
```
|
||||
|
||||
## Version Compatibility
|
||||
|
||||
Because the npm installer and node module resolution algorithm could potentially allow two or more copies of any given package to exist within the same `node_modules` structure, the OpenTelemetry API takes advantage of a variable on the `global` object to store the global API. When an API method in the API package is called, it checks if this `global` API exists and proxies calls to it if and only if it is a compatible API version. This means if a package has a dependency on an OpenTelemetry API version which is not compatible with the API used by the end user, the package will receive a no-op implementation of the API.
|
||||
|
||||
## Upgrade Guidelines
|
||||
|
||||
### 0.21.0 to 1.0.0
|
||||
|
||||
No breaking changes
|
||||
|
||||
### 0.20.0 to 0.21.0
|
||||
|
||||
- [#78](https://github.com/open-telemetry/opentelemetry-js-api/issues/78) `api.context.bind` arguments reversed and `context` is now a required argument.
|
||||
- [#46](https://github.com/open-telemetry/opentelemetry-js-api/issues/46) Noop classes and singletons are no longer exported. To create a noop span it is recommended to use `api.trace.wrapSpanContext` with `INVALID_SPAN_CONTEXT` instead of using the `NOOP_TRACER`.
|
||||
|
||||
### 1.0.0-rc.3 to 0.20.0
|
||||
|
||||
- Removing `TimedEvent` which was not part of spec
|
||||
- `HttpBaggage` renamed to `HttpBaggagePropagator`
|
||||
- [#45](https://github.com/open-telemetry/opentelemetry-js-api/pull/45) `Span#context` renamed to `Span#spanContext`
|
||||
- [#47](https://github.com/open-telemetry/opentelemetry-js-api/pull/47) `getSpan`/`setSpan`/`getSpanContext`/`setSpanContext` moved to `trace` namespace
|
||||
- [#55](https://github.com/open-telemetry/opentelemetry-js-api/pull/55) `getBaggage`/`setBaggage`/`createBaggage` moved to `propagation` namespace
|
||||
|
||||
## Useful links
|
||||
|
||||
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
|
||||
- For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-js>
|
||||
- For help or feedback on this project, join us in [GitHub Discussions][discussions-url]
|
||||
|
||||
## License
|
||||
|
||||
Apache 2.0 - See [LICENSE][license-url] for more information.
|
||||
|
||||
[opentelemetry-js]: https://github.com/open-telemetry/opentelemetry-js
|
||||
|
||||
[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions
|
||||
[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/main/api/LICENSE
|
||||
[docs-tracing]: https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/tracing.md
|
||||
[docs-sdk-registration]: https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/sdk-registration.md
|
||||
43
node_modules/@opentelemetry/api/build/esm/api/context.d.ts
generated
vendored
Normal file
43
node_modules/@opentelemetry/api/build/esm/api/context.d.ts
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
import type { Context, ContextManager } from '../context/types';
|
||||
/**
|
||||
* Singleton object which represents the entry point to the OpenTelemetry Context API
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export declare class ContextAPI {
|
||||
private static _instance?;
|
||||
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
||||
private constructor();
|
||||
/** Get the singleton instance of the Context API */
|
||||
static getInstance(): ContextAPI;
|
||||
/**
|
||||
* Set the current context manager.
|
||||
*
|
||||
* @returns true if the context manager was successfully registered, else false
|
||||
*/
|
||||
setGlobalContextManager(contextManager: ContextManager): boolean;
|
||||
/**
|
||||
* Get the currently active context
|
||||
*/
|
||||
active(): Context;
|
||||
/**
|
||||
* Execute a function with an active context
|
||||
*
|
||||
* @param context context to be active during function execution
|
||||
* @param fn function to execute in a context
|
||||
* @param thisArg optional receiver to be used for calling fn
|
||||
* @param args optional arguments forwarded to fn
|
||||
*/
|
||||
with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(context: Context, fn: F, thisArg?: ThisParameterType<F>, ...args: A): ReturnType<F>;
|
||||
/**
|
||||
* Bind a context to a target function or event emitter
|
||||
*
|
||||
* @param context context to bind to the event emitter or function. Defaults to the currently active context
|
||||
* @param target function or event emitter to bind
|
||||
*/
|
||||
bind<T>(context: Context, target: T): T;
|
||||
private _getContextManager;
|
||||
/** Disable and remove the global context manager */
|
||||
disable(): void;
|
||||
}
|
||||
//# sourceMappingURL=context.d.ts.map
|
||||
68
node_modules/@opentelemetry/api/build/esm/api/context.js
generated
vendored
Normal file
68
node_modules/@opentelemetry/api/build/esm/api/context.js
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
import { NoopContextManager } from '../context/NoopContextManager';
|
||||
import { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';
|
||||
import { DiagAPI } from './diag';
|
||||
const API_NAME = 'context';
|
||||
const NOOP_CONTEXT_MANAGER = new NoopContextManager();
|
||||
/**
|
||||
* Singleton object which represents the entry point to the OpenTelemetry Context API
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export class ContextAPI {
|
||||
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
||||
constructor() { }
|
||||
/** Get the singleton instance of the Context API */
|
||||
static getInstance() {
|
||||
if (!this._instance) {
|
||||
this._instance = new ContextAPI();
|
||||
}
|
||||
return this._instance;
|
||||
}
|
||||
/**
|
||||
* Set the current context manager.
|
||||
*
|
||||
* @returns true if the context manager was successfully registered, else false
|
||||
*/
|
||||
setGlobalContextManager(contextManager) {
|
||||
return registerGlobal(API_NAME, contextManager, DiagAPI.instance());
|
||||
}
|
||||
/**
|
||||
* Get the currently active context
|
||||
*/
|
||||
active() {
|
||||
return this._getContextManager().active();
|
||||
}
|
||||
/**
|
||||
* Execute a function with an active context
|
||||
*
|
||||
* @param context context to be active during function execution
|
||||
* @param fn function to execute in a context
|
||||
* @param thisArg optional receiver to be used for calling fn
|
||||
* @param args optional arguments forwarded to fn
|
||||
*/
|
||||
with(context, fn, thisArg, ...args) {
|
||||
return this._getContextManager().with(context, fn, thisArg, ...args);
|
||||
}
|
||||
/**
|
||||
* Bind a context to a target function or event emitter
|
||||
*
|
||||
* @param context context to bind to the event emitter or function. Defaults to the currently active context
|
||||
* @param target function or event emitter to bind
|
||||
*/
|
||||
bind(context, target) {
|
||||
return this._getContextManager().bind(context, target);
|
||||
}
|
||||
_getContextManager() {
|
||||
return getGlobal(API_NAME) || NOOP_CONTEXT_MANAGER;
|
||||
}
|
||||
/** Disable and remove the global context manager */
|
||||
disable() {
|
||||
this._getContextManager().disable();
|
||||
unregisterGlobal(API_NAME, DiagAPI.instance());
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=context.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/api/context.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/api/context.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/api/context.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE,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;AAC3B,MAAM,oBAAoB,GAAG,IAAI,kBAAkB,EAAE,CAAC;AAEtD;;;;GAIG;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;;;;OAIG;IACI,uBAAuB,CAAC,cAA8B;QAC3D,OAAO,cAAc,CAAC,QAAQ,EAAE,cAAc,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACtE,CAAC;IAED;;OAEG;IACI,MAAM;QACX,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,MAAM,EAAE,CAAC;IAC5C,CAAC;IAED;;;;;;;OAOG;IACI,IAAI,CACT,OAAgB,EAChB,EAAK,EACL,OAA8B,EAC9B,GAAG,IAAO;QAEV,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IACvE,CAAC;IAED;;;;;OAKG;IACI,IAAI,CAAI,OAAgB,EAAE,MAAS;QACxC,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACzD,CAAC;IAEO,kBAAkB;QACxB,OAAO,SAAS,CAAC,QAAQ,CAAC,IAAI,oBAAoB,CAAC;IACrD,CAAC;IAED,oDAAoD;IAC7C,OAAO;QACZ,IAAI,CAAC,kBAAkB,EAAE,CAAC,OAAO,EAAE,CAAC;QACpC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjD,CAAC;CACF","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { NoopContextManager } from '../context/NoopContextManager';\nimport type { Context, ContextManager } from '../context/types';\nimport {\n getGlobal,\n registerGlobal,\n unregisterGlobal,\n} from '../internal/global-utils';\nimport { DiagAPI } from './diag';\n\nconst API_NAME = 'context';\nconst NOOP_CONTEXT_MANAGER = new NoopContextManager();\n\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Context API\n *\n * @since 1.0.0\n */\nexport class ContextAPI {\n private static _instance?: ContextAPI;\n\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n private constructor() {}\n\n /** Get the singleton instance of the Context API */\n public static getInstance(): ContextAPI {\n if (!this._instance) {\n this._instance = new ContextAPI();\n }\n\n return this._instance;\n }\n\n /**\n * Set the current context manager.\n *\n * @returns true if the context manager was successfully registered, else false\n */\n public setGlobalContextManager(contextManager: ContextManager): boolean {\n return registerGlobal(API_NAME, contextManager, DiagAPI.instance());\n }\n\n /**\n * Get the currently active context\n */\n public active(): Context {\n return this._getContextManager().active();\n }\n\n /**\n * Execute a function with an active context\n *\n * @param context context to be active during function execution\n * @param fn function to execute in a context\n * @param thisArg optional receiver to be used for calling fn\n * @param args optional arguments forwarded to fn\n */\n public with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(\n context: Context,\n fn: F,\n thisArg?: ThisParameterType<F>,\n ...args: A\n ): ReturnType<F> {\n return this._getContextManager().with(context, fn, thisArg, ...args);\n }\n\n /**\n * Bind a context to a target function or event emitter\n *\n * @param context context to bind to the event emitter or function. Defaults to the currently active context\n * @param target function or event emitter to bind\n */\n public bind<T>(context: Context, target: T): T {\n return this._getContextManager().bind(context, target);\n }\n\n private _getContextManager(): ContextManager {\n return getGlobal(API_NAME) || NOOP_CONTEXT_MANAGER;\n }\n\n /** Disable and remove the global context manager */\n public disable() {\n this._getContextManager().disable();\n unregisterGlobal(API_NAME, DiagAPI.instance());\n }\n}\n"]}
|
||||
32
node_modules/@opentelemetry/api/build/esm/api/diag.d.ts
generated
vendored
Normal file
32
node_modules/@opentelemetry/api/build/esm/api/diag.d.ts
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
import type { ComponentLoggerOptions, DiagLogFunction, DiagLogger, DiagLoggerApi } from '../diag/types';
|
||||
/**
|
||||
* Singleton object which represents the entry point to the OpenTelemetry internal
|
||||
* diagnostic API
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export declare class DiagAPI implements DiagLogger, DiagLoggerApi {
|
||||
private static _instance?;
|
||||
/** Get the singleton instance of the DiagAPI API */
|
||||
static instance(): DiagAPI;
|
||||
/**
|
||||
* Private internal constructor
|
||||
* @private
|
||||
*/
|
||||
private constructor();
|
||||
setLogger: DiagLoggerApi['setLogger'];
|
||||
/**
|
||||
*
|
||||
*/
|
||||
createComponentLogger: (options: ComponentLoggerOptions) => DiagLogger;
|
||||
verbose: DiagLogFunction;
|
||||
debug: DiagLogFunction;
|
||||
info: DiagLogFunction;
|
||||
warn: DiagLogFunction;
|
||||
error: DiagLogFunction;
|
||||
/**
|
||||
* Unregister the global logger and return to Noop
|
||||
*/
|
||||
disable: () => void;
|
||||
}
|
||||
//# sourceMappingURL=diag.d.ts.map
|
||||
80
node_modules/@opentelemetry/api/build/esm/api/diag.js
generated
vendored
Normal file
80
node_modules/@opentelemetry/api/build/esm/api/diag.js
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
import { DiagComponentLogger } from '../diag/ComponentLogger';
|
||||
import { createLogLevelDiagLogger } from '../diag/internal/logLevelLogger';
|
||||
import { DiagLogLevel } from '../diag/types';
|
||||
import { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';
|
||||
const API_NAME = 'diag';
|
||||
/**
|
||||
* Singleton object which represents the entry point to the OpenTelemetry internal
|
||||
* diagnostic API
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export class DiagAPI {
|
||||
/** Get the singleton instance of the DiagAPI API */
|
||||
static instance() {
|
||||
if (!this._instance) {
|
||||
this._instance = new DiagAPI();
|
||||
}
|
||||
return this._instance;
|
||||
}
|
||||
/**
|
||||
* Private internal constructor
|
||||
* @private
|
||||
*/
|
||||
constructor() {
|
||||
function _logProxy(funcName) {
|
||||
return function (...args) {
|
||||
const logger = getGlobal('diag');
|
||||
// shortcut if logger not set
|
||||
if (!logger)
|
||||
return;
|
||||
return logger[funcName](...args);
|
||||
};
|
||||
}
|
||||
// Using self local variable for minification purposes as 'this' cannot be minified
|
||||
const self = this;
|
||||
// DiagAPI specific functions
|
||||
const setLogger = (logger, optionsOrLogLevel = { logLevel: DiagLogLevel.INFO }) => {
|
||||
var _a, _b, _c;
|
||||
if (logger === self) {
|
||||
// There isn't much we can do here.
|
||||
// Logging to the console might break the user application.
|
||||
// Try to log to self. If a logger was previously registered it will receive the log.
|
||||
const err = new Error('Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation');
|
||||
self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);
|
||||
return false;
|
||||
}
|
||||
if (typeof optionsOrLogLevel === 'number') {
|
||||
optionsOrLogLevel = {
|
||||
logLevel: optionsOrLogLevel,
|
||||
};
|
||||
}
|
||||
const oldLogger = getGlobal('diag');
|
||||
const newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger);
|
||||
// There already is an logger registered. We'll let it know before overwriting it.
|
||||
if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {
|
||||
const stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : '<failed to generate stacktrace>';
|
||||
oldLogger.warn(`Current logger will be overwritten from ${stack}`);
|
||||
newLogger.warn(`Current logger will overwrite one already registered from ${stack}`);
|
||||
}
|
||||
return registerGlobal('diag', newLogger, self, true);
|
||||
};
|
||||
self.setLogger = setLogger;
|
||||
self.disable = () => {
|
||||
unregisterGlobal(API_NAME, self);
|
||||
};
|
||||
self.createComponentLogger = (options) => {
|
||||
return new DiagComponentLogger(options);
|
||||
};
|
||||
self.verbose = _logProxy('verbose');
|
||||
self.debug = _logProxy('debug');
|
||||
self.info = _logProxy('info');
|
||||
self.warn = _logProxy('warn');
|
||||
self.error = _logProxy('error');
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=diag.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/api/diag.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/api/diag.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
28
node_modules/@opentelemetry/api/build/esm/api/metrics.d.ts
generated
vendored
Normal file
28
node_modules/@opentelemetry/api/build/esm/api/metrics.d.ts
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
import type { Meter, MeterOptions } from '../metrics/Meter';
|
||||
import type { MeterProvider } from '../metrics/MeterProvider';
|
||||
/**
|
||||
* Singleton object which represents the entry point to the OpenTelemetry Metrics API
|
||||
*/
|
||||
export declare class MetricsAPI {
|
||||
private static _instance?;
|
||||
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
||||
private constructor();
|
||||
/** Get the singleton instance of the Metrics API */
|
||||
static getInstance(): MetricsAPI;
|
||||
/**
|
||||
* Set the current global meter provider.
|
||||
* Returns true if the meter provider was successfully registered, else false.
|
||||
*/
|
||||
setGlobalMeterProvider(provider: MeterProvider): boolean;
|
||||
/**
|
||||
* Returns the global meter provider.
|
||||
*/
|
||||
getMeterProvider(): MeterProvider;
|
||||
/**
|
||||
* Returns a meter from the global meter provider.
|
||||
*/
|
||||
getMeter(name: string, version?: string, options?: MeterOptions): Meter;
|
||||
/** Remove the global meter provider */
|
||||
disable(): void;
|
||||
}
|
||||
//# sourceMappingURL=metrics.d.ts.map
|
||||
46
node_modules/@opentelemetry/api/build/esm/api/metrics.js
generated
vendored
Normal file
46
node_modules/@opentelemetry/api/build/esm/api/metrics.js
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
import { NOOP_METER_PROVIDER } from '../metrics/NoopMeterProvider';
|
||||
import { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';
|
||||
import { DiagAPI } from './diag';
|
||||
const API_NAME = 'metrics';
|
||||
/**
|
||||
* Singleton object which represents the entry point to the OpenTelemetry Metrics API
|
||||
*/
|
||||
export class MetricsAPI {
|
||||
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
||||
constructor() { }
|
||||
/** Get the singleton instance of the Metrics API */
|
||||
static getInstance() {
|
||||
if (!this._instance) {
|
||||
this._instance = new MetricsAPI();
|
||||
}
|
||||
return this._instance;
|
||||
}
|
||||
/**
|
||||
* Set the current global meter provider.
|
||||
* Returns true if the meter provider was successfully registered, else false.
|
||||
*/
|
||||
setGlobalMeterProvider(provider) {
|
||||
return registerGlobal(API_NAME, provider, DiagAPI.instance());
|
||||
}
|
||||
/**
|
||||
* Returns the global meter provider.
|
||||
*/
|
||||
getMeterProvider() {
|
||||
return getGlobal(API_NAME) || NOOP_METER_PROVIDER;
|
||||
}
|
||||
/**
|
||||
* Returns a meter from the global meter provider.
|
||||
*/
|
||||
getMeter(name, version, options) {
|
||||
return this.getMeterProvider().getMeter(name, version, options);
|
||||
}
|
||||
/** Remove the global meter provider */
|
||||
disable() {
|
||||
unregisterGlobal(API_NAME, DiagAPI.instance());
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=metrics.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/api/metrics.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/api/metrics.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../../src/api/metrics.ts"],"names":[],"mappings":"AAAA;;;GAGG;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\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Meter, MeterOptions } from '../metrics/Meter';\nimport type { MeterProvider } from '../metrics/MeterProvider';\nimport { NOOP_METER_PROVIDER } from '../metrics/NoopMeterProvider';\nimport {\n getGlobal,\n registerGlobal,\n unregisterGlobal,\n} from '../internal/global-utils';\nimport { DiagAPI } from './diag';\n\nconst API_NAME = 'metrics';\n\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Metrics API\n */\nexport class MetricsAPI {\n private static _instance?: MetricsAPI;\n\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n private constructor() {}\n\n /** Get the singleton instance of the Metrics API */\n public static getInstance(): MetricsAPI {\n if (!this._instance) {\n this._instance = new MetricsAPI();\n }\n\n return this._instance;\n }\n\n /**\n * Set the current global meter provider.\n * Returns true if the meter provider was successfully registered, else false.\n */\n public setGlobalMeterProvider(provider: MeterProvider): boolean {\n return registerGlobal(API_NAME, provider, DiagAPI.instance());\n }\n\n /**\n * Returns the global meter provider.\n */\n public getMeterProvider(): MeterProvider {\n return getGlobal(API_NAME) || NOOP_METER_PROVIDER;\n }\n\n /**\n * Returns a meter from the global meter provider.\n */\n public getMeter(\n name: string,\n version?: string,\n options?: MeterOptions\n ): Meter {\n return this.getMeterProvider().getMeter(name, version, options);\n }\n\n /** Remove the global meter provider */\n public disable(): void {\n unregisterGlobal(API_NAME, DiagAPI.instance());\n }\n}\n"]}
|
||||
51
node_modules/@opentelemetry/api/build/esm/api/propagation.d.ts
generated
vendored
Normal file
51
node_modules/@opentelemetry/api/build/esm/api/propagation.d.ts
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
import type { Context } from '../context/types';
|
||||
import type { TextMapGetter, TextMapPropagator, TextMapSetter } from '../propagation/TextMapPropagator';
|
||||
import { getBaggage, getActiveBaggage, setBaggage, deleteBaggage } from '../baggage/context-helpers';
|
||||
import { createBaggage } from '../baggage/utils';
|
||||
/**
|
||||
* Singleton object which represents the entry point to the OpenTelemetry Propagation API
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export declare class PropagationAPI {
|
||||
private static _instance?;
|
||||
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
||||
private constructor();
|
||||
/** Get the singleton instance of the Propagator API */
|
||||
static getInstance(): PropagationAPI;
|
||||
/**
|
||||
* Set the current propagator.
|
||||
*
|
||||
* @returns true if the propagator was successfully registered, else false
|
||||
*/
|
||||
setGlobalPropagator(propagator: TextMapPropagator): boolean;
|
||||
/**
|
||||
* Inject context into a carrier to be propagated inter-process
|
||||
*
|
||||
* @param context Context carrying tracing data to inject
|
||||
* @param carrier carrier to inject context into
|
||||
* @param setter Function used to set values on the carrier
|
||||
*/
|
||||
inject<Carrier>(context: Context, carrier: Carrier, setter?: TextMapSetter<Carrier>): void;
|
||||
/**
|
||||
* Extract context from a carrier
|
||||
*
|
||||
* @param context Context which the newly created context will inherit from
|
||||
* @param carrier Carrier to extract context from
|
||||
* @param getter Function used to extract keys from a carrier
|
||||
*/
|
||||
extract<Carrier>(context: Context, carrier: Carrier, getter?: TextMapGetter<Carrier>): Context;
|
||||
/**
|
||||
* Return a list of all fields which may be used by the propagator.
|
||||
*/
|
||||
fields(): string[];
|
||||
/** Remove the global propagator */
|
||||
disable(): void;
|
||||
createBaggage: typeof createBaggage;
|
||||
getBaggage: typeof getBaggage;
|
||||
getActiveBaggage: typeof getActiveBaggage;
|
||||
setBaggage: typeof setBaggage;
|
||||
deleteBaggage: typeof deleteBaggage;
|
||||
private _getGlobalPropagator;
|
||||
}
|
||||
//# sourceMappingURL=propagation.d.ts.map
|
||||
76
node_modules/@opentelemetry/api/build/esm/api/propagation.js
generated
vendored
Normal file
76
node_modules/@opentelemetry/api/build/esm/api/propagation.js
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
import { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';
|
||||
import { NoopTextMapPropagator } from '../propagation/NoopTextMapPropagator';
|
||||
import { defaultTextMapGetter, defaultTextMapSetter, } from '../propagation/TextMapPropagator';
|
||||
import { getBaggage, getActiveBaggage, setBaggage, deleteBaggage, } from '../baggage/context-helpers';
|
||||
import { createBaggage } from '../baggage/utils';
|
||||
import { DiagAPI } from './diag';
|
||||
const API_NAME = 'propagation';
|
||||
const NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator();
|
||||
/**
|
||||
* Singleton object which represents the entry point to the OpenTelemetry Propagation API
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export class PropagationAPI {
|
||||
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
||||
constructor() {
|
||||
this.createBaggage = createBaggage;
|
||||
this.getBaggage = getBaggage;
|
||||
this.getActiveBaggage = getActiveBaggage;
|
||||
this.setBaggage = setBaggage;
|
||||
this.deleteBaggage = deleteBaggage;
|
||||
}
|
||||
/** Get the singleton instance of the Propagator API */
|
||||
static getInstance() {
|
||||
if (!this._instance) {
|
||||
this._instance = new PropagationAPI();
|
||||
}
|
||||
return this._instance;
|
||||
}
|
||||
/**
|
||||
* Set the current propagator.
|
||||
*
|
||||
* @returns true if the propagator was successfully registered, else false
|
||||
*/
|
||||
setGlobalPropagator(propagator) {
|
||||
return registerGlobal(API_NAME, propagator, DiagAPI.instance());
|
||||
}
|
||||
/**
|
||||
* Inject context into a carrier to be propagated inter-process
|
||||
*
|
||||
* @param context Context carrying tracing data to inject
|
||||
* @param carrier carrier to inject context into
|
||||
* @param setter Function used to set values on the carrier
|
||||
*/
|
||||
inject(context, carrier, setter = defaultTextMapSetter) {
|
||||
return this._getGlobalPropagator().inject(context, carrier, setter);
|
||||
}
|
||||
/**
|
||||
* Extract context from a carrier
|
||||
*
|
||||
* @param context Context which the newly created context will inherit from
|
||||
* @param carrier Carrier to extract context from
|
||||
* @param getter Function used to extract keys from a carrier
|
||||
*/
|
||||
extract(context, carrier, getter = defaultTextMapGetter) {
|
||||
return this._getGlobalPropagator().extract(context, carrier, getter);
|
||||
}
|
||||
/**
|
||||
* Return a list of all fields which may be used by the propagator.
|
||||
*/
|
||||
fields() {
|
||||
return this._getGlobalPropagator().fields();
|
||||
}
|
||||
/** Remove the global propagator */
|
||||
disable() {
|
||||
unregisterGlobal(API_NAME, DiagAPI.instance());
|
||||
}
|
||||
_getGlobalPropagator() {
|
||||
return getGlobal(API_NAME) || NOOP_TEXT_MAP_PROPAGATOR;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=propagation.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/api/propagation.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/api/propagation.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"propagation.js","sourceRoot":"","sources":["../../../src/api/propagation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,SAAS,EACT,cAAc,EACd,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAM7E,OAAO,EACL,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,aAAa,GACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,MAAM,QAAQ,GAAG,aAAa,CAAC;AAC/B,MAAM,wBAAwB,GAAG,IAAI,qBAAqB,EAAE,CAAC;AAE7D;;;;GAIG;AACH,MAAM,OAAO,cAAc;IAGzB,+FAA+F;IAC/F;QA8DO,kBAAa,GAAG,aAAa,CAAC;QAE9B,eAAU,GAAG,UAAU,CAAC;QAExB,qBAAgB,GAAG,gBAAgB,CAAC;QAEpC,eAAU,GAAG,UAAU,CAAC;QAExB,kBAAa,GAAG,aAAa,CAAC;IAtEd,CAAC;IAExB,uDAAuD;IAChD,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,SAAS,GAAG,IAAI,cAAc,EAAE,CAAC;SACvC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACI,mBAAmB,CAAC,UAA6B;QACtD,OAAO,cAAc,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CACX,OAAgB,EAChB,OAAgB,EAChB,SAAiC,oBAAoB;QAErD,OAAO,IAAI,CAAC,oBAAoB,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;OAMG;IACI,OAAO,CACZ,OAAgB,EAChB,OAAgB,EAChB,SAAiC,oBAAoB;QAErD,OAAO,IAAI,CAAC,oBAAoB,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACvE,CAAC;IAED;;OAEG;IACI,MAAM;QACX,OAAO,IAAI,CAAC,oBAAoB,EAAE,CAAC,MAAM,EAAE,CAAC;IAC9C,CAAC;IAED,mCAAmC;IAC5B,OAAO;QACZ,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjD,CAAC;IAYO,oBAAoB;QAC1B,OAAO,SAAS,CAAC,QAAQ,CAAC,IAAI,wBAAwB,CAAC;IACzD,CAAC;CACF","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Context } from '../context/types';\nimport {\n getGlobal,\n registerGlobal,\n unregisterGlobal,\n} from '../internal/global-utils';\nimport { NoopTextMapPropagator } from '../propagation/NoopTextMapPropagator';\nimport type {\n TextMapGetter,\n TextMapPropagator,\n TextMapSetter,\n} from '../propagation/TextMapPropagator';\nimport {\n defaultTextMapGetter,\n defaultTextMapSetter,\n} from '../propagation/TextMapPropagator';\nimport {\n getBaggage,\n getActiveBaggage,\n setBaggage,\n deleteBaggage,\n} from '../baggage/context-helpers';\nimport { createBaggage } from '../baggage/utils';\nimport { DiagAPI } from './diag';\n\nconst API_NAME = 'propagation';\nconst NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator();\n\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Propagation API\n *\n * @since 1.0.0\n */\nexport class PropagationAPI {\n private static _instance?: PropagationAPI;\n\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n private constructor() {}\n\n /** Get the singleton instance of the Propagator API */\n public static getInstance(): PropagationAPI {\n if (!this._instance) {\n this._instance = new PropagationAPI();\n }\n\n return this._instance;\n }\n\n /**\n * Set the current propagator.\n *\n * @returns true if the propagator was successfully registered, else false\n */\n public setGlobalPropagator(propagator: TextMapPropagator): boolean {\n return registerGlobal(API_NAME, propagator, DiagAPI.instance());\n }\n\n /**\n * Inject context into a carrier to be propagated inter-process\n *\n * @param context Context carrying tracing data to inject\n * @param carrier carrier to inject context into\n * @param setter Function used to set values on the carrier\n */\n public inject<Carrier>(\n context: Context,\n carrier: Carrier,\n setter: TextMapSetter<Carrier> = defaultTextMapSetter\n ): void {\n return this._getGlobalPropagator().inject(context, carrier, setter);\n }\n\n /**\n * Extract context from a carrier\n *\n * @param context Context which the newly created context will inherit from\n * @param carrier Carrier to extract context from\n * @param getter Function used to extract keys from a carrier\n */\n public extract<Carrier>(\n context: Context,\n carrier: Carrier,\n getter: TextMapGetter<Carrier> = defaultTextMapGetter\n ): Context {\n return this._getGlobalPropagator().extract(context, carrier, getter);\n }\n\n /**\n * Return a list of all fields which may be used by the propagator.\n */\n public fields(): string[] {\n return this._getGlobalPropagator().fields();\n }\n\n /** Remove the global propagator */\n public disable() {\n unregisterGlobal(API_NAME, DiagAPI.instance());\n }\n\n public createBaggage = createBaggage;\n\n public getBaggage = getBaggage;\n\n public getActiveBaggage = getActiveBaggage;\n\n public setBaggage = setBaggage;\n\n public deleteBaggage = deleteBaggage;\n\n private _getGlobalPropagator(): TextMapPropagator {\n return getGlobal(API_NAME) || NOOP_TEXT_MAP_PROPAGATOR;\n }\n}\n"]}
|
||||
42
node_modules/@opentelemetry/api/build/esm/api/trace.d.ts
generated
vendored
Normal file
42
node_modules/@opentelemetry/api/build/esm/api/trace.d.ts
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
import { isSpanContextValid, wrapSpanContext } from '../trace/spancontext-utils';
|
||||
import type { Tracer } from '../trace/tracer';
|
||||
import type { TracerProvider } from '../trace/tracer_provider';
|
||||
import { deleteSpan, getActiveSpan, getSpan, getSpanContext, setSpan, setSpanContext } from '../trace/context-utils';
|
||||
/**
|
||||
* Singleton object which represents the entry point to the OpenTelemetry Tracing API
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export declare class TraceAPI {
|
||||
private static _instance?;
|
||||
private _proxyTracerProvider;
|
||||
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
||||
private constructor();
|
||||
/** Get the singleton instance of the Trace API */
|
||||
static getInstance(): TraceAPI;
|
||||
/**
|
||||
* Set the current global tracer.
|
||||
*
|
||||
* @returns true if the tracer provider was successfully registered, else false
|
||||
*/
|
||||
setGlobalTracerProvider(provider: TracerProvider): boolean;
|
||||
/**
|
||||
* Returns the global tracer provider.
|
||||
*/
|
||||
getTracerProvider(): TracerProvider;
|
||||
/**
|
||||
* Returns a tracer from the global tracer provider.
|
||||
*/
|
||||
getTracer(name: string, version?: string): Tracer;
|
||||
/** Remove the global tracer provider */
|
||||
disable(): void;
|
||||
wrapSpanContext: typeof wrapSpanContext;
|
||||
isSpanContextValid: typeof isSpanContextValid;
|
||||
deleteSpan: typeof deleteSpan;
|
||||
getSpan: typeof getSpan;
|
||||
getActiveSpan: typeof getActiveSpan;
|
||||
getSpanContext: typeof getSpanContext;
|
||||
setSpan: typeof setSpan;
|
||||
setSpanContext: typeof setSpanContext;
|
||||
}
|
||||
//# sourceMappingURL=trace.d.ts.map
|
||||
66
node_modules/@opentelemetry/api/build/esm/api/trace.js
generated
vendored
Normal file
66
node_modules/@opentelemetry/api/build/esm/api/trace.js
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
import { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';
|
||||
import { ProxyTracerProvider } from '../trace/ProxyTracerProvider';
|
||||
import { isSpanContextValid, wrapSpanContext, } from '../trace/spancontext-utils';
|
||||
import { deleteSpan, getActiveSpan, getSpan, getSpanContext, setSpan, setSpanContext, } from '../trace/context-utils';
|
||||
import { DiagAPI } from './diag';
|
||||
const API_NAME = 'trace';
|
||||
/**
|
||||
* Singleton object which represents the entry point to the OpenTelemetry Tracing API
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export class TraceAPI {
|
||||
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
||||
constructor() {
|
||||
this._proxyTracerProvider = new ProxyTracerProvider();
|
||||
this.wrapSpanContext = wrapSpanContext;
|
||||
this.isSpanContextValid = isSpanContextValid;
|
||||
this.deleteSpan = deleteSpan;
|
||||
this.getSpan = getSpan;
|
||||
this.getActiveSpan = getActiveSpan;
|
||||
this.getSpanContext = getSpanContext;
|
||||
this.setSpan = setSpan;
|
||||
this.setSpanContext = setSpanContext;
|
||||
}
|
||||
/** Get the singleton instance of the Trace API */
|
||||
static getInstance() {
|
||||
if (!this._instance) {
|
||||
this._instance = new TraceAPI();
|
||||
}
|
||||
return this._instance;
|
||||
}
|
||||
/**
|
||||
* Set the current global tracer.
|
||||
*
|
||||
* @returns true if the tracer provider was successfully registered, else false
|
||||
*/
|
||||
setGlobalTracerProvider(provider) {
|
||||
const success = registerGlobal(API_NAME, this._proxyTracerProvider, DiagAPI.instance());
|
||||
if (success) {
|
||||
this._proxyTracerProvider.setDelegate(provider);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
/**
|
||||
* Returns the global tracer provider.
|
||||
*/
|
||||
getTracerProvider() {
|
||||
return getGlobal(API_NAME) || this._proxyTracerProvider;
|
||||
}
|
||||
/**
|
||||
* Returns a tracer from the global tracer provider.
|
||||
*/
|
||||
getTracer(name, version) {
|
||||
return this.getTracerProvider().getTracer(name, version);
|
||||
}
|
||||
/** Remove the global tracer provider */
|
||||
disable() {
|
||||
unregisterGlobal(API_NAME, DiagAPI.instance());
|
||||
this._proxyTracerProvider = new ProxyTracerProvider();
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=trace.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/api/trace.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/api/trace.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../../../src/api/trace.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,SAAS,EACT,cAAc,EACd,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EACL,kBAAkB,EAClB,eAAe,GAChB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EACL,UAAU,EACV,aAAa,EACb,OAAO,EACP,cAAc,EACd,OAAO,EACP,cAAc,GACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,MAAM,QAAQ,GAAG,OAAO,CAAC;AAEzB;;;;GAIG;AACH,MAAM,OAAO,QAAQ;IAKnB,+FAA+F;IAC/F;QAHQ,yBAAoB,GAAG,IAAI,mBAAmB,EAAE,CAAC;QAmDlD,oBAAe,GAAG,eAAe,CAAC;QAElC,uBAAkB,GAAG,kBAAkB,CAAC;QAExC,eAAU,GAAG,UAAU,CAAC;QAExB,YAAO,GAAG,OAAO,CAAC;QAElB,kBAAa,GAAG,aAAa,CAAC;QAE9B,mBAAc,GAAG,cAAc,CAAC;QAEhC,YAAO,GAAG,OAAO,CAAC;QAElB,mBAAc,GAAG,cAAc,CAAC;IA9DhB,CAAC;IAExB,kDAAkD;IAC3C,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,SAAS,GAAG,IAAI,QAAQ,EAAE,CAAC;SACjC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACI,uBAAuB,CAAC,QAAwB;QACrD,MAAM,OAAO,GAAG,cAAc,CAC5B,QAAQ,EACR,IAAI,CAAC,oBAAoB,EACzB,OAAO,CAAC,QAAQ,EAAE,CACnB,CAAC;QACF,IAAI,OAAO,EAAE;YACX,IAAI,CAAC,oBAAoB,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;SACjD;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;OAEG;IACI,iBAAiB;QACtB,OAAO,SAAS,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,oBAAoB,CAAC;IAC1D,CAAC;IAED;;OAEG;IACI,SAAS,CAAC,IAAY,EAAE,OAAgB;QAC7C,OAAO,IAAI,CAAC,iBAAiB,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;IAED,wCAAwC;IACjC,OAAO;QACZ,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC/C,IAAI,CAAC,oBAAoB,GAAG,IAAI,mBAAmB,EAAE,CAAC;IACxD,CAAC;CAiBF","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n getGlobal,\n registerGlobal,\n unregisterGlobal,\n} from '../internal/global-utils';\nimport { ProxyTracerProvider } from '../trace/ProxyTracerProvider';\nimport {\n isSpanContextValid,\n wrapSpanContext,\n} from '../trace/spancontext-utils';\nimport type { Tracer } from '../trace/tracer';\nimport type { TracerProvider } from '../trace/tracer_provider';\nimport {\n deleteSpan,\n getActiveSpan,\n getSpan,\n getSpanContext,\n setSpan,\n setSpanContext,\n} from '../trace/context-utils';\nimport { DiagAPI } from './diag';\n\nconst API_NAME = 'trace';\n\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Tracing API\n *\n * @since 1.0.0\n */\nexport class TraceAPI {\n private static _instance?: TraceAPI;\n\n private _proxyTracerProvider = new ProxyTracerProvider();\n\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n private constructor() {}\n\n /** Get the singleton instance of the Trace API */\n public static getInstance(): TraceAPI {\n if (!this._instance) {\n this._instance = new TraceAPI();\n }\n\n return this._instance;\n }\n\n /**\n * Set the current global tracer.\n *\n * @returns true if the tracer provider was successfully registered, else false\n */\n public setGlobalTracerProvider(provider: TracerProvider): boolean {\n const success = registerGlobal(\n API_NAME,\n this._proxyTracerProvider,\n DiagAPI.instance()\n );\n if (success) {\n this._proxyTracerProvider.setDelegate(provider);\n }\n return success;\n }\n\n /**\n * Returns the global tracer provider.\n */\n public getTracerProvider(): TracerProvider {\n return getGlobal(API_NAME) || this._proxyTracerProvider;\n }\n\n /**\n * Returns a tracer from the global tracer provider.\n */\n public getTracer(name: string, version?: string): Tracer {\n return this.getTracerProvider().getTracer(name, version);\n }\n\n /** Remove the global tracer provider */\n public disable() {\n unregisterGlobal(API_NAME, DiagAPI.instance());\n this._proxyTracerProvider = new ProxyTracerProvider();\n }\n\n public wrapSpanContext = wrapSpanContext;\n\n public isSpanContextValid = isSpanContextValid;\n\n public deleteSpan = deleteSpan;\n\n public getSpan = getSpan;\n\n public getActiveSpan = getActiveSpan;\n\n public getSpanContext = getSpanContext;\n\n public setSpan = setSpan;\n\n public setSpanContext = setSpanContext;\n}\n"]}
|
||||
29
node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.d.ts
generated
vendored
Normal file
29
node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.d.ts
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { Context } from '../context/types';
|
||||
import type { Baggage } from './types';
|
||||
/**
|
||||
* Retrieve the current baggage from the given context
|
||||
*
|
||||
* @param {Context} Context that manage all context values
|
||||
* @returns {Baggage} Extracted baggage from the context
|
||||
*/
|
||||
export declare function getBaggage(context: Context): Baggage | undefined;
|
||||
/**
|
||||
* Retrieve the current baggage from the active/current context
|
||||
*
|
||||
* @returns {Baggage} Extracted baggage from the context
|
||||
*/
|
||||
export declare function getActiveBaggage(): Baggage | undefined;
|
||||
/**
|
||||
* Store a baggage in the given context
|
||||
*
|
||||
* @param {Context} Context that manage all context values
|
||||
* @param {Baggage} baggage that will be set in the actual context
|
||||
*/
|
||||
export declare function setBaggage(context: Context, baggage: Baggage): Context;
|
||||
/**
|
||||
* Delete the baggage stored in the given context
|
||||
*
|
||||
* @param {Context} Context that manage all context values
|
||||
*/
|
||||
export declare function deleteBaggage(context: Context): Context;
|
||||
//# sourceMappingURL=context-helpers.d.ts.map
|
||||
45
node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js
generated
vendored
Normal file
45
node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
import { ContextAPI } from '../api/context';
|
||||
import { createContextKey } from '../context/context';
|
||||
/**
|
||||
* Baggage key
|
||||
*/
|
||||
const BAGGAGE_KEY = createContextKey('OpenTelemetry Baggage Key');
|
||||
/**
|
||||
* Retrieve the current baggage from the given context
|
||||
*
|
||||
* @param {Context} Context that manage all context values
|
||||
* @returns {Baggage} Extracted baggage from the context
|
||||
*/
|
||||
export function getBaggage(context) {
|
||||
return context.getValue(BAGGAGE_KEY) || undefined;
|
||||
}
|
||||
/**
|
||||
* Retrieve the current baggage from the active/current context
|
||||
*
|
||||
* @returns {Baggage} Extracted baggage from the context
|
||||
*/
|
||||
export function getActiveBaggage() {
|
||||
return getBaggage(ContextAPI.getInstance().active());
|
||||
}
|
||||
/**
|
||||
* Store a baggage in the given context
|
||||
*
|
||||
* @param {Context} Context that manage all context values
|
||||
* @param {Baggage} baggage that will be set in the actual context
|
||||
*/
|
||||
export function setBaggage(context, baggage) {
|
||||
return context.setValue(BAGGAGE_KEY, baggage);
|
||||
}
|
||||
/**
|
||||
* Delete the baggage stored in the given context
|
||||
*
|
||||
* @param {Context} Context that manage all context values
|
||||
*/
|
||||
export function deleteBaggage(context) {
|
||||
return context.deleteValue(BAGGAGE_KEY);
|
||||
}
|
||||
//# sourceMappingURL=context-helpers.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"context-helpers.js","sourceRoot":"","sources":["../../../src/baggage/context-helpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD;;GAEG;AACH,MAAM,WAAW,GAAG,gBAAgB,CAAC,2BAA2B,CAAC,CAAC;AAElE;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,OAAgB;IACzC,OAAQ,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAa,IAAI,SAAS,CAAC;AACjE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,UAAU,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;AACvD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,OAAgB,EAAE,OAAgB;IAC3D,OAAO,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,OAAgB;IAC5C,OAAO,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { ContextAPI } from '../api/context';\nimport { createContextKey } from '../context/context';\nimport type { Context } from '../context/types';\nimport type { Baggage } from './types';\n\n/**\n * Baggage key\n */\nconst BAGGAGE_KEY = createContextKey('OpenTelemetry Baggage Key');\n\n/**\n * Retrieve the current baggage from the given context\n *\n * @param {Context} Context that manage all context values\n * @returns {Baggage} Extracted baggage from the context\n */\nexport function getBaggage(context: Context): Baggage | undefined {\n return (context.getValue(BAGGAGE_KEY) as Baggage) || undefined;\n}\n\n/**\n * Retrieve the current baggage from the active/current context\n *\n * @returns {Baggage} Extracted baggage from the context\n */\nexport function getActiveBaggage(): Baggage | undefined {\n return getBaggage(ContextAPI.getInstance().active());\n}\n\n/**\n * Store a baggage in the given context\n *\n * @param {Context} Context that manage all context values\n * @param {Baggage} baggage that will be set in the actual context\n */\nexport function setBaggage(context: Context, baggage: Baggage): Context {\n return context.setValue(BAGGAGE_KEY, baggage);\n}\n\n/**\n * Delete the baggage stored in the given context\n *\n * @param {Context} Context that manage all context values\n */\nexport function deleteBaggage(context: Context): Context {\n return context.deleteValue(BAGGAGE_KEY);\n}\n"]}
|
||||
12
node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.d.ts
generated
vendored
Normal file
12
node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import type { Baggage, BaggageEntry } from '../types';
|
||||
export declare class BaggageImpl implements Baggage {
|
||||
private _entries;
|
||||
constructor(entries?: Map<string, BaggageEntry>);
|
||||
getEntry(key: string): BaggageEntry | undefined;
|
||||
getAllEntries(): [string, BaggageEntry][];
|
||||
setEntry(key: string, entry: BaggageEntry): BaggageImpl;
|
||||
removeEntry(key: string): BaggageImpl;
|
||||
removeEntries(...keys: string[]): BaggageImpl;
|
||||
clear(): BaggageImpl;
|
||||
}
|
||||
//# sourceMappingURL=baggage-impl.d.ts.map
|
||||
40
node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js
generated
vendored
Normal file
40
node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
export class BaggageImpl {
|
||||
constructor(entries) {
|
||||
this._entries = entries ? new Map(entries) : new Map();
|
||||
}
|
||||
getEntry(key) {
|
||||
const entry = this._entries.get(key);
|
||||
if (!entry) {
|
||||
return undefined;
|
||||
}
|
||||
return Object.assign({}, entry);
|
||||
}
|
||||
getAllEntries() {
|
||||
return Array.from(this._entries.entries());
|
||||
}
|
||||
setEntry(key, entry) {
|
||||
const newBaggage = new BaggageImpl(this._entries);
|
||||
newBaggage._entries.set(key, entry);
|
||||
return newBaggage;
|
||||
}
|
||||
removeEntry(key) {
|
||||
const newBaggage = new BaggageImpl(this._entries);
|
||||
newBaggage._entries.delete(key);
|
||||
return newBaggage;
|
||||
}
|
||||
removeEntries(...keys) {
|
||||
const newBaggage = new BaggageImpl(this._entries);
|
||||
for (const key of keys) {
|
||||
newBaggage._entries.delete(key);
|
||||
}
|
||||
return newBaggage;
|
||||
}
|
||||
clear() {
|
||||
return new BaggageImpl();
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=baggage-impl.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"baggage-impl.js","sourceRoot":"","sources":["../../../../src/baggage/internal/baggage-impl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,OAAO,WAAW;IAGtB,YAAY,OAAmC;QAC7C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC;IACzD,CAAC;IAED,QAAQ,CAAC,GAAW;QAClB,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,CAAC,KAAK,EAAE;YACV,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,aAAa;QACX,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,QAAQ,CAAC,GAAW,EAAE,KAAmB;QACvC,MAAM,UAAU,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClD,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACpC,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,WAAW,CAAC,GAAW;QACrB,MAAM,UAAU,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClD,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAChC,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,aAAa,CAAC,GAAG,IAAc;QAC7B,MAAM,UAAU,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClD,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;YACtB,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SACjC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,KAAK;QACH,OAAO,IAAI,WAAW,EAAE,CAAC;IAC3B,CAAC;CACF","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Baggage, BaggageEntry } from '../types';\n\nexport class BaggageImpl implements Baggage {\n private _entries: Map<string, BaggageEntry>;\n\n constructor(entries?: Map<string, BaggageEntry>) {\n this._entries = entries ? new Map(entries) : new Map();\n }\n\n getEntry(key: string): BaggageEntry | undefined {\n const entry = this._entries.get(key);\n if (!entry) {\n return undefined;\n }\n\n return Object.assign({}, entry);\n }\n\n getAllEntries(): [string, BaggageEntry][] {\n return Array.from(this._entries.entries());\n }\n\n setEntry(key: string, entry: BaggageEntry): BaggageImpl {\n const newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.set(key, entry);\n return newBaggage;\n }\n\n removeEntry(key: string): BaggageImpl {\n const newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.delete(key);\n return newBaggage;\n }\n\n removeEntries(...keys: string[]): BaggageImpl {\n const newBaggage = new BaggageImpl(this._entries);\n for (const key of keys) {\n newBaggage._entries.delete(key);\n }\n return newBaggage;\n }\n\n clear(): BaggageImpl {\n return new BaggageImpl();\n }\n}\n"]}
|
||||
5
node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.d.ts
generated
vendored
Normal file
5
node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
* Symbol used to make BaggageEntryMetadata an opaque type
|
||||
*/
|
||||
export declare const baggageEntryMetadataSymbol: unique symbol;
|
||||
//# sourceMappingURL=symbol.d.ts.map
|
||||
9
node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.js
generated
vendored
Normal file
9
node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
/**
|
||||
* Symbol used to make BaggageEntryMetadata an opaque type
|
||||
*/
|
||||
export const baggageEntryMetadataSymbol = Symbol('BaggageEntryMetadata');
|
||||
//# sourceMappingURL=symbol.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"symbol.js","sourceRoot":"","sources":["../../../../src/baggage/internal/symbol.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * Symbol used to make BaggageEntryMetadata an opaque type\n */\nexport const baggageEntryMetadataSymbol = Symbol('BaggageEntryMetadata');\n"]}
|
||||
67
node_modules/@opentelemetry/api/build/esm/baggage/types.d.ts
generated
vendored
Normal file
67
node_modules/@opentelemetry/api/build/esm/baggage/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
import type { baggageEntryMetadataSymbol } from './internal/symbol';
|
||||
/**
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export interface BaggageEntry {
|
||||
/** `String` value of the `BaggageEntry`. */
|
||||
value: string;
|
||||
/**
|
||||
* Metadata is an optional string property defined by the W3C baggage specification.
|
||||
* It currently has no special meaning defined by the specification.
|
||||
*/
|
||||
metadata?: BaggageEntryMetadata;
|
||||
}
|
||||
/**
|
||||
* Serializable Metadata defined by the W3C baggage specification.
|
||||
* It currently has no special meaning defined by the OpenTelemetry or W3C.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export type BaggageEntryMetadata = {
|
||||
toString(): string;
|
||||
} & {
|
||||
__TYPE__: typeof baggageEntryMetadataSymbol;
|
||||
};
|
||||
/**
|
||||
* Baggage represents collection of key-value pairs with optional metadata.
|
||||
* Each key of Baggage is associated with exactly one value.
|
||||
* Baggage may be used to annotate and enrich telemetry data.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export interface Baggage {
|
||||
/**
|
||||
* Get an entry from Baggage if it exists
|
||||
*
|
||||
* @param key The key which identifies the BaggageEntry
|
||||
*/
|
||||
getEntry(key: string): BaggageEntry | undefined;
|
||||
/**
|
||||
* Get a list of all entries in the Baggage
|
||||
*/
|
||||
getAllEntries(): [string, BaggageEntry][];
|
||||
/**
|
||||
* Returns a new baggage with the entries from the current bag and the specified entry
|
||||
*
|
||||
* @param key string which identifies the baggage entry
|
||||
* @param entry BaggageEntry for the given key
|
||||
*/
|
||||
setEntry(key: string, entry: BaggageEntry): Baggage;
|
||||
/**
|
||||
* Returns a new baggage with the entries from the current bag except the removed entry
|
||||
*
|
||||
* @param key key identifying the entry to be removed
|
||||
*/
|
||||
removeEntry(key: string): Baggage;
|
||||
/**
|
||||
* Returns a new baggage with the entries from the current bag except the removed entries
|
||||
*
|
||||
* @param key keys identifying the entries to be removed
|
||||
*/
|
||||
removeEntries(...key: string[]): Baggage;
|
||||
/**
|
||||
* Returns a new baggage with no entries
|
||||
*/
|
||||
clear(): Baggage;
|
||||
}
|
||||
//# sourceMappingURL=types.d.ts.map
|
||||
6
node_modules/@opentelemetry/api/build/esm/baggage/types.js
generated
vendored
Normal file
6
node_modules/@opentelemetry/api/build/esm/baggage/types.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
export {};
|
||||
//# sourceMappingURL=types.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/baggage/types.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/baggage/types.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/baggage/types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { baggageEntryMetadataSymbol } from './internal/symbol';\n\n/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @since 1.0.0\n */\nexport interface BaggageEntry {\n /** `String` value of the `BaggageEntry`. */\n value: string;\n /**\n * Metadata is an optional string property defined by the W3C baggage specification.\n * It currently has no special meaning defined by the specification.\n */\n metadata?: BaggageEntryMetadata;\n}\n\n/**\n * Serializable Metadata defined by the W3C baggage specification.\n * It currently has no special meaning defined by the OpenTelemetry or W3C.\n *\n * @since 1.0.0\n */\nexport type BaggageEntryMetadata = { toString(): string } & {\n __TYPE__: typeof baggageEntryMetadataSymbol;\n};\n\n/**\n * Baggage represents collection of key-value pairs with optional metadata.\n * Each key of Baggage is associated with exactly one value.\n * Baggage may be used to annotate and enrich telemetry data.\n *\n * @since 1.0.0\n */\nexport interface Baggage {\n /**\n * Get an entry from Baggage if it exists\n *\n * @param key The key which identifies the BaggageEntry\n */\n getEntry(key: string): BaggageEntry | undefined;\n\n /**\n * Get a list of all entries in the Baggage\n */\n getAllEntries(): [string, BaggageEntry][];\n\n /**\n * Returns a new baggage with the entries from the current bag and the specified entry\n *\n * @param key string which identifies the baggage entry\n * @param entry BaggageEntry for the given key\n */\n setEntry(key: string, entry: BaggageEntry): Baggage;\n\n /**\n * Returns a new baggage with the entries from the current bag except the removed entry\n *\n * @param key key identifying the entry to be removed\n */\n removeEntry(key: string): Baggage;\n\n /**\n * Returns a new baggage with the entries from the current bag except the removed entries\n *\n * @param key keys identifying the entries to be removed\n */\n removeEntries(...key: string[]): Baggage;\n\n /**\n * Returns a new baggage with no entries\n */\n clear(): Baggage;\n}\n"]}
|
||||
16
node_modules/@opentelemetry/api/build/esm/baggage/utils.d.ts
generated
vendored
Normal file
16
node_modules/@opentelemetry/api/build/esm/baggage/utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import type { Baggage, BaggageEntry, BaggageEntryMetadata } from './types';
|
||||
/**
|
||||
* Create a new Baggage with optional entries
|
||||
*
|
||||
* @param entries An array of baggage entries the new baggage should contain
|
||||
*/
|
||||
export declare function createBaggage(entries?: Record<string, BaggageEntry>): Baggage;
|
||||
/**
|
||||
* Create a serializable BaggageEntryMetadata object from a string.
|
||||
*
|
||||
* @param str string metadata. Format is currently not defined by the spec and has no special meaning.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export declare function baggageEntryMetadataFromString(str: string): BaggageEntryMetadata;
|
||||
//# sourceMappingURL=utils.d.ts.map
|
||||
36
node_modules/@opentelemetry/api/build/esm/baggage/utils.js
generated
vendored
Normal file
36
node_modules/@opentelemetry/api/build/esm/baggage/utils.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
import { DiagAPI } from '../api/diag';
|
||||
import { BaggageImpl } from './internal/baggage-impl';
|
||||
import { baggageEntryMetadataSymbol } from './internal/symbol';
|
||||
const diag = DiagAPI.instance();
|
||||
/**
|
||||
* Create a new Baggage with optional entries
|
||||
*
|
||||
* @param entries An array of baggage entries the new baggage should contain
|
||||
*/
|
||||
export function createBaggage(entries = {}) {
|
||||
return new BaggageImpl(new Map(Object.entries(entries)));
|
||||
}
|
||||
/**
|
||||
* Create a serializable BaggageEntryMetadata object from a string.
|
||||
*
|
||||
* @param str string metadata. Format is currently not defined by the spec and has no special meaning.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export function baggageEntryMetadataFromString(str) {
|
||||
if (typeof str !== 'string') {
|
||||
diag.error(`Cannot create baggage metadata from unknown type: ${typeof str}`);
|
||||
str = '';
|
||||
}
|
||||
return {
|
||||
__TYPE__: baggageEntryMetadataSymbol,
|
||||
toString() {
|
||||
return str;
|
||||
},
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=utils.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/baggage/utils.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/baggage/utils.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/baggage/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAG/D,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;AAEhC;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAC3B,UAAwC,EAAE;IAE1C,OAAO,IAAI,WAAW,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,8BAA8B,CAC5C,GAAW;IAEX,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3B,IAAI,CAAC,KAAK,CACR,qDAAqD,OAAO,GAAG,EAAE,CAClE,CAAC;QACF,GAAG,GAAG,EAAE,CAAC;KACV;IAED,OAAO;QACL,QAAQ,EAAE,0BAA0B;QACpC,QAAQ;YACN,OAAO,GAAG,CAAC;QACb,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DiagAPI } from '../api/diag';\nimport { BaggageImpl } from './internal/baggage-impl';\nimport { baggageEntryMetadataSymbol } from './internal/symbol';\nimport type { Baggage, BaggageEntry, BaggageEntryMetadata } from './types';\n\nconst diag = DiagAPI.instance();\n\n/**\n * Create a new Baggage with optional entries\n *\n * @param entries An array of baggage entries the new baggage should contain\n */\nexport function createBaggage(\n entries: Record<string, BaggageEntry> = {}\n): Baggage {\n return new BaggageImpl(new Map(Object.entries(entries)));\n}\n\n/**\n * Create a serializable BaggageEntryMetadata object from a string.\n *\n * @param str string metadata. Format is currently not defined by the spec and has no special meaning.\n *\n * @since 1.0.0\n */\nexport function baggageEntryMetadataFromString(\n str: string\n): BaggageEntryMetadata {\n if (typeof str !== 'string') {\n diag.error(\n `Cannot create baggage metadata from unknown type: ${typeof str}`\n );\n str = '';\n }\n\n return {\n __TYPE__: baggageEntryMetadataSymbol,\n toString() {\n return str;\n },\n };\n}\n"]}
|
||||
19
node_modules/@opentelemetry/api/build/esm/common/Attributes.d.ts
generated
vendored
Normal file
19
node_modules/@opentelemetry/api/build/esm/common/Attributes.d.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Attributes is a map from string to attribute values.
|
||||
*
|
||||
* Note: only the own enumerable keys are counted as valid attribute keys.
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export interface Attributes {
|
||||
[attributeKey: string]: AttributeValue | undefined;
|
||||
}
|
||||
/**
|
||||
* Attribute values may be any non-nullish primitive value except an object.
|
||||
*
|
||||
* null or undefined attribute values are invalid and will result in undefined behavior.
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export type AttributeValue = string | number | boolean | Array<null | undefined | string> | Array<null | undefined | number> | Array<null | undefined | boolean>;
|
||||
//# sourceMappingURL=Attributes.d.ts.map
|
||||
6
node_modules/@opentelemetry/api/build/esm/common/Attributes.js
generated
vendored
Normal file
6
node_modules/@opentelemetry/api/build/esm/common/Attributes.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
export {};
|
||||
//# sourceMappingURL=Attributes.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/common/Attributes.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/common/Attributes.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Attributes.js","sourceRoot":"","sources":["../../../src/common/Attributes.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * Attributes is a map from string to attribute values.\n *\n * Note: only the own enumerable keys are counted as valid attribute keys.\n *\n * @since 1.3.0\n */\nexport interface Attributes {\n [attributeKey: string]: AttributeValue | undefined;\n}\n\n/**\n * Attribute values may be any non-nullish primitive value except an object.\n *\n * null or undefined attribute values are invalid and will result in undefined behavior.\n *\n * @since 1.3.0\n */\nexport type AttributeValue =\n | string\n | number\n | boolean\n | Array<null | undefined | string>\n | Array<null | undefined | number>\n | Array<null | undefined | boolean>;\n"]}
|
||||
28
node_modules/@opentelemetry/api/build/esm/common/Exception.d.ts
generated
vendored
Normal file
28
node_modules/@opentelemetry/api/build/esm/common/Exception.d.ts
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
interface ExceptionWithCode {
|
||||
code: string | number;
|
||||
name?: string;
|
||||
message?: string;
|
||||
stack?: string;
|
||||
}
|
||||
interface ExceptionWithMessage {
|
||||
code?: string | number;
|
||||
message: string;
|
||||
name?: string;
|
||||
stack?: string;
|
||||
}
|
||||
interface ExceptionWithName {
|
||||
code?: string | number;
|
||||
message?: string;
|
||||
name: string;
|
||||
stack?: string;
|
||||
}
|
||||
/**
|
||||
* Defines Exception.
|
||||
*
|
||||
* string or an object with one of (message or name or code) and optional stack
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export type Exception = ExceptionWithCode | ExceptionWithMessage | ExceptionWithName | string;
|
||||
export {};
|
||||
//# sourceMappingURL=Exception.d.ts.map
|
||||
6
node_modules/@opentelemetry/api/build/esm/common/Exception.js
generated
vendored
Normal file
6
node_modules/@opentelemetry/api/build/esm/common/Exception.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
export {};
|
||||
//# sourceMappingURL=Exception.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/common/Exception.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/common/Exception.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Exception.js","sourceRoot":"","sources":["../../../src/common/Exception.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\ninterface ExceptionWithCode {\n code: string | number;\n name?: string;\n message?: string;\n stack?: string;\n}\n\ninterface ExceptionWithMessage {\n code?: string | number;\n message: string;\n name?: string;\n stack?: string;\n}\n\ninterface ExceptionWithName {\n code?: string | number;\n message?: string;\n name: string;\n stack?: string;\n}\n\n/**\n * Defines Exception.\n *\n * string or an object with one of (message or name or code) and optional stack\n *\n * @since 1.0.0\n */\nexport type Exception =\n | ExceptionWithCode\n | ExceptionWithMessage\n | ExceptionWithName\n | string;\n"]}
|
||||
24
node_modules/@opentelemetry/api/build/esm/common/Time.d.ts
generated
vendored
Normal file
24
node_modules/@opentelemetry/api/build/esm/common/Time.d.ts
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Defines High-Resolution Time.
|
||||
*
|
||||
* The first number, HrTime[0], is UNIX Epoch time in seconds since 00:00:00 UTC on 1 January 1970.
|
||||
* The second number, HrTime[1], represents the partial second elapsed since Unix Epoch time represented by first number in nanoseconds.
|
||||
* For example, 2021-01-01T12:30:10.150Z in UNIX Epoch time in milliseconds is represented as 1609504210150.
|
||||
* The first number is calculated by converting and truncating the Epoch time in milliseconds to seconds:
|
||||
* HrTime[0] = Math.trunc(1609504210150 / 1000) = 1609504210.
|
||||
* The second number is calculated by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds:
|
||||
* HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * 1e9 = 150000000.
|
||||
* This is represented in HrTime format as [1609504210, 150000000].
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export type HrTime = [number, number];
|
||||
/**
|
||||
* Defines TimeInput.
|
||||
*
|
||||
* hrtime, epoch milliseconds, performance.now() or Date
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export type TimeInput = HrTime | number | Date;
|
||||
//# sourceMappingURL=Time.d.ts.map
|
||||
2
node_modules/@opentelemetry/api/build/esm/common/Time.js
generated
vendored
Normal file
2
node_modules/@opentelemetry/api/build/esm/common/Time.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export {};
|
||||
//# sourceMappingURL=Time.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/common/Time.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/common/Time.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Time.js","sourceRoot":"","sources":["../../../src/common/Time.ts"],"names":[],"mappings":"","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * Defines High-Resolution Time.\n *\n * The first number, HrTime[0], is UNIX Epoch time in seconds since 00:00:00 UTC on 1 January 1970.\n * The second number, HrTime[1], represents the partial second elapsed since Unix Epoch time represented by first number in nanoseconds.\n * For example, 2021-01-01T12:30:10.150Z in UNIX Epoch time in milliseconds is represented as 1609504210150.\n * The first number is calculated by converting and truncating the Epoch time in milliseconds to seconds:\n * HrTime[0] = Math.trunc(1609504210150 / 1000) = 1609504210.\n * The second number is calculated by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds:\n * HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * 1e9 = 150000000.\n * This is represented in HrTime format as [1609504210, 150000000].\n *\n * @since 1.0.0\n */\nexport type HrTime = [number, number];\n\n/**\n * Defines TimeInput.\n *\n * hrtime, epoch milliseconds, performance.now() or Date\n *\n * @since 1.0.0\n */\nexport type TimeInput = HrTime | number | Date;\n"]}
|
||||
7
node_modules/@opentelemetry/api/build/esm/context-api.d.ts
generated
vendored
Normal file
7
node_modules/@opentelemetry/api/build/esm/context-api.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import { ContextAPI } from './api/context';
|
||||
/**
|
||||
* Entrypoint for context API
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export declare const context: ContextAPI;
|
||||
//# sourceMappingURL=context-api.d.ts.map
|
||||
13
node_modules/@opentelemetry/api/build/esm/context-api.js
generated
vendored
Normal file
13
node_modules/@opentelemetry/api/build/esm/context-api.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
// Split module-level variable definition into separate files to allow
|
||||
// tree-shaking on each api instance.
|
||||
import { ContextAPI } from './api/context';
|
||||
/**
|
||||
* Entrypoint for context API
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export const context = ContextAPI.getInstance();
|
||||
//# sourceMappingURL=context-api.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/context-api.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/context-api.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"context-api.js","sourceRoot":"","sources":["../../src/context-api.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,sEAAsE;AACtE,qCAAqC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C;;;GAGG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { ContextAPI } from './api/context';\n/**\n * Entrypoint for context API\n * @since 1.0.0\n */\nexport const context = ContextAPI.getInstance();\n"]}
|
||||
9
node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.d.ts
generated
vendored
Normal file
9
node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import type * as types from './types';
|
||||
export declare class NoopContextManager implements types.ContextManager {
|
||||
active(): types.Context;
|
||||
with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(_context: types.Context, fn: F, thisArg?: ThisParameterType<F>, ...args: A): ReturnType<F>;
|
||||
bind<T>(_context: types.Context, target: T): T;
|
||||
enable(): this;
|
||||
disable(): this;
|
||||
}
|
||||
//# sourceMappingURL=NoopContextManager.d.ts.map
|
||||
23
node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js
generated
vendored
Normal file
23
node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
import { ROOT_CONTEXT } from './context';
|
||||
export class NoopContextManager {
|
||||
active() {
|
||||
return ROOT_CONTEXT;
|
||||
}
|
||||
with(_context, fn, thisArg, ...args) {
|
||||
return fn.call(thisArg, ...args);
|
||||
}
|
||||
bind(_context, target) {
|
||||
return target;
|
||||
}
|
||||
enable() {
|
||||
return this;
|
||||
}
|
||||
disable() {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=NoopContextManager.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"NoopContextManager.js","sourceRoot":"","sources":["../../../src/context/NoopContextManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzC,MAAM,OAAO,kBAAkB;IAC7B,MAAM;QACJ,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,IAAI,CACF,QAAuB,EACvB,EAAK,EACL,OAA8B,EAC9B,GAAG,IAAO;QAEV,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,IAAI,CAAI,QAAuB,EAAE,MAAS;QACxC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { ROOT_CONTEXT } from './context';\nimport type * as types from './types';\n\nexport class NoopContextManager implements types.ContextManager {\n active(): types.Context {\n return ROOT_CONTEXT;\n }\n\n with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(\n _context: types.Context,\n fn: F,\n thisArg?: ThisParameterType<F>,\n ...args: A\n ): ReturnType<F> {\n return fn.call(thisArg, ...args);\n }\n\n bind<T>(_context: types.Context, target: T): T {\n return target;\n }\n\n enable(): this {\n return this;\n }\n\n disable(): this {\n return this;\n }\n}\n"]}
|
||||
14
node_modules/@opentelemetry/api/build/esm/context/context.d.ts
generated
vendored
Normal file
14
node_modules/@opentelemetry/api/build/esm/context/context.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { Context } from './types';
|
||||
/**
|
||||
* Get a key to uniquely identify a context value
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export declare function createContextKey(description: string): symbol;
|
||||
/**
|
||||
* The root context is used as the default parent context when there is no active context
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export declare const ROOT_CONTEXT: Context;
|
||||
//# sourceMappingURL=context.d.ts.map
|
||||
48
node_modules/@opentelemetry/api/build/esm/context/context.js
generated
vendored
Normal file
48
node_modules/@opentelemetry/api/build/esm/context/context.js
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
/**
|
||||
* Get a key to uniquely identify a context value
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export function createContextKey(description) {
|
||||
// The specification states that for the same input, multiple calls should
|
||||
// return different keys. Due to the nature of the JS dependency management
|
||||
// system, this creates problems where multiple versions of some package
|
||||
// could hold different keys for the same property.
|
||||
//
|
||||
// Therefore, we use Symbol.for which returns the same key for the same input.
|
||||
return Symbol.for(description);
|
||||
}
|
||||
class BaseContext {
|
||||
/**
|
||||
* Construct a new context which inherits values from an optional parent context.
|
||||
*
|
||||
* @param parentContext a context from which to inherit values
|
||||
*/
|
||||
constructor(parentContext) {
|
||||
// for minification
|
||||
const self = this;
|
||||
self._currentContext = parentContext ? new Map(parentContext) : new Map();
|
||||
self.getValue = (key) => self._currentContext.get(key);
|
||||
self.setValue = (key, value) => {
|
||||
const context = new BaseContext(self._currentContext);
|
||||
context._currentContext.set(key, value);
|
||||
return context;
|
||||
};
|
||||
self.deleteValue = (key) => {
|
||||
const context = new BaseContext(self._currentContext);
|
||||
context._currentContext.delete(key);
|
||||
return context;
|
||||
};
|
||||
}
|
||||
}
|
||||
/**
|
||||
* The root context is used as the default parent context when there is no active context
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export const ROOT_CONTEXT = new BaseContext();
|
||||
//# sourceMappingURL=context.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/context/context.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/context/context.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/context/context.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,WAAmB;IAClD,0EAA0E;IAC1E,2EAA2E;IAC3E,wEAAwE;IACxE,mDAAmD;IACnD,EAAE;IACF,8EAA8E;IAC9E,OAAO,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,WAAW;IAGf;;;;OAIG;IACH,YAAY,aAAoC;QAC9C,mBAAmB;QACnB,MAAM,IAAI,GAAG,IAAI,CAAC;QAElB,IAAI,CAAC,eAAe,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC;QAE1E,IAAI,CAAC,QAAQ,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAE/D,IAAI,CAAC,QAAQ,GAAG,CAAC,GAAW,EAAE,KAAc,EAAW,EAAE;YACvD,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACtD,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YACxC,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC;QAEF,IAAI,CAAC,WAAW,GAAG,CAAC,GAAW,EAAW,EAAE;YAC1C,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACtD,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACpC,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC;IACJ,CAAC;CAyBF;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAY,IAAI,WAAW,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Context } from './types';\n\n/**\n * Get a key to uniquely identify a context value\n *\n * @since 1.0.0\n */\nexport function createContextKey(description: string) {\n // The specification states that for the same input, multiple calls should\n // return different keys. Due to the nature of the JS dependency management\n // system, this creates problems where multiple versions of some package\n // could hold different keys for the same property.\n //\n // Therefore, we use Symbol.for which returns the same key for the same input.\n return Symbol.for(description);\n}\n\nclass BaseContext implements Context {\n private _currentContext!: Map<symbol, unknown>;\n\n /**\n * Construct a new context which inherits values from an optional parent context.\n *\n * @param parentContext a context from which to inherit values\n */\n constructor(parentContext?: Map<symbol, unknown>) {\n // for minification\n const self = this;\n\n self._currentContext = parentContext ? new Map(parentContext) : new Map();\n\n self.getValue = (key: symbol) => self._currentContext.get(key);\n\n self.setValue = (key: symbol, value: unknown): Context => {\n const context = new BaseContext(self._currentContext);\n context._currentContext.set(key, value);\n return context;\n };\n\n self.deleteValue = (key: symbol): Context => {\n const context = new BaseContext(self._currentContext);\n context._currentContext.delete(key);\n return context;\n };\n }\n\n /**\n * Get a value from the context.\n *\n * @param key key which identifies a context value\n */\n public getValue!: (key: symbol) => unknown;\n\n /**\n * Create a new context which inherits from this context and has\n * the given key set to the given value.\n *\n * @param key context key for which to set the value\n * @param value value to set for the given key\n */\n public setValue!: (key: symbol, value: unknown) => Context;\n\n /**\n * Return a new context which inherits from this context but does\n * not contain a value for the given key.\n *\n * @param key context key for which to clear a value\n */\n public deleteValue!: (key: symbol) => Context;\n}\n\n/**\n * The root context is used as the default parent context when there is no active context\n *\n * @since 1.0.0\n */\nexport const ROOT_CONTEXT: Context = new BaseContext();\n"]}
|
||||
58
node_modules/@opentelemetry/api/build/esm/context/types.d.ts
generated
vendored
Normal file
58
node_modules/@opentelemetry/api/build/esm/context/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export interface Context {
|
||||
/**
|
||||
* Get a value from the context.
|
||||
*
|
||||
* @param key key which identifies a context value
|
||||
*/
|
||||
getValue(key: symbol): unknown;
|
||||
/**
|
||||
* Create a new context which inherits from this context and has
|
||||
* the given key set to the given value.
|
||||
*
|
||||
* @param key context key for which to set the value
|
||||
* @param value value to set for the given key
|
||||
*/
|
||||
setValue(key: symbol, value: unknown): Context;
|
||||
/**
|
||||
* Return a new context which inherits from this context but does
|
||||
* not contain a value for the given key.
|
||||
*
|
||||
* @param key context key for which to clear a value
|
||||
*/
|
||||
deleteValue(key: symbol): Context;
|
||||
}
|
||||
/**
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export interface ContextManager {
|
||||
/**
|
||||
* Get the current active context
|
||||
*/
|
||||
active(): Context;
|
||||
/**
|
||||
* Run the fn callback with object set as the current active context
|
||||
* @param context Any object to set as the current active context
|
||||
* @param fn A callback to be immediately run within a specific context
|
||||
* @param thisArg optional receiver to be used for calling fn
|
||||
* @param args optional arguments forwarded to fn
|
||||
*/
|
||||
with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(context: Context, fn: F, thisArg?: ThisParameterType<F>, ...args: A): ReturnType<F>;
|
||||
/**
|
||||
* Bind an object as the current context (or a specific one)
|
||||
* @param [context] Optionally specify the context which you want to assign
|
||||
* @param target Any object to which a context need to be set
|
||||
*/
|
||||
bind<T>(context: Context, target: T): T;
|
||||
/**
|
||||
* Enable context management
|
||||
*/
|
||||
enable(): this;
|
||||
/**
|
||||
* Disable context management
|
||||
*/
|
||||
disable(): this;
|
||||
}
|
||||
//# sourceMappingURL=types.d.ts.map
|
||||
6
node_modules/@opentelemetry/api/build/esm/context/types.js
generated
vendored
Normal file
6
node_modules/@opentelemetry/api/build/esm/context/types.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
export {};
|
||||
//# sourceMappingURL=types.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/context/types.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/context/types.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/context/types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @since 1.0.0\n */\nexport interface Context {\n /**\n * Get a value from the context.\n *\n * @param key key which identifies a context value\n */\n getValue(key: symbol): unknown;\n\n /**\n * Create a new context which inherits from this context and has\n * the given key set to the given value.\n *\n * @param key context key for which to set the value\n * @param value value to set for the given key\n */\n setValue(key: symbol, value: unknown): Context;\n\n /**\n * Return a new context which inherits from this context but does\n * not contain a value for the given key.\n *\n * @param key context key for which to clear a value\n */\n deleteValue(key: symbol): Context;\n}\n\n/**\n * @since 1.0.0\n */\nexport interface ContextManager {\n /**\n * Get the current active context\n */\n active(): Context;\n\n /**\n * Run the fn callback with object set as the current active context\n * @param context Any object to set as the current active context\n * @param fn A callback to be immediately run within a specific context\n * @param thisArg optional receiver to be used for calling fn\n * @param args optional arguments forwarded to fn\n */\n with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(\n context: Context,\n fn: F,\n thisArg?: ThisParameterType<F>,\n ...args: A\n ): ReturnType<F>;\n\n /**\n * Bind an object as the current context (or a specific one)\n * @param [context] Optionally specify the context which you want to assign\n * @param target Any object to which a context need to be set\n */\n bind<T>(context: Context, target: T): T;\n\n /**\n * Enable context management\n */\n enable(): this;\n\n /**\n * Disable context management\n */\n disable(): this;\n}\n"]}
|
||||
11
node_modules/@opentelemetry/api/build/esm/diag-api.d.ts
generated
vendored
Normal file
11
node_modules/@opentelemetry/api/build/esm/diag-api.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { DiagAPI } from './api/diag';
|
||||
/**
|
||||
* Entrypoint for Diag API.
|
||||
* Defines Diagnostic handler used for internal diagnostic logging operations.
|
||||
* The default provides a Noop DiagLogger implementation which may be changed via the
|
||||
* diag.setLogger(logger: DiagLogger) function.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export declare const diag: DiagAPI;
|
||||
//# sourceMappingURL=diag-api.d.ts.map
|
||||
17
node_modules/@opentelemetry/api/build/esm/diag-api.js
generated
vendored
Normal file
17
node_modules/@opentelemetry/api/build/esm/diag-api.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
// Split module-level variable definition into separate files to allow
|
||||
// tree-shaking on each api instance.
|
||||
import { DiagAPI } from './api/diag';
|
||||
/**
|
||||
* Entrypoint for Diag API.
|
||||
* Defines Diagnostic handler used for internal diagnostic logging operations.
|
||||
* The default provides a Noop DiagLogger implementation which may be changed via the
|
||||
* diag.setLogger(logger: DiagLogger) function.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export const diag = DiagAPI.instance();
|
||||
//# sourceMappingURL=diag-api.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/diag-api.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/diag-api.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"diag-api.js","sourceRoot":"","sources":["../../src/diag-api.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,sEAAsE;AACtE,qCAAqC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { DiagAPI } from './api/diag';\n/**\n * Entrypoint for Diag API.\n * Defines Diagnostic handler used for internal diagnostic logging operations.\n * The default provides a Noop DiagLogger implementation which may be changed via the\n * diag.setLogger(logger: DiagLogger) function.\n *\n * @since 1.0.0\n */\nexport const diag = DiagAPI.instance();\n"]}
|
||||
20
node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.d.ts
generated
vendored
Normal file
20
node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.d.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import type { ComponentLoggerOptions, DiagLogger } from './types';
|
||||
/**
|
||||
* Component Logger which is meant to be used as part of any component which
|
||||
* will add automatically additional namespace in front of the log message.
|
||||
* It will then forward all message to global diag logger
|
||||
* @example
|
||||
* const cLogger = diag.createComponentLogger({ namespace: '@opentelemetry/instrumentation-http' });
|
||||
* cLogger.debug('test');
|
||||
* // @opentelemetry/instrumentation-http test
|
||||
*/
|
||||
export declare class DiagComponentLogger implements DiagLogger {
|
||||
private _namespace;
|
||||
constructor(props: ComponentLoggerOptions);
|
||||
debug(...args: unknown[]): void;
|
||||
error(...args: unknown[]): void;
|
||||
info(...args: unknown[]): void;
|
||||
warn(...args: unknown[]): void;
|
||||
verbose(...args: unknown[]): void;
|
||||
}
|
||||
//# sourceMappingURL=ComponentLogger.d.ts.map
|
||||
43
node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js
generated
vendored
Normal file
43
node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
import { getGlobal } from '../internal/global-utils';
|
||||
/**
|
||||
* Component Logger which is meant to be used as part of any component which
|
||||
* will add automatically additional namespace in front of the log message.
|
||||
* It will then forward all message to global diag logger
|
||||
* @example
|
||||
* const cLogger = diag.createComponentLogger({ namespace: '@opentelemetry/instrumentation-http' });
|
||||
* cLogger.debug('test');
|
||||
* // @opentelemetry/instrumentation-http test
|
||||
*/
|
||||
export class DiagComponentLogger {
|
||||
constructor(props) {
|
||||
this._namespace = props.namespace || 'DiagComponentLogger';
|
||||
}
|
||||
debug(...args) {
|
||||
return logProxy('debug', this._namespace, args);
|
||||
}
|
||||
error(...args) {
|
||||
return logProxy('error', this._namespace, args);
|
||||
}
|
||||
info(...args) {
|
||||
return logProxy('info', this._namespace, args);
|
||||
}
|
||||
warn(...args) {
|
||||
return logProxy('warn', this._namespace, args);
|
||||
}
|
||||
verbose(...args) {
|
||||
return logProxy('verbose', this._namespace, args);
|
||||
}
|
||||
}
|
||||
function logProxy(funcName, namespace, args) {
|
||||
const logger = getGlobal('diag');
|
||||
// shortcut if logger not set
|
||||
if (!logger) {
|
||||
return;
|
||||
}
|
||||
return logger[funcName](namespace, ...args);
|
||||
}
|
||||
//# sourceMappingURL=ComponentLogger.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ComponentLogger.js","sourceRoot":"","sources":["../../../src/diag/ComponentLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAGrD;;;;;;;;GAQG;AACH,MAAM,OAAO,mBAAmB;IAG9B,YAAY,KAA6B;QACvC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,SAAS,IAAI,qBAAqB,CAAC;IAC7D,CAAC;IAEM,KAAK,CAAC,GAAG,IAAe;QAC7B,OAAO,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAClD,CAAC;IAEM,KAAK,CAAC,GAAG,IAAe;QAC7B,OAAO,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAClD,CAAC;IAEM,IAAI,CAAC,GAAG,IAAe;QAC5B,OAAO,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACjD,CAAC;IAEM,IAAI,CAAC,GAAG,IAAe;QAC5B,OAAO,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACjD,CAAC;IAEM,OAAO,CAAC,GAAG,IAAe;QAC/B,OAAO,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;CACF;AAED,SAAS,QAAQ,CACf,QAA0B,EAC1B,SAAiB,EACjB,IAAe;IAEf,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IACjC,6BAA6B;IAC7B,IAAI,CAAC,MAAM,EAAE;QACX,OAAO;KACR;IAED,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,CAAC;AAC9C,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { getGlobal } from '../internal/global-utils';\nimport type { ComponentLoggerOptions, DiagLogger } from './types';\n\n/**\n * Component Logger which is meant to be used as part of any component which\n * will add automatically additional namespace in front of the log message.\n * It will then forward all message to global diag logger\n * @example\n * const cLogger = diag.createComponentLogger({ namespace: '@opentelemetry/instrumentation-http' });\n * cLogger.debug('test');\n * // @opentelemetry/instrumentation-http test\n */\nexport class DiagComponentLogger implements DiagLogger {\n private _namespace: string;\n\n constructor(props: ComponentLoggerOptions) {\n this._namespace = props.namespace || 'DiagComponentLogger';\n }\n\n public debug(...args: unknown[]): void {\n return logProxy('debug', this._namespace, args);\n }\n\n public error(...args: unknown[]): void {\n return logProxy('error', this._namespace, args);\n }\n\n public info(...args: unknown[]): void {\n return logProxy('info', this._namespace, args);\n }\n\n public warn(...args: unknown[]): void {\n return logProxy('warn', this._namespace, args);\n }\n\n public verbose(...args: unknown[]): void {\n return logProxy('verbose', this._namespace, args);\n }\n}\n\nfunction logProxy(\n funcName: keyof DiagLogger,\n namespace: string,\n args: unknown[]\n): void {\n const logger = getGlobal('diag');\n // shortcut if logger not set\n if (!logger) {\n return;\n }\n\n return logger[funcName](namespace, ...args);\n}\n"]}
|
||||
43
node_modules/@opentelemetry/api/build/esm/diag/consoleLogger.d.ts
generated
vendored
Normal file
43
node_modules/@opentelemetry/api/build/esm/diag/consoleLogger.d.ts
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
import type { DiagLogger, DiagLogFunction } from './types';
|
||||
type ConsoleMapKeys = 'error' | 'warn' | 'info' | 'debug' | 'trace';
|
||||
export declare const _originalConsoleMethods: Partial<Record<ConsoleMapKeys | 'log', typeof console.log>>;
|
||||
/**
|
||||
* A simple Immutable Console based diagnostic logger which will output any messages to the Console.
|
||||
* If you want to limit the amount of logging to a specific level or lower use the
|
||||
* {@link createLogLevelDiagLogger}
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export declare class DiagConsoleLogger implements DiagLogger {
|
||||
constructor();
|
||||
/** Log an error scenario that was not expected and caused the requested operation to fail. */
|
||||
error: DiagLogFunction;
|
||||
/**
|
||||
* Log a warning scenario to inform the developer of an issues that should be investigated.
|
||||
* The requested operation may or may not have succeeded or completed.
|
||||
*/
|
||||
warn: DiagLogFunction;
|
||||
/**
|
||||
* Log a general informational message, this should not affect functionality.
|
||||
* This is also the default logging level so this should NOT be used for logging
|
||||
* debugging level information.
|
||||
*/
|
||||
info: DiagLogFunction;
|
||||
/**
|
||||
* Log a general debug message that can be useful for identifying a failure.
|
||||
* Information logged at this level may include diagnostic details that would
|
||||
* help identify a failure scenario. Useful scenarios would be to log the execution
|
||||
* order of async operations
|
||||
*/
|
||||
debug: DiagLogFunction;
|
||||
/**
|
||||
* Log a detailed (verbose) trace level logging that can be used to identify failures
|
||||
* where debug level logging would be insufficient, this level of tracing can include
|
||||
* input and output parameters and as such may include PII information passing through
|
||||
* the API. As such it is recommended that this level of tracing should not be enabled
|
||||
* in a production environment.
|
||||
*/
|
||||
verbose: DiagLogFunction;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=consoleLogger.d.ts.map
|
||||
69
node_modules/@opentelemetry/api/build/esm/diag/consoleLogger.js
generated
vendored
Normal file
69
node_modules/@opentelemetry/api/build/esm/diag/consoleLogger.js
generated
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const consoleMap = [
|
||||
{ n: 'error', c: 'error' },
|
||||
{ n: 'warn', c: 'warn' },
|
||||
{ n: 'info', c: 'info' },
|
||||
{ n: 'debug', c: 'debug' },
|
||||
{ n: 'verbose', c: 'trace' },
|
||||
];
|
||||
// Save original console methods at module load time, before any instrumentation
|
||||
// can wrap them. This ensures DiagConsoleLogger calls the unwrapped originals.
|
||||
// Exported for testing only — not part of the public API.
|
||||
export const _originalConsoleMethods = {};
|
||||
if (typeof console !== 'undefined') {
|
||||
const keys = [
|
||||
'error',
|
||||
'warn',
|
||||
'info',
|
||||
'debug',
|
||||
'trace',
|
||||
'log',
|
||||
];
|
||||
for (const key of keys) {
|
||||
// eslint-disable-next-line no-console
|
||||
if (typeof console[key] === 'function') {
|
||||
// eslint-disable-next-line no-console
|
||||
_originalConsoleMethods[key] = console[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* A simple Immutable Console based diagnostic logger which will output any messages to the Console.
|
||||
* If you want to limit the amount of logging to a specific level or lower use the
|
||||
* {@link createLogLevelDiagLogger}
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export class DiagConsoleLogger {
|
||||
constructor() {
|
||||
function _consoleFunc(funcName) {
|
||||
return function (...args) {
|
||||
// Prefer original (pre-instrumentation) methods saved at module load time.
|
||||
let theFunc = _originalConsoleMethods[funcName];
|
||||
// Some environments only expose the console when the F12 developer console is open
|
||||
if (typeof theFunc !== 'function') {
|
||||
theFunc = _originalConsoleMethods['log'];
|
||||
}
|
||||
// Fall back in case console was not available at module load time but became available later.
|
||||
if (typeof theFunc !== 'function' && console) {
|
||||
// eslint-disable-next-line no-console
|
||||
theFunc = console[funcName];
|
||||
if (typeof theFunc !== 'function') {
|
||||
// eslint-disable-next-line no-console
|
||||
theFunc = console.log;
|
||||
}
|
||||
}
|
||||
if (typeof theFunc === 'function') {
|
||||
return theFunc.apply(console, args);
|
||||
}
|
||||
};
|
||||
}
|
||||
for (let i = 0; i < consoleMap.length; i++) {
|
||||
this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c);
|
||||
}
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=consoleLogger.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/diag/consoleLogger.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/diag/consoleLogger.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
4
node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.d.ts
generated
vendored
Normal file
4
node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import type { DiagLogger } from '../types';
|
||||
import { DiagLogLevel } from '../types';
|
||||
export declare function createLogLevelDiagLogger(maxLevel: DiagLogLevel, logger: DiagLogger): DiagLogger;
|
||||
//# sourceMappingURL=logLevelLogger.d.ts.map
|
||||
30
node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js
generated
vendored
Normal file
30
node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
import { DiagLogLevel } from '../types';
|
||||
export function createLogLevelDiagLogger(maxLevel, logger) {
|
||||
if (maxLevel < DiagLogLevel.NONE) {
|
||||
maxLevel = DiagLogLevel.NONE;
|
||||
}
|
||||
else if (maxLevel > DiagLogLevel.ALL) {
|
||||
maxLevel = DiagLogLevel.ALL;
|
||||
}
|
||||
// In case the logger is null or undefined
|
||||
logger = logger || {};
|
||||
function _filterFunc(funcName, theLevel) {
|
||||
const theFunc = logger[funcName];
|
||||
if (typeof theFunc === 'function' && maxLevel >= theLevel) {
|
||||
return theFunc.bind(logger);
|
||||
}
|
||||
return function () { };
|
||||
}
|
||||
return {
|
||||
error: _filterFunc('error', DiagLogLevel.ERROR),
|
||||
warn: _filterFunc('warn', DiagLogLevel.WARN),
|
||||
info: _filterFunc('info', DiagLogLevel.INFO),
|
||||
debug: _filterFunc('debug', DiagLogLevel.DEBUG),
|
||||
verbose: _filterFunc('verbose', DiagLogLevel.VERBOSE),
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=logLevelLogger.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"logLevelLogger.js","sourceRoot":"","sources":["../../../../src/diag/internal/logLevelLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,UAAU,wBAAwB,CACtC,QAAsB,EACtB,MAAkB;IAElB,IAAI,QAAQ,GAAG,YAAY,CAAC,IAAI,EAAE;QAChC,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC;KAC9B;SAAM,IAAI,QAAQ,GAAG,YAAY,CAAC,GAAG,EAAE;QACtC,QAAQ,GAAG,YAAY,CAAC,GAAG,CAAC;KAC7B;IAED,0CAA0C;IAC1C,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;IAEtB,SAAS,WAAW,CAClB,QAA0B,EAC1B,QAAsB;QAEtB,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;QAEjC,IAAI,OAAO,OAAO,KAAK,UAAU,IAAI,QAAQ,IAAI,QAAQ,EAAE;YACzD,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SAC7B;QACD,OAAO,cAAa,CAAC,CAAC;IACxB,CAAC;IAED,OAAO;QACL,KAAK,EAAE,WAAW,CAAC,OAAO,EAAE,YAAY,CAAC,KAAK,CAAC;QAC/C,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC;QAC5C,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC;QAC5C,KAAK,EAAE,WAAW,CAAC,OAAO,EAAE,YAAY,CAAC,KAAK,CAAC;QAC/C,OAAO,EAAE,WAAW,CAAC,SAAS,EAAE,YAAY,CAAC,OAAO,CAAC;KACtD,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { DiagLogFunction, DiagLogger } from '../types';\nimport { DiagLogLevel } from '../types';\n\nexport function createLogLevelDiagLogger(\n maxLevel: DiagLogLevel,\n logger: DiagLogger\n): DiagLogger {\n if (maxLevel < DiagLogLevel.NONE) {\n maxLevel = DiagLogLevel.NONE;\n } else if (maxLevel > DiagLogLevel.ALL) {\n maxLevel = DiagLogLevel.ALL;\n }\n\n // In case the logger is null or undefined\n logger = logger || {};\n\n function _filterFunc(\n funcName: keyof DiagLogger,\n theLevel: DiagLogLevel\n ): DiagLogFunction {\n const theFunc = logger[funcName];\n\n if (typeof theFunc === 'function' && maxLevel >= theLevel) {\n return theFunc.bind(logger);\n }\n return function () {};\n }\n\n return {\n error: _filterFunc('error', DiagLogLevel.ERROR),\n warn: _filterFunc('warn', DiagLogLevel.WARN),\n info: _filterFunc('info', DiagLogLevel.INFO),\n debug: _filterFunc('debug', DiagLogLevel.DEBUG),\n verbose: _filterFunc('verbose', DiagLogLevel.VERBOSE),\n };\n}\n"]}
|
||||
8
node_modules/@opentelemetry/api/build/esm/diag/internal/noopLogger.d.ts
generated
vendored
Normal file
8
node_modules/@opentelemetry/api/build/esm/diag/internal/noopLogger.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import type { DiagLogger } from '../types';
|
||||
/**
|
||||
* Returns a No-Op Diagnostic logger where all messages do nothing.
|
||||
* @implements {@link DiagLogger}
|
||||
* @returns {DiagLogger}
|
||||
*/
|
||||
export declare function createNoopDiagLogger(): DiagLogger;
|
||||
//# sourceMappingURL=noopLogger.d.ts.map
|
||||
20
node_modules/@opentelemetry/api/build/esm/diag/internal/noopLogger.js
generated
vendored
Normal file
20
node_modules/@opentelemetry/api/build/esm/diag/internal/noopLogger.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
function noopLogFunction() { }
|
||||
/**
|
||||
* Returns a No-Op Diagnostic logger where all messages do nothing.
|
||||
* @implements {@link DiagLogger}
|
||||
* @returns {DiagLogger}
|
||||
*/
|
||||
export function createNoopDiagLogger() {
|
||||
return {
|
||||
verbose: noopLogFunction,
|
||||
debug: noopLogFunction,
|
||||
info: noopLogFunction,
|
||||
warn: noopLogFunction,
|
||||
error: noopLogFunction,
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=noopLogger.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/diag/internal/noopLogger.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/diag/internal/noopLogger.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"noopLogger.js","sourceRoot":"","sources":["../../../../src/diag/internal/noopLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,SAAS,eAAe,KAAI,CAAC;AAE7B;;;;GAIG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO;QACL,OAAO,EAAE,eAAe;QACxB,KAAK,EAAE,eAAe;QACtB,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE,eAAe;KACvB,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { DiagLogger } from '../types';\n\nfunction noopLogFunction() {}\n\n/**\n * Returns a No-Op Diagnostic logger where all messages do nothing.\n * @implements {@link DiagLogger}\n * @returns {DiagLogger}\n */\nexport function createNoopDiagLogger(): DiagLogger {\n return {\n verbose: noopLogFunction,\n debug: noopLogFunction,\n info: noopLogFunction,\n warn: noopLogFunction,\n error: noopLogFunction,\n };\n}\n"]}
|
||||
110
node_modules/@opentelemetry/api/build/esm/diag/types.d.ts
generated
vendored
Normal file
110
node_modules/@opentelemetry/api/build/esm/diag/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,110 @@
|
||||
/**
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export type DiagLogFunction = (message: string, ...args: unknown[]) => void;
|
||||
/**
|
||||
* Defines an internal diagnostic logger interface which is used to log internal diagnostic
|
||||
* messages, you can set the default diagnostic logger via the {@link DiagAPI} setLogger function.
|
||||
* API provided implementations include :-
|
||||
* - a No-Op {@link createNoopDiagLogger}
|
||||
* - a {@link DiagLogLevel} filtering wrapper {@link createLogLevelDiagLogger}
|
||||
* - a general Console {@link DiagConsoleLogger} version.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export interface DiagLogger {
|
||||
/** Log an error scenario that was not expected and caused the requested operation to fail. */
|
||||
error: DiagLogFunction;
|
||||
/**
|
||||
* Log a warning scenario to inform the developer of an issues that should be investigated.
|
||||
* The requested operation may or may not have succeeded or completed.
|
||||
*/
|
||||
warn: DiagLogFunction;
|
||||
/**
|
||||
* Log a general informational message, this should not affect functionality.
|
||||
* This is also the default logging level so this should NOT be used for logging
|
||||
* debugging level information.
|
||||
*/
|
||||
info: DiagLogFunction;
|
||||
/**
|
||||
* Log a general debug message that can be useful for identifying a failure.
|
||||
* Information logged at this level may include diagnostic details that would
|
||||
* help identify a failure scenario.
|
||||
* For example: Logging the order of execution of async operations.
|
||||
*/
|
||||
debug: DiagLogFunction;
|
||||
/**
|
||||
* Log a detailed (verbose) trace level logging that can be used to identify failures
|
||||
* where debug level logging would be insufficient, this level of tracing can include
|
||||
* input and output parameters and as such may include PII information passing through
|
||||
* the API. As such it is recommended that this level of tracing should not be enabled
|
||||
* in a production environment.
|
||||
*/
|
||||
verbose: DiagLogFunction;
|
||||
}
|
||||
/**
|
||||
* Defines the available internal logging levels for the diagnostic logger, the numeric values
|
||||
* of the levels are defined to match the original values from the initial LogLevel to avoid
|
||||
* compatibility/migration issues for any implementation that assume the numeric ordering.
|
||||
*/
|
||||
export declare enum DiagLogLevel {
|
||||
/** Diagnostic Logging level setting to disable all logging (except and forced logs) */
|
||||
NONE = 0,
|
||||
/** Identifies an error scenario */
|
||||
ERROR = 30,
|
||||
/** Identifies a warning scenario */
|
||||
WARN = 50,
|
||||
/** General informational log message */
|
||||
INFO = 60,
|
||||
/** General debug log message */
|
||||
DEBUG = 70,
|
||||
/**
|
||||
* Detailed trace level logging should only be used for development, should only be set
|
||||
* in a development environment.
|
||||
*/
|
||||
VERBOSE = 80,
|
||||
/** Used to set the logging level to include all logging */
|
||||
ALL = 9999
|
||||
}
|
||||
/**
|
||||
* Defines options for ComponentLogger
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export interface ComponentLoggerOptions {
|
||||
namespace: string;
|
||||
}
|
||||
/**
|
||||
* @since 1.4.1
|
||||
*/
|
||||
export interface DiagLoggerOptions {
|
||||
/**
|
||||
* The {@link DiagLogLevel} used to filter logs sent to the logger.
|
||||
*
|
||||
* @defaultValue DiagLogLevel.INFO
|
||||
*/
|
||||
logLevel?: DiagLogLevel;
|
||||
/**
|
||||
* Setting this value to `true` will suppress the warning message normally emitted when registering a logger when another logger is already registered.
|
||||
*/
|
||||
suppressOverrideMessage?: boolean;
|
||||
}
|
||||
export interface DiagLoggerApi {
|
||||
/**
|
||||
* Set the global DiagLogger and DiagLogLevel.
|
||||
* If a global diag logger is already set, this will override it.
|
||||
*
|
||||
* @param logger - The {@link DiagLogger} instance to set as the default logger.
|
||||
* @param options - A {@link DiagLoggerOptions} object. If not provided, default values will be set.
|
||||
* @returns `true` if the logger was successfully registered, else `false`
|
||||
*/
|
||||
setLogger(logger: DiagLogger, options?: DiagLoggerOptions): boolean;
|
||||
/**
|
||||
*
|
||||
* @param logger - The {@link DiagLogger} instance to set as the default logger.
|
||||
* @param logLevel - The {@link DiagLogLevel} used to filter logs sent to the logger. If not provided it will default to {@link DiagLogLevel.INFO}.
|
||||
* @returns `true` if the logger was successfully registered, else `false`
|
||||
*/
|
||||
setLogger(logger: DiagLogger, logLevel?: DiagLogLevel): boolean;
|
||||
}
|
||||
//# sourceMappingURL=types.d.ts.map
|
||||
30
node_modules/@opentelemetry/api/build/esm/diag/types.js
generated
vendored
Normal file
30
node_modules/@opentelemetry/api/build/esm/diag/types.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
/**
|
||||
* Defines the available internal logging levels for the diagnostic logger, the numeric values
|
||||
* of the levels are defined to match the original values from the initial LogLevel to avoid
|
||||
* compatibility/migration issues for any implementation that assume the numeric ordering.
|
||||
*/
|
||||
export var DiagLogLevel;
|
||||
(function (DiagLogLevel) {
|
||||
/** Diagnostic Logging level setting to disable all logging (except and forced logs) */
|
||||
DiagLogLevel[DiagLogLevel["NONE"] = 0] = "NONE";
|
||||
/** Identifies an error scenario */
|
||||
DiagLogLevel[DiagLogLevel["ERROR"] = 30] = "ERROR";
|
||||
/** Identifies a warning scenario */
|
||||
DiagLogLevel[DiagLogLevel["WARN"] = 50] = "WARN";
|
||||
/** General informational log message */
|
||||
DiagLogLevel[DiagLogLevel["INFO"] = 60] = "INFO";
|
||||
/** General debug log message */
|
||||
DiagLogLevel[DiagLogLevel["DEBUG"] = 70] = "DEBUG";
|
||||
/**
|
||||
* Detailed trace level logging should only be used for development, should only be set
|
||||
* in a development environment.
|
||||
*/
|
||||
DiagLogLevel[DiagLogLevel["VERBOSE"] = 80] = "VERBOSE";
|
||||
/** Used to set the logging level to include all logging */
|
||||
DiagLogLevel[DiagLogLevel["ALL"] = 9999] = "ALL";
|
||||
})(DiagLogLevel || (DiagLogLevel = {}));
|
||||
//# sourceMappingURL=types.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/diag/types.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/diag/types.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/diag/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAoDH;;;;GAIG;AACH,MAAM,CAAN,IAAY,YAwBX;AAxBD,WAAY,YAAY;IACtB,uFAAuF;IACvF,+CAAQ,CAAA;IAER,mCAAmC;IACnC,kDAAU,CAAA;IAEV,oCAAoC;IACpC,gDAAS,CAAA;IAET,wCAAwC;IACxC,gDAAS,CAAA;IAET,gCAAgC;IAChC,kDAAU,CAAA;IAEV;;;OAGG;IACH,sDAAY,CAAA;IAEZ,2DAA2D;IAC3D,gDAAU,CAAA;AACZ,CAAC,EAxBW,YAAY,KAAZ,YAAY,QAwBvB","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @since 1.0.0\n */\nexport type DiagLogFunction = (message: string, ...args: unknown[]) => void;\n\n/**\n * Defines an internal diagnostic logger interface which is used to log internal diagnostic\n * messages, you can set the default diagnostic logger via the {@link DiagAPI} setLogger function.\n * API provided implementations include :-\n * - a No-Op {@link createNoopDiagLogger}\n * - a {@link DiagLogLevel} filtering wrapper {@link createLogLevelDiagLogger}\n * - a general Console {@link DiagConsoleLogger} version.\n *\n * @since 1.0.0\n */\nexport interface DiagLogger {\n /** Log an error scenario that was not expected and caused the requested operation to fail. */\n error: DiagLogFunction;\n\n /**\n * Log a warning scenario to inform the developer of an issues that should be investigated.\n * The requested operation may or may not have succeeded or completed.\n */\n warn: DiagLogFunction;\n\n /**\n * Log a general informational message, this should not affect functionality.\n * This is also the default logging level so this should NOT be used for logging\n * debugging level information.\n */\n info: DiagLogFunction;\n\n /**\n * Log a general debug message that can be useful for identifying a failure.\n * Information logged at this level may include diagnostic details that would\n * help identify a failure scenario.\n * For example: Logging the order of execution of async operations.\n */\n debug: DiagLogFunction;\n\n /**\n * Log a detailed (verbose) trace level logging that can be used to identify failures\n * where debug level logging would be insufficient, this level of tracing can include\n * input and output parameters and as such may include PII information passing through\n * the API. As such it is recommended that this level of tracing should not be enabled\n * in a production environment.\n */\n verbose: DiagLogFunction;\n}\n\n/**\n * Defines the available internal logging levels for the diagnostic logger, the numeric values\n * of the levels are defined to match the original values from the initial LogLevel to avoid\n * compatibility/migration issues for any implementation that assume the numeric ordering.\n */\nexport enum DiagLogLevel {\n /** Diagnostic Logging level setting to disable all logging (except and forced logs) */\n NONE = 0,\n\n /** Identifies an error scenario */\n ERROR = 30,\n\n /** Identifies a warning scenario */\n WARN = 50,\n\n /** General informational log message */\n INFO = 60,\n\n /** General debug log message */\n DEBUG = 70,\n\n /**\n * Detailed trace level logging should only be used for development, should only be set\n * in a development environment.\n */\n VERBOSE = 80,\n\n /** Used to set the logging level to include all logging */\n ALL = 9999,\n}\n\n/**\n * Defines options for ComponentLogger\n *\n * @since 1.0.0\n */\nexport interface ComponentLoggerOptions {\n namespace: string;\n}\n\n/**\n * @since 1.4.1\n */\nexport interface DiagLoggerOptions {\n /**\n * The {@link DiagLogLevel} used to filter logs sent to the logger.\n *\n * @defaultValue DiagLogLevel.INFO\n */\n logLevel?: DiagLogLevel;\n\n /**\n * Setting this value to `true` will suppress the warning message normally emitted when registering a logger when another logger is already registered.\n */\n suppressOverrideMessage?: boolean;\n}\n\nexport interface DiagLoggerApi {\n /**\n * Set the global DiagLogger and DiagLogLevel.\n * If a global diag logger is already set, this will override it.\n *\n * @param logger - The {@link DiagLogger} instance to set as the default logger.\n * @param options - A {@link DiagLoggerOptions} object. If not provided, default values will be set.\n * @returns `true` if the logger was successfully registered, else `false`\n */\n setLogger(logger: DiagLogger, options?: DiagLoggerOptions): boolean;\n\n /**\n *\n * @param logger - The {@link DiagLogger} instance to set as the default logger.\n * @param logLevel - The {@link DiagLogLevel} used to filter logs sent to the logger. If not provided it will default to {@link DiagLogLevel.INFO}.\n * @returns `true` if the logger was successfully registered, else `false`\n */\n setLogger(logger: DiagLogger, logLevel?: DiagLogLevel): boolean;\n}\n"]}
|
||||
7
node_modules/@opentelemetry/api/build/esm/experimental/index.d.ts
generated
vendored
Normal file
7
node_modules/@opentelemetry/api/build/esm/experimental/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Any exports here may change at any time and without warning
|
||||
* @module @opentelemetry/api/experimental
|
||||
*/
|
||||
export { wrapTracer, SugaredTracer } from './trace/SugaredTracer';
|
||||
export type { SugaredSpanOptions } from './trace/SugaredOptions';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
10
node_modules/@opentelemetry/api/build/esm/experimental/index.js
generated
vendored
Normal file
10
node_modules/@opentelemetry/api/build/esm/experimental/index.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
/**
|
||||
* Any exports here may change at any time and without warning
|
||||
* @module @opentelemetry/api/experimental
|
||||
*/
|
||||
export { wrapTracer, SugaredTracer } from './trace/SugaredTracer';
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/experimental/index.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/experimental/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/experimental/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * Any exports here may change at any time and without warning\n * @module @opentelemetry/api/experimental\n */\n\nexport { wrapTracer, SugaredTracer } from './trace/SugaredTracer';\nexport type { SugaredSpanOptions } from './trace/SugaredOptions';\n"]}
|
||||
13
node_modules/@opentelemetry/api/build/esm/experimental/trace/SugaredOptions.d.ts
generated
vendored
Normal file
13
node_modules/@opentelemetry/api/build/esm/experimental/trace/SugaredOptions.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { Span, SpanOptions } from '../../';
|
||||
/**
|
||||
* Options needed for span creation
|
||||
*/
|
||||
export interface SugaredSpanOptions extends SpanOptions {
|
||||
/**
|
||||
* function to overwrite default exception behavior to record the exception. No exceptions should be thrown in the function.
|
||||
* @param e Error which triggered this exception
|
||||
* @param span current span from context
|
||||
*/
|
||||
onException?: (e: Error, span: Span) => void;
|
||||
}
|
||||
//# sourceMappingURL=SugaredOptions.d.ts.map
|
||||
6
node_modules/@opentelemetry/api/build/esm/experimental/trace/SugaredOptions.js
generated
vendored
Normal file
6
node_modules/@opentelemetry/api/build/esm/experimental/trace/SugaredOptions.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
export {};
|
||||
//# sourceMappingURL=SugaredOptions.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/experimental/trace/SugaredOptions.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/experimental/trace/SugaredOptions.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"SugaredOptions.js","sourceRoot":"","sources":["../../../../src/experimental/trace/SugaredOptions.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Span, SpanOptions } from '../../';\n\n/**\n * Options needed for span creation\n */\nexport interface SugaredSpanOptions extends SpanOptions {\n /**\n * function to overwrite default exception behavior to record the exception. No exceptions should be thrown in the function.\n * @param e Error which triggered this exception\n * @param span current span from context\n */\n onException?: (e: Error, span: Span) => void;\n}\n"]}
|
||||
64
node_modules/@opentelemetry/api/build/esm/experimental/trace/SugaredTracer.d.ts
generated
vendored
Normal file
64
node_modules/@opentelemetry/api/build/esm/experimental/trace/SugaredTracer.d.ts
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
import type { SugaredSpanOptions } from './SugaredOptions';
|
||||
import type { Context, Span, Tracer } from '../../';
|
||||
/**
|
||||
* return a new SugaredTracer created from the supplied one
|
||||
* @param tracer
|
||||
*/
|
||||
export declare function wrapTracer(tracer: Tracer): SugaredTracer;
|
||||
export declare class SugaredTracer implements Tracer {
|
||||
private readonly _tracer;
|
||||
constructor(tracer: Tracer);
|
||||
startActiveSpan: Tracer['startActiveSpan'];
|
||||
startSpan: Tracer['startSpan'];
|
||||
/**
|
||||
* Starts a new {@link Span} and calls the given function passing it the
|
||||
* created span as first argument.
|
||||
* Additionally, the new span gets set in context and this context is activated
|
||||
* for the duration of the function call.
|
||||
* The span will be closed after the function has executed.
|
||||
* If an exception occurs, it is recorded, the status is set to ERROR and the exception is rethrown.
|
||||
*
|
||||
* @param name The name of the span
|
||||
* @param [options] SugaredSpanOptions used for span creation
|
||||
* @param [context] Context to use to extract parent
|
||||
* @param fn function called in the context of the span and receives the newly created span as an argument
|
||||
* @returns return value of fn
|
||||
* @example
|
||||
* const something = tracer.withActiveSpan('op', span => {
|
||||
* // do some work
|
||||
* });
|
||||
* @example
|
||||
* const something = await tracer.withActiveSpan('op', span => {
|
||||
* // do some async work
|
||||
* });
|
||||
*/
|
||||
withActiveSpan<F extends (span: Span) => ReturnType<F>>(name: string, fn: F): ReturnType<F>;
|
||||
withActiveSpan<F extends (span: Span) => ReturnType<F>>(name: string, options: SugaredSpanOptions, fn: F): ReturnType<F>;
|
||||
withActiveSpan<F extends (span: Span) => ReturnType<F>>(name: string, options: SugaredSpanOptions, context: Context, fn: F): ReturnType<F>;
|
||||
/**
|
||||
* Starts a new {@link Span} and ends it after execution of fn without setting it on context.
|
||||
* The span will be closed after the function has executed.
|
||||
* If an exception occurs, it is recorded, the status is et to ERROR and rethrown.
|
||||
*
|
||||
* This method does NOT modify the current Context.
|
||||
*
|
||||
* @param name The name of the span
|
||||
* @param [options] SugaredSpanOptions used for span creation
|
||||
* @param [context] Context to use to extract parent
|
||||
* @param fn function called in the context of the span and receives the newly created span as an argument
|
||||
* @returns Span The newly created span
|
||||
* @example
|
||||
* const something = tracer.withSpan('op', span => {
|
||||
* // do some work
|
||||
* });
|
||||
* @example
|
||||
* const something = await tracer.withSpan('op', span => {
|
||||
* // do some async work
|
||||
* });
|
||||
*/
|
||||
withSpan<F extends (span: Span) => ReturnType<F>>(name: string, fn: F): ReturnType<F>;
|
||||
withSpan<F extends (span: Span) => ReturnType<F>>(name: string, options: SugaredSpanOptions, fn: F): ReturnType<F>;
|
||||
withSpan<F extends (span: Span) => ReturnType<F>>(name: string, options: SugaredSpanOptions, context: Context, fn: F): ReturnType<F>;
|
||||
withSpan<F extends (span: Span) => ReturnType<F>>(name: string, options: SugaredSpanOptions, context: Context, fn: F): ReturnType<F>;
|
||||
}
|
||||
//# sourceMappingURL=SugaredTracer.d.ts.map
|
||||
88
node_modules/@opentelemetry/api/build/esm/experimental/trace/SugaredTracer.js
generated
vendored
Normal file
88
node_modules/@opentelemetry/api/build/esm/experimental/trace/SugaredTracer.js
generated
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
import { context as contextApi, SpanStatusCode } from '../../';
|
||||
const defaultOnException = (e, span) => {
|
||||
span.recordException(e);
|
||||
span.setStatus({
|
||||
code: SpanStatusCode.ERROR,
|
||||
});
|
||||
};
|
||||
/**
|
||||
* return a new SugaredTracer created from the supplied one
|
||||
* @param tracer
|
||||
*/
|
||||
export function wrapTracer(tracer) {
|
||||
return new SugaredTracer(tracer);
|
||||
}
|
||||
export class SugaredTracer {
|
||||
constructor(tracer) {
|
||||
this._tracer = tracer;
|
||||
this.startSpan = tracer.startSpan.bind(this._tracer);
|
||||
this.startActiveSpan = tracer.startActiveSpan.bind(this._tracer);
|
||||
}
|
||||
withActiveSpan(name, arg2, arg3, arg4) {
|
||||
const { opts, ctx, fn } = massageParams(arg2, arg3, arg4);
|
||||
return this._tracer.startActiveSpan(name, opts, ctx, (span) => handleFn(span, opts, fn));
|
||||
}
|
||||
withSpan(name, arg2, arg3, arg4) {
|
||||
const { opts, ctx, fn } = massageParams(arg2, arg3, arg4);
|
||||
const span = this._tracer.startSpan(name, opts, ctx);
|
||||
return handleFn(span, opts, fn);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Massages parameters of withSpan and withActiveSpan to allow signature overwrites
|
||||
* @param arg
|
||||
* @param arg2
|
||||
* @param arg3
|
||||
*/
|
||||
function massageParams(arg, arg2, arg3) {
|
||||
let opts;
|
||||
let ctx;
|
||||
let fn;
|
||||
if (!arg2 && !arg3) {
|
||||
fn = arg;
|
||||
}
|
||||
else if (!arg3) {
|
||||
opts = arg;
|
||||
fn = arg2;
|
||||
}
|
||||
else {
|
||||
opts = arg;
|
||||
ctx = arg2;
|
||||
fn = arg3;
|
||||
}
|
||||
opts = opts !== null && opts !== void 0 ? opts : {};
|
||||
ctx = ctx !== null && ctx !== void 0 ? ctx : contextApi.active();
|
||||
return { opts, ctx, fn };
|
||||
}
|
||||
/**
|
||||
* Executes fn, returns results and runs onException in the case of exception to allow overwriting of error handling
|
||||
* @param span
|
||||
* @param opts
|
||||
* @param fn
|
||||
*/
|
||||
function handleFn(span, opts, fn) {
|
||||
var _a;
|
||||
const onException = (_a = opts.onException) !== null && _a !== void 0 ? _a : defaultOnException;
|
||||
const errorHandler = (e) => {
|
||||
onException(e, span);
|
||||
span.end();
|
||||
throw e;
|
||||
};
|
||||
try {
|
||||
const ret = fn(span);
|
||||
// if fn is an async function, attach a recordException and spanEnd callback to the promise
|
||||
if (typeof (ret === null || ret === void 0 ? void 0 : ret.then) === 'function') {
|
||||
return ret.then(val => {
|
||||
span.end();
|
||||
return val;
|
||||
}, errorHandler);
|
||||
}
|
||||
span.end();
|
||||
return ret;
|
||||
}
|
||||
catch (e) {
|
||||
// add throw to signal the compiler that this will throw in the inner scope
|
||||
throw errorHandler(e);
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=SugaredTracer.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/experimental/trace/SugaredTracer.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/experimental/trace/SugaredTracer.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
59
node_modules/@opentelemetry/api/build/esm/index.d.ts
generated
vendored
Normal file
59
node_modules/@opentelemetry/api/build/esm/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* @module @opentelemetry/api
|
||||
*/
|
||||
export type { BaggageEntry, BaggageEntryMetadata, Baggage, } from './baggage/types';
|
||||
export { baggageEntryMetadataFromString } from './baggage/utils';
|
||||
export type { Exception } from './common/Exception';
|
||||
export type { HrTime, TimeInput } from './common/Time';
|
||||
export type { Attributes, AttributeValue } from './common/Attributes';
|
||||
export { createContextKey, ROOT_CONTEXT } from './context/context';
|
||||
export type { Context, ContextManager } from './context/types';
|
||||
export type { ContextAPI } from './api/context';
|
||||
export { DiagConsoleLogger } from './diag/consoleLogger';
|
||||
export { DiagLogLevel } from './diag/types';
|
||||
export type { DiagLogFunction, DiagLogger, ComponentLoggerOptions, DiagLoggerOptions, } from './diag/types';
|
||||
export type { DiagAPI } from './api/diag';
|
||||
export { createNoopMeter } from './metrics/NoopMeter';
|
||||
export type { MeterOptions, Meter } from './metrics/Meter';
|
||||
export type { MeterProvider } from './metrics/MeterProvider';
|
||||
export { ValueType } from './metrics/Metric';
|
||||
export type { Counter, Gauge, Histogram, MetricOptions, UpDownCounter, MetricAdvice, MetricAttributes, MetricAttributeValue, Observable, ObservableCounter, ObservableGauge, ObservableUpDownCounter, BatchObservableCallback, ObservableCallback, BatchObservableResult, ObservableResult, } from './metrics/Metric';
|
||||
export type { MetricsAPI } from './api/metrics';
|
||||
export { defaultTextMapGetter, defaultTextMapSetter, } from './propagation/TextMapPropagator';
|
||||
export type { TextMapPropagator, TextMapSetter, TextMapGetter, } from './propagation/TextMapPropagator';
|
||||
export type { PropagationAPI } from './api/propagation';
|
||||
export type { SpanAttributes, SpanAttributeValue } from './trace/attributes';
|
||||
export type { Link } from './trace/link';
|
||||
export { ProxyTracer, type TracerDelegator } from './trace/ProxyTracer';
|
||||
export { ProxyTracerProvider } from './trace/ProxyTracerProvider';
|
||||
export type { Sampler } from './trace/Sampler';
|
||||
export { SamplingDecision, type SamplingResult } from './trace/SamplingResult';
|
||||
export type { SpanContext } from './trace/span_context';
|
||||
export { SpanKind } from './trace/span_kind';
|
||||
export type { Span } from './trace/span';
|
||||
export type { SpanOptions } from './trace/SpanOptions';
|
||||
export { type SpanStatus, SpanStatusCode } from './trace/status';
|
||||
export { TraceFlags } from './trace/trace_flags';
|
||||
export type { TraceState } from './trace/trace_state';
|
||||
export { createTraceState } from './trace/internal/utils';
|
||||
export type { TracerProvider } from './trace/tracer_provider';
|
||||
export type { Tracer } from './trace/tracer';
|
||||
export type { TracerOptions } from './trace/tracer_options';
|
||||
export { isSpanContextValid, isValidTraceId, isValidSpanId, } from './trace/spancontext-utils';
|
||||
export { INVALID_SPANID, INVALID_TRACEID, INVALID_SPAN_CONTEXT, } from './trace/invalid-span-constants';
|
||||
export type { TraceAPI } from './api/trace';
|
||||
import { context } from './context-api';
|
||||
import { diag } from './diag-api';
|
||||
import { metrics } from './metrics-api';
|
||||
import { propagation } from './propagation-api';
|
||||
import { trace } from './trace-api';
|
||||
export { context, diag, metrics, propagation, trace };
|
||||
declare const _default: {
|
||||
context: import("./api/context").ContextAPI;
|
||||
diag: import("./api/diag").DiagAPI;
|
||||
metrics: import("./api/metrics").MetricsAPI;
|
||||
propagation: import("./api/propagation").PropagationAPI;
|
||||
trace: import("./api/trace").TraceAPI;
|
||||
};
|
||||
export default _default;
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
43
node_modules/@opentelemetry/api/build/esm/index.js
generated
vendored
Normal file
43
node_modules/@opentelemetry/api/build/esm/index.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
export { baggageEntryMetadataFromString } from './baggage/utils';
|
||||
// Context APIs
|
||||
export { createContextKey, ROOT_CONTEXT } from './context/context';
|
||||
// Diag APIs
|
||||
export { DiagConsoleLogger } from './diag/consoleLogger';
|
||||
export { DiagLogLevel } from './diag/types';
|
||||
// Metrics APIs
|
||||
export { createNoopMeter } from './metrics/NoopMeter';
|
||||
export { ValueType } from './metrics/Metric';
|
||||
// Propagation APIs
|
||||
export { defaultTextMapGetter, defaultTextMapSetter, } from './propagation/TextMapPropagator';
|
||||
export { ProxyTracer } from './trace/ProxyTracer';
|
||||
// TODO: Remove ProxyTracerProvider export in the next major version.
|
||||
export { ProxyTracerProvider } from './trace/ProxyTracerProvider';
|
||||
export { SamplingDecision } from './trace/SamplingResult';
|
||||
export { SpanKind } from './trace/span_kind';
|
||||
export { SpanStatusCode } from './trace/status';
|
||||
export { TraceFlags } from './trace/trace_flags';
|
||||
export { createTraceState } from './trace/internal/utils';
|
||||
export { isSpanContextValid, isValidTraceId, isValidSpanId, } from './trace/spancontext-utils';
|
||||
export { INVALID_SPANID, INVALID_TRACEID, INVALID_SPAN_CONTEXT, } from './trace/invalid-span-constants';
|
||||
// Split module-level variable definition into separate files to allow
|
||||
// tree-shaking on each api instance.
|
||||
import { context } from './context-api';
|
||||
import { diag } from './diag-api';
|
||||
import { metrics } from './metrics-api';
|
||||
import { propagation } from './propagation-api';
|
||||
import { trace } from './trace-api';
|
||||
// Named export.
|
||||
export { context, diag, metrics, propagation, trace };
|
||||
// Default export.
|
||||
export default {
|
||||
context,
|
||||
diag,
|
||||
metrics,
|
||||
propagation,
|
||||
trace,
|
||||
};
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/index.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
18
node_modules/@opentelemetry/api/build/esm/internal/global-utils.d.ts
generated
vendored
Normal file
18
node_modules/@opentelemetry/api/build/esm/internal/global-utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { MeterProvider } from '../metrics/MeterProvider';
|
||||
import type { ContextManager } from '../context/types';
|
||||
import type { DiagLogger } from '../diag/types';
|
||||
import type { TextMapPropagator } from '../propagation/TextMapPropagator';
|
||||
import type { TracerProvider } from '../trace/tracer_provider';
|
||||
export declare function registerGlobal<Type extends keyof OTelGlobalAPI>(type: Type, instance: OTelGlobalAPI[Type], diag: DiagLogger, allowOverride?: boolean): boolean;
|
||||
export declare function getGlobal<Type extends keyof OTelGlobalAPI>(type: Type): OTelGlobalAPI[Type] | undefined;
|
||||
export declare function unregisterGlobal(type: keyof OTelGlobalAPI, diag: DiagLogger): void;
|
||||
type OTelGlobalAPI = {
|
||||
version: string;
|
||||
diag?: DiagLogger;
|
||||
trace?: TracerProvider;
|
||||
context?: ContextManager;
|
||||
metrics?: MeterProvider;
|
||||
propagation?: TextMapPropagator;
|
||||
};
|
||||
export {};
|
||||
//# sourceMappingURL=global-utils.d.ts.map
|
||||
54
node_modules/@opentelemetry/api/build/esm/internal/global-utils.js
generated
vendored
Normal file
54
node_modules/@opentelemetry/api/build/esm/internal/global-utils.js
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
import { VERSION } from '../version';
|
||||
import { isCompatible } from './semver';
|
||||
const major = VERSION.split('.')[0];
|
||||
const GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(`opentelemetry.js.api.${major}`);
|
||||
const _global = (typeof globalThis === 'object'
|
||||
? globalThis
|
||||
: typeof self === 'object'
|
||||
? self
|
||||
: typeof window === 'object'
|
||||
? window
|
||||
: typeof global === 'object'
|
||||
? global
|
||||
: {});
|
||||
export function registerGlobal(type, instance, diag, allowOverride = false) {
|
||||
var _a;
|
||||
const api = (_global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : {
|
||||
version: VERSION,
|
||||
});
|
||||
if (!allowOverride && api[type]) {
|
||||
// already registered an API of this type
|
||||
const err = new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${type}`);
|
||||
diag.error(err.stack || err.message);
|
||||
return false;
|
||||
}
|
||||
if (api.version !== VERSION) {
|
||||
// All registered APIs must be of the same version exactly
|
||||
const err = new Error(`@opentelemetry/api: Registration of version v${api.version} for ${type} does not match previously registered API v${VERSION}`);
|
||||
diag.error(err.stack || err.message);
|
||||
return false;
|
||||
}
|
||||
api[type] = instance;
|
||||
diag.debug(`@opentelemetry/api: Registered a global for ${type} v${VERSION}.`);
|
||||
return true;
|
||||
}
|
||||
export function getGlobal(type) {
|
||||
var _a, _b;
|
||||
const globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version;
|
||||
if (!globalVersion || !isCompatible(globalVersion)) {
|
||||
return;
|
||||
}
|
||||
return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type];
|
||||
}
|
||||
export function unregisterGlobal(type, diag) {
|
||||
diag.debug(`@opentelemetry/api: Unregistering a global for ${type} v${VERSION}.`);
|
||||
const api = _global[GLOBAL_OPENTELEMETRY_API_KEY];
|
||||
if (api) {
|
||||
delete api[type];
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=global-utils.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/internal/global-utils.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/internal/global-utils.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"global-utils.js","sourceRoot":"","sources":["../../../src/internal/global-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACpC,MAAM,4BAA4B,GAAG,MAAM,CAAC,GAAG,CAC7C,wBAAwB,KAAK,EAAE,CAChC,CAAC;AAMF,MAAM,OAAO,GAAG,CACd,OAAO,UAAU,KAAK,QAAQ;IAC5B,CAAC,CAAC,UAAU;IACZ,CAAC,CAAC,OAAO,IAAI,KAAK,QAAQ;QACxB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,OAAO,MAAM,KAAK,QAAQ;YAC1B,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,OAAO,MAAM,KAAK,QAAQ;gBAC1B,CAAC,CAAC,MAAM;gBACR,CAAC,CAAC,EAAE,CACC,CAAC;AAEhB,MAAM,UAAU,cAAc,CAC5B,IAAU,EACV,QAA6B,EAC7B,IAAgB,EAChB,aAAa,GAAG,KAAK;;IAErB,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,4BAA4B,CAAC,GAAG,MAAA,OAAO,CAC1D,4BAA4B,CAC7B,mCAAI;QACH,OAAO,EAAE,OAAO;KACjB,CAAC,CAAC;IAEH,IAAI,CAAC,aAAa,IAAI,GAAG,CAAC,IAAI,CAAC,EAAE;QAC/B,yCAAyC;QACzC,MAAM,GAAG,GAAG,IAAI,KAAK,CACnB,gEAAgE,IAAI,EAAE,CACvE,CAAC;QACF,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;QACrC,OAAO,KAAK,CAAC;KACd;IAED,IAAI,GAAG,CAAC,OAAO,KAAK,OAAO,EAAE;QAC3B,0DAA0D;QAC1D,MAAM,GAAG,GAAG,IAAI,KAAK,CACnB,gDAAgD,GAAG,CAAC,OAAO,QAAQ,IAAI,8CAA8C,OAAO,EAAE,CAC/H,CAAC;QACF,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;QACrC,OAAO,KAAK,CAAC;KACd;IAED,GAAG,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC;IACrB,IAAI,CAAC,KAAK,CACR,+CAA+C,IAAI,KAAK,OAAO,GAAG,CACnE,CAAC;IAEF,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,SAAS,CACvB,IAAU;;IAEV,MAAM,aAAa,GAAG,MAAA,OAAO,CAAC,4BAA4B,CAAC,0CAAE,OAAO,CAAC;IACrE,IAAI,CAAC,aAAa,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE;QAClD,OAAO;KACR;IACD,OAAO,MAAA,OAAO,CAAC,4BAA4B,CAAC,0CAAG,IAAI,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,IAAyB,EAAE,IAAgB;IAC1E,IAAI,CAAC,KAAK,CACR,kDAAkD,IAAI,KAAK,OAAO,GAAG,CACtE,CAAC;IACF,MAAM,GAAG,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAElD,IAAI,GAAG,EAAE;QACP,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC;KAClB;AACH,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { MeterProvider } from '../metrics/MeterProvider';\nimport type { ContextManager } from '../context/types';\nimport type { DiagLogger } from '../diag/types';\nimport type { TextMapPropagator } from '../propagation/TextMapPropagator';\nimport type { TracerProvider } from '../trace/tracer_provider';\nimport { VERSION } from '../version';\nimport { isCompatible } from './semver';\n\nconst major = VERSION.split('.')[0];\nconst GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(\n `opentelemetry.js.api.${major}`\n);\n\ndeclare const self: unknown;\ndeclare const window: unknown;\ndeclare const global: unknown;\n\nconst _global = (\n typeof globalThis === 'object'\n ? globalThis\n : typeof self === 'object'\n ? self\n : typeof window === 'object'\n ? window\n : typeof global === 'object'\n ? global\n : {}\n) as OTelGlobal;\n\nexport function registerGlobal<Type extends keyof OTelGlobalAPI>(\n type: Type,\n instance: OTelGlobalAPI[Type],\n diag: DiagLogger,\n allowOverride = false\n): boolean {\n const api = (_global[GLOBAL_OPENTELEMETRY_API_KEY] = _global[\n GLOBAL_OPENTELEMETRY_API_KEY\n ] ?? {\n version: VERSION,\n });\n\n if (!allowOverride && api[type]) {\n // already registered an API of this type\n const err = new Error(\n `@opentelemetry/api: Attempted duplicate registration of API: ${type}`\n );\n diag.error(err.stack || err.message);\n return false;\n }\n\n if (api.version !== VERSION) {\n // All registered APIs must be of the same version exactly\n const err = new Error(\n `@opentelemetry/api: Registration of version v${api.version} for ${type} does not match previously registered API v${VERSION}`\n );\n diag.error(err.stack || err.message);\n return false;\n }\n\n api[type] = instance;\n diag.debug(\n `@opentelemetry/api: Registered a global for ${type} v${VERSION}.`\n );\n\n return true;\n}\n\nexport function getGlobal<Type extends keyof OTelGlobalAPI>(\n type: Type\n): OTelGlobalAPI[Type] | undefined {\n const globalVersion = _global[GLOBAL_OPENTELEMETRY_API_KEY]?.version;\n if (!globalVersion || !isCompatible(globalVersion)) {\n return;\n }\n return _global[GLOBAL_OPENTELEMETRY_API_KEY]?.[type];\n}\n\nexport function unregisterGlobal(type: keyof OTelGlobalAPI, diag: DiagLogger) {\n diag.debug(\n `@opentelemetry/api: Unregistering a global for ${type} v${VERSION}.`\n );\n const api = _global[GLOBAL_OPENTELEMETRY_API_KEY];\n\n if (api) {\n delete api[type];\n }\n}\n\ntype OTelGlobal = {\n [GLOBAL_OPENTELEMETRY_API_KEY]?: OTelGlobalAPI;\n};\n\ntype OTelGlobalAPI = {\n version: string;\n\n diag?: DiagLogger;\n trace?: TracerProvider;\n context?: ContextManager;\n metrics?: MeterProvider;\n propagation?: TextMapPropagator;\n};\n"]}
|
||||
34
node_modules/@opentelemetry/api/build/esm/internal/semver.d.ts
generated
vendored
Normal file
34
node_modules/@opentelemetry/api/build/esm/internal/semver.d.ts
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Create a function to test an API version to see if it is compatible with the provided ownVersion.
|
||||
*
|
||||
* The returned function has the following semantics:
|
||||
* - Exact match is always compatible
|
||||
* - Major versions must match exactly
|
||||
* - 1.x package cannot use global 2.x package
|
||||
* - 2.x package cannot use global 1.x package
|
||||
* - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API
|
||||
* - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects
|
||||
* - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3
|
||||
* - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor
|
||||
* - Patch and build tag differences are not considered at this time
|
||||
*
|
||||
* @param ownVersion version which should be checked against
|
||||
*/
|
||||
export declare function _makeCompatibilityCheck(ownVersion: string): (globalVersion: string) => boolean;
|
||||
/**
|
||||
* Test an API version to see if it is compatible with this API.
|
||||
*
|
||||
* - Exact match is always compatible
|
||||
* - Major versions must match exactly
|
||||
* - 1.x package cannot use global 2.x package
|
||||
* - 2.x package cannot use global 1.x package
|
||||
* - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API
|
||||
* - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects
|
||||
* - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3
|
||||
* - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor
|
||||
* - Patch and build tag differences are not considered at this time
|
||||
*
|
||||
* @param version version of the API requesting an instance of the global API
|
||||
*/
|
||||
export declare const isCompatible: (globalVersion: string) => boolean;
|
||||
//# sourceMappingURL=semver.d.ts.map
|
||||
107
node_modules/@opentelemetry/api/build/esm/internal/semver.js
generated
vendored
Normal file
107
node_modules/@opentelemetry/api/build/esm/internal/semver.js
generated
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
import { VERSION } from '../version';
|
||||
const re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
|
||||
/**
|
||||
* Create a function to test an API version to see if it is compatible with the provided ownVersion.
|
||||
*
|
||||
* The returned function has the following semantics:
|
||||
* - Exact match is always compatible
|
||||
* - Major versions must match exactly
|
||||
* - 1.x package cannot use global 2.x package
|
||||
* - 2.x package cannot use global 1.x package
|
||||
* - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API
|
||||
* - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects
|
||||
* - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3
|
||||
* - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor
|
||||
* - Patch and build tag differences are not considered at this time
|
||||
*
|
||||
* @param ownVersion version which should be checked against
|
||||
*/
|
||||
export function _makeCompatibilityCheck(ownVersion) {
|
||||
const acceptedVersions = new Set([ownVersion]);
|
||||
const rejectedVersions = new Set();
|
||||
const myVersionMatch = ownVersion.match(re);
|
||||
if (!myVersionMatch) {
|
||||
// we cannot guarantee compatibility so we always return noop
|
||||
return () => false;
|
||||
}
|
||||
const ownVersionParsed = {
|
||||
major: +myVersionMatch[1],
|
||||
minor: +myVersionMatch[2],
|
||||
patch: +myVersionMatch[3],
|
||||
prerelease: myVersionMatch[4],
|
||||
};
|
||||
// if ownVersion has a prerelease tag, versions must match exactly
|
||||
if (ownVersionParsed.prerelease != null) {
|
||||
return function isExactmatch(globalVersion) {
|
||||
return globalVersion === ownVersion;
|
||||
};
|
||||
}
|
||||
function _reject(v) {
|
||||
rejectedVersions.add(v);
|
||||
return false;
|
||||
}
|
||||
function _accept(v) {
|
||||
acceptedVersions.add(v);
|
||||
return true;
|
||||
}
|
||||
return function isCompatible(globalVersion) {
|
||||
if (acceptedVersions.has(globalVersion)) {
|
||||
return true;
|
||||
}
|
||||
if (rejectedVersions.has(globalVersion)) {
|
||||
return false;
|
||||
}
|
||||
const globalVersionMatch = globalVersion.match(re);
|
||||
if (!globalVersionMatch) {
|
||||
// cannot parse other version
|
||||
// we cannot guarantee compatibility so we always noop
|
||||
return _reject(globalVersion);
|
||||
}
|
||||
const globalVersionParsed = {
|
||||
major: +globalVersionMatch[1],
|
||||
minor: +globalVersionMatch[2],
|
||||
patch: +globalVersionMatch[3],
|
||||
prerelease: globalVersionMatch[4],
|
||||
};
|
||||
// if globalVersion has a prerelease tag, versions must match exactly
|
||||
if (globalVersionParsed.prerelease != null) {
|
||||
return _reject(globalVersion);
|
||||
}
|
||||
// major versions must match
|
||||
if (ownVersionParsed.major !== globalVersionParsed.major) {
|
||||
return _reject(globalVersion);
|
||||
}
|
||||
if (ownVersionParsed.major === 0) {
|
||||
if (ownVersionParsed.minor === globalVersionParsed.minor &&
|
||||
ownVersionParsed.patch <= globalVersionParsed.patch) {
|
||||
return _accept(globalVersion);
|
||||
}
|
||||
return _reject(globalVersion);
|
||||
}
|
||||
if (ownVersionParsed.minor <= globalVersionParsed.minor) {
|
||||
return _accept(globalVersion);
|
||||
}
|
||||
return _reject(globalVersion);
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Test an API version to see if it is compatible with this API.
|
||||
*
|
||||
* - Exact match is always compatible
|
||||
* - Major versions must match exactly
|
||||
* - 1.x package cannot use global 2.x package
|
||||
* - 2.x package cannot use global 1.x package
|
||||
* - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API
|
||||
* - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects
|
||||
* - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3
|
||||
* - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor
|
||||
* - Patch and build tag differences are not considered at this time
|
||||
*
|
||||
* @param version version of the API requesting an instance of the global API
|
||||
*/
|
||||
export const isCompatible = _makeCompatibilityCheck(VERSION);
|
||||
//# sourceMappingURL=semver.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/internal/semver.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/internal/semver.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
8
node_modules/@opentelemetry/api/build/esm/metrics-api.d.ts
generated
vendored
Normal file
8
node_modules/@opentelemetry/api/build/esm/metrics-api.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { MetricsAPI } from './api/metrics';
|
||||
/**
|
||||
* Entrypoint for metrics API
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export declare const metrics: MetricsAPI;
|
||||
//# sourceMappingURL=metrics-api.d.ts.map
|
||||
14
node_modules/@opentelemetry/api/build/esm/metrics-api.js
generated
vendored
Normal file
14
node_modules/@opentelemetry/api/build/esm/metrics-api.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
// Split module-level variable definition into separate files to allow
|
||||
// tree-shaking on each api instance.
|
||||
import { MetricsAPI } from './api/metrics';
|
||||
/**
|
||||
* Entrypoint for metrics API
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export const metrics = MetricsAPI.getInstance();
|
||||
//# sourceMappingURL=metrics-api.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/metrics-api.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/metrics-api.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"metrics-api.js","sourceRoot":"","sources":["../../src/metrics-api.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,sEAAsE;AACtE,qCAAqC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { MetricsAPI } from './api/metrics';\n/**\n * Entrypoint for metrics API\n *\n * @since 1.3.0\n */\nexport const metrics = MetricsAPI.getInstance();\n"]}
|
||||
114
node_modules/@opentelemetry/api/build/esm/metrics/Meter.d.ts
generated
vendored
Normal file
114
node_modules/@opentelemetry/api/build/esm/metrics/Meter.d.ts
generated
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
import type { BatchObservableCallback, Counter, Gauge, Histogram, MetricAttributes, MetricOptions, Observable, ObservableCounter, ObservableGauge, ObservableUpDownCounter, UpDownCounter } from './Metric';
|
||||
/**
|
||||
* An interface describes additional metadata of a meter.
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export interface MeterOptions {
|
||||
/**
|
||||
* The schemaUrl of the meter or instrumentation library
|
||||
*/
|
||||
schemaUrl?: string;
|
||||
}
|
||||
/**
|
||||
* An interface to allow the recording metrics.
|
||||
*
|
||||
* {@link Metric}s are used for recording pre-defined aggregation (`Counter`),
|
||||
* or raw values (`Histogram`) in which the aggregation and attributes
|
||||
* for the exported metric are deferred.
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export interface Meter {
|
||||
/**
|
||||
* Creates and returns a new `Gauge`.
|
||||
* @param name the name of the metric.
|
||||
* @param [options] the metric options.
|
||||
*/
|
||||
createGauge<AttributesTypes extends MetricAttributes = MetricAttributes>(name: string, options?: MetricOptions): Gauge<AttributesTypes>;
|
||||
/**
|
||||
* Creates and returns a new `Histogram`.
|
||||
* @param name the name of the metric.
|
||||
* @param [options] the metric options.
|
||||
*/
|
||||
createHistogram<AttributesTypes extends MetricAttributes = MetricAttributes>(name: string, options?: MetricOptions): Histogram<AttributesTypes>;
|
||||
/**
|
||||
* Creates a new `Counter` metric. Generally, this kind of metric when the
|
||||
* value is a quantity, the sum is of primary interest, and the event count
|
||||
* and value distribution are not of primary interest.
|
||||
* @param name the name of the metric.
|
||||
* @param [options] the metric options.
|
||||
*/
|
||||
createCounter<AttributesTypes extends MetricAttributes = MetricAttributes>(name: string, options?: MetricOptions): Counter<AttributesTypes>;
|
||||
/**
|
||||
* Creates a new `UpDownCounter` metric. UpDownCounter is a synchronous
|
||||
* instrument and very similar to Counter except that Add(increment)
|
||||
* supports negative increments. It is generally useful for capturing changes
|
||||
* in an amount of resources used, or any quantity that rises and falls
|
||||
* during a request.
|
||||
* Example uses for UpDownCounter:
|
||||
* <ol>
|
||||
* <li> count the number of active requests. </li>
|
||||
* <li> count memory in use by instrumenting new and delete. </li>
|
||||
* <li> count queue size by instrumenting enqueue and dequeue. </li>
|
||||
* <li> count semaphore up and down operations. </li>
|
||||
* </ol>
|
||||
*
|
||||
* @param name the name of the metric.
|
||||
* @param [options] the metric options.
|
||||
*/
|
||||
createUpDownCounter<AttributesTypes extends MetricAttributes = MetricAttributes>(name: string, options?: MetricOptions): UpDownCounter<AttributesTypes>;
|
||||
/**
|
||||
* Creates a new `ObservableGauge` metric.
|
||||
*
|
||||
* The callback SHOULD be safe to be invoked concurrently.
|
||||
*
|
||||
* @param name the name of the metric.
|
||||
* @param [options] the metric options.
|
||||
*/
|
||||
createObservableGauge<AttributesTypes extends MetricAttributes = MetricAttributes>(name: string, options?: MetricOptions): ObservableGauge<AttributesTypes>;
|
||||
/**
|
||||
* Creates a new `ObservableCounter` metric.
|
||||
*
|
||||
* The callback SHOULD be safe to be invoked concurrently.
|
||||
*
|
||||
* @param name the name of the metric.
|
||||
* @param [options] the metric options.
|
||||
*/
|
||||
createObservableCounter<AttributesTypes extends MetricAttributes = MetricAttributes>(name: string, options?: MetricOptions): ObservableCounter<AttributesTypes>;
|
||||
/**
|
||||
* Creates a new `ObservableUpDownCounter` metric.
|
||||
*
|
||||
* The callback SHOULD be safe to be invoked concurrently.
|
||||
*
|
||||
* @param name the name of the metric.
|
||||
* @param [options] the metric options.
|
||||
*/
|
||||
createObservableUpDownCounter<AttributesTypes extends MetricAttributes = MetricAttributes>(name: string, options?: MetricOptions): ObservableUpDownCounter<AttributesTypes>;
|
||||
/**
|
||||
* Sets up a function that will be called whenever a metric collection is
|
||||
* initiated.
|
||||
*
|
||||
* If the function is already in the list of callbacks for this Observable,
|
||||
* the function is not added a second time.
|
||||
*
|
||||
* Only the associated observables can be observed in the callback.
|
||||
* Measurements of observables that are not associated observed in the
|
||||
* callback are dropped.
|
||||
*
|
||||
* @param callback the batch observable callback
|
||||
* @param observables the observables associated with this batch observable callback
|
||||
*/
|
||||
addBatchObservableCallback<AttributesTypes extends MetricAttributes = MetricAttributes>(callback: BatchObservableCallback<AttributesTypes>, observables: Observable<AttributesTypes>[]): void;
|
||||
/**
|
||||
* Removes a callback previously registered with {@link Meter.addBatchObservableCallback}.
|
||||
*
|
||||
* The callback to be removed is identified using a combination of the callback itself,
|
||||
* and the set of the observables associated with it.
|
||||
*
|
||||
* @param callback the batch observable callback
|
||||
* @param observables the observables associated with this batch observable callback
|
||||
*/
|
||||
removeBatchObservableCallback<AttributesTypes extends MetricAttributes = MetricAttributes>(callback: BatchObservableCallback<AttributesTypes>, observables: Observable<AttributesTypes>[]): void;
|
||||
}
|
||||
//# sourceMappingURL=Meter.d.ts.map
|
||||
6
node_modules/@opentelemetry/api/build/esm/metrics/Meter.js
generated
vendored
Normal file
6
node_modules/@opentelemetry/api/build/esm/metrics/Meter.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
export {};
|
||||
//# sourceMappingURL=Meter.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/metrics/Meter.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/metrics/Meter.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
19
node_modules/@opentelemetry/api/build/esm/metrics/MeterProvider.d.ts
generated
vendored
Normal file
19
node_modules/@opentelemetry/api/build/esm/metrics/MeterProvider.d.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import type { Meter, MeterOptions } from './Meter';
|
||||
/**
|
||||
* A registry for creating named {@link Meter}s.
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export interface MeterProvider {
|
||||
/**
|
||||
* Returns a Meter, creating one if one with the given name, version, and
|
||||
* schemaUrl pair is not already created.
|
||||
*
|
||||
* @param name The name of the meter or instrumentation library.
|
||||
* @param version The version of the meter or instrumentation library.
|
||||
* @param options The options of the meter or instrumentation library.
|
||||
* @returns Meter A Meter with the given name and version
|
||||
*/
|
||||
getMeter(name: string, version?: string, options?: MeterOptions): Meter;
|
||||
}
|
||||
//# sourceMappingURL=MeterProvider.d.ts.map
|
||||
6
node_modules/@opentelemetry/api/build/esm/metrics/MeterProvider.js
generated
vendored
Normal file
6
node_modules/@opentelemetry/api/build/esm/metrics/MeterProvider.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
export {};
|
||||
//# sourceMappingURL=MeterProvider.js.map
|
||||
1
node_modules/@opentelemetry/api/build/esm/metrics/MeterProvider.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/metrics/MeterProvider.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"MeterProvider.js","sourceRoot":"","sources":["../../../src/metrics/MeterProvider.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Meter, MeterOptions } from './Meter';\n\n/**\n * A registry for creating named {@link Meter}s.\n *\n * @since 1.3.0\n */\nexport interface MeterProvider {\n /**\n * Returns a Meter, creating one if one with the given name, version, and\n * schemaUrl pair is not already created.\n *\n * @param name The name of the meter or instrumentation library.\n * @param version The version of the meter or instrumentation library.\n * @param options The options of the meter or instrumentation library.\n * @returns Meter A Meter with the given name and version\n */\n getMeter(name: string, version?: string, options?: MeterOptions): Meter;\n}\n"]}
|
||||
183
node_modules/@opentelemetry/api/build/esm/metrics/Metric.d.ts
generated
vendored
Normal file
183
node_modules/@opentelemetry/api/build/esm/metrics/Metric.d.ts
generated
vendored
Normal file
@@ -0,0 +1,183 @@
|
||||
import type { Attributes, AttributeValue } from '../common/Attributes';
|
||||
import type { Context } from '../context/types';
|
||||
/**
|
||||
* Advisory options influencing aggregation configuration parameters.
|
||||
*
|
||||
* @since 1.7.0
|
||||
* @experimental
|
||||
*/
|
||||
export interface MetricAdvice {
|
||||
/**
|
||||
* Hint the explicit bucket boundaries for SDK if the metric is been
|
||||
* aggregated with a HistogramAggregator.
|
||||
*/
|
||||
explicitBucketBoundaries?: number[];
|
||||
}
|
||||
/**
|
||||
* Options needed for metric creation
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export interface MetricOptions {
|
||||
/**
|
||||
* The description of the Metric.
|
||||
* @default ''
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* The unit of the Metric values.
|
||||
* @default ''
|
||||
*/
|
||||
unit?: string;
|
||||
/**
|
||||
* Indicates the type of the recorded value.
|
||||
* @default {@link ValueType.DOUBLE}
|
||||
*/
|
||||
valueType?: ValueType;
|
||||
/**
|
||||
* The advice influencing aggregation configuration parameters.
|
||||
* @experimental
|
||||
* @since 1.7.0
|
||||
*/
|
||||
advice?: MetricAdvice;
|
||||
}
|
||||
/**
|
||||
* The Type of value. It describes how the data is reported.
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export declare enum ValueType {
|
||||
INT = 0,
|
||||
DOUBLE = 1
|
||||
}
|
||||
/**
|
||||
* Counter is the most common synchronous instrument. This instrument supports
|
||||
* an `Add(increment)` function for reporting a sum, and is restricted to
|
||||
* non-negative increments. The default aggregation is Sum, as for any additive
|
||||
* instrument.
|
||||
*
|
||||
* Example uses for Counter:
|
||||
* <ol>
|
||||
* <li> count the number of bytes received. </li>
|
||||
* <li> count the number of requests completed. </li>
|
||||
* <li> count the number of accounts created. </li>
|
||||
* <li> count the number of checkpoints run. </li>
|
||||
* <li> count the number of 5xx errors. </li>
|
||||
* <ol>
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export interface Counter<AttributesTypes extends MetricAttributes = MetricAttributes> {
|
||||
/**
|
||||
* Increment value of counter by the input. Inputs must not be negative.
|
||||
*/
|
||||
add(value: number, attributes?: AttributesTypes, context?: Context): void;
|
||||
}
|
||||
/**
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export interface UpDownCounter<AttributesTypes extends MetricAttributes = MetricAttributes> {
|
||||
/**
|
||||
* Increment value of counter by the input. Inputs may be negative.
|
||||
*/
|
||||
add(value: number, attributes?: AttributesTypes, context?: Context): void;
|
||||
}
|
||||
/**
|
||||
* @since 1.9.0
|
||||
*/
|
||||
export interface Gauge<AttributesTypes extends MetricAttributes = MetricAttributes> {
|
||||
/**
|
||||
* Records a measurement.
|
||||
*/
|
||||
record(value: number, attributes?: AttributesTypes, context?: Context): void;
|
||||
}
|
||||
/**
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export interface Histogram<AttributesTypes extends MetricAttributes = MetricAttributes> {
|
||||
/**
|
||||
* Records a measurement. Value of the measurement must not be negative.
|
||||
*/
|
||||
record(value: number, attributes?: AttributesTypes, context?: Context): void;
|
||||
}
|
||||
/**
|
||||
* @deprecated please use {@link Attributes}
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export type MetricAttributes = Attributes;
|
||||
/**
|
||||
* @deprecated please use {@link AttributeValue}
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export type MetricAttributeValue = AttributeValue;
|
||||
/**
|
||||
* Interface that is being used in callback function for Observable Metric.
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export interface ObservableResult<AttributesTypes extends MetricAttributes = MetricAttributes> {
|
||||
/**
|
||||
* Observe a measurement of the value associated with the given attributes.
|
||||
*
|
||||
* @param value The value to be observed.
|
||||
* @param attributes The attributes associated with the value. If more than
|
||||
* one value is associated with the same attributes values, SDK may pick the
|
||||
* last one or simply drop the entire observable result.
|
||||
*/
|
||||
observe(this: ObservableResult<AttributesTypes>, value: number, attributes?: AttributesTypes): void;
|
||||
}
|
||||
/**
|
||||
* Interface that is being used in batch observable callback function.
|
||||
*/
|
||||
export interface BatchObservableResult<AttributesTypes extends MetricAttributes = MetricAttributes> {
|
||||
/**
|
||||
* Observe a measurement of the value associated with the given attributes.
|
||||
*
|
||||
* @param metric The observable metric to be observed.
|
||||
* @param value The value to be observed.
|
||||
* @param attributes The attributes associated with the value. If more than
|
||||
* one value is associated with the same attributes values, SDK may pick the
|
||||
* last one or simply drop the entire observable result.
|
||||
*/
|
||||
observe(this: BatchObservableResult<AttributesTypes>, metric: Observable<AttributesTypes>, value: number, attributes?: AttributesTypes): void;
|
||||
}
|
||||
/**
|
||||
* The observable callback for Observable instruments.
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export type ObservableCallback<AttributesTypes extends MetricAttributes = MetricAttributes> = (observableResult: ObservableResult<AttributesTypes>) => void | Promise<void>;
|
||||
/**
|
||||
* The observable callback for a batch of Observable instruments.
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export type BatchObservableCallback<AttributesTypes extends MetricAttributes = MetricAttributes> = (observableResult: BatchObservableResult<AttributesTypes>) => void | Promise<void>;
|
||||
/**
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export interface Observable<AttributesTypes extends MetricAttributes = MetricAttributes> {
|
||||
/**
|
||||
* Sets up a function that will be called whenever a metric collection is initiated.
|
||||
*
|
||||
* If the function is already in the list of callbacks for this Observable, the function is not added a second time.
|
||||
*/
|
||||
addCallback(callback: ObservableCallback<AttributesTypes>): void;
|
||||
/**
|
||||
* Removes a callback previously registered with {@link Observable.addCallback}.
|
||||
*/
|
||||
removeCallback(callback: ObservableCallback<AttributesTypes>): void;
|
||||
}
|
||||
/**
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export type ObservableCounter<AttributesTypes extends MetricAttributes = MetricAttributes> = Observable<AttributesTypes>;
|
||||
/**
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export type ObservableUpDownCounter<AttributesTypes extends MetricAttributes = MetricAttributes> = Observable<AttributesTypes>;
|
||||
/**
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export type ObservableGauge<AttributesTypes extends MetricAttributes = MetricAttributes> = Observable<AttributesTypes>;
|
||||
//# sourceMappingURL=Metric.d.ts.map
|
||||
15
node_modules/@opentelemetry/api/build/esm/metrics/Metric.js
generated
vendored
Normal file
15
node_modules/@opentelemetry/api/build/esm/metrics/Metric.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
/**
|
||||
* The Type of value. It describes how the data is reported.
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export var ValueType;
|
||||
(function (ValueType) {
|
||||
ValueType[ValueType["INT"] = 0] = "INT";
|
||||
ValueType[ValueType["DOUBLE"] = 1] = "DOUBLE";
|
||||
})(ValueType || (ValueType = {}));
|
||||
//# sourceMappingURL=Metric.js.map
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user