@opentelemetry/api 0.8.3 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/README.md +3 -0
  2. package/build/src/api/context.d.ts +0 -15
  3. package/build/src/api/context.js +28 -24
  4. package/build/src/api/context.js.map +1 -0
  5. package/build/src/api/global-utils.d.ts +0 -15
  6. package/build/src/api/global-utils.js +7 -4
  7. package/build/src/api/global-utils.js.map +1 -0
  8. package/build/src/api/metrics.d.ts +0 -15
  9. package/build/src/api/metrics.js +22 -19
  10. package/build/src/api/metrics.js.map +1 -0
  11. package/build/src/api/propagation.d.ts +0 -15
  12. package/build/src/api/propagation.js +32 -25
  13. package/build/src/api/propagation.js.map +1 -0
  14. package/build/src/api/trace.d.ts +0 -15
  15. package/build/src/api/trace.js +22 -19
  16. package/build/src/api/trace.js.map +1 -0
  17. package/build/src/common/Logger.d.ts +0 -15
  18. package/build/src/common/Logger.js +2 -2
  19. package/build/src/common/Logger.js.map +1 -0
  20. package/build/src/common/Time.d.ts +0 -16
  21. package/build/src/common/Time.js +0 -15
  22. package/build/src/common/Time.js.map +1 -0
  23. package/build/src/context/propagation/HttpTextPropagator.d.ts +0 -15
  24. package/build/src/context/propagation/HttpTextPropagator.js +2 -2
  25. package/build/src/context/propagation/HttpTextPropagator.js.map +1 -0
  26. package/build/src/context/propagation/NoopHttpTextPropagator.d.ts +0 -15
  27. package/build/src/context/propagation/NoopHttpTextPropagator.js +11 -7
  28. package/build/src/context/propagation/NoopHttpTextPropagator.js.map +1 -0
  29. package/build/src/context/propagation/getter.d.ts +0 -15
  30. package/build/src/context/propagation/getter.js +3 -2
  31. package/build/src/context/propagation/getter.js.map +1 -0
  32. package/build/src/context/propagation/setter.d.ts +0 -15
  33. package/build/src/context/propagation/setter.js +3 -2
  34. package/build/src/context/propagation/setter.js.map +1 -0
  35. package/build/src/correlation_context/CorrelationContext.d.ts +0 -15
  36. package/build/src/correlation_context/CorrelationContext.js +2 -2
  37. package/build/src/correlation_context/CorrelationContext.js.map +1 -0
  38. package/build/src/correlation_context/EntryValue.d.ts +0 -19
  39. package/build/src/correlation_context/EntryValue.js +1 -15
  40. package/build/src/correlation_context/EntryValue.js.map +1 -0
  41. package/build/src/index.d.ts +3 -16
  42. package/build/src/index.js +55 -23
  43. package/build/src/index.js.map +1 -0
  44. package/build/src/metrics/BatchObserverResult.d.ts +15 -0
  45. package/build/src/metrics/{MetricObservable.js → BatchObserverResult.js} +3 -3
  46. package/build/src/metrics/BatchObserverResult.js.map +1 -0
  47. package/build/src/metrics/BoundInstrument.d.ts +10 -21
  48. package/build/src/metrics/BoundInstrument.js +2 -2
  49. package/build/src/metrics/BoundInstrument.js.map +1 -0
  50. package/build/src/metrics/Meter.d.ts +35 -21
  51. package/build/src/metrics/Meter.js +2 -2
  52. package/build/src/metrics/Meter.js.map +1 -0
  53. package/build/src/metrics/MeterProvider.d.ts +0 -15
  54. package/build/src/metrics/MeterProvider.js +2 -2
  55. package/build/src/metrics/MeterProvider.js.map +1 -0
  56. package/build/src/metrics/Metric.d.ts +33 -33
  57. package/build/src/metrics/Metric.js +3 -2
  58. package/build/src/metrics/Metric.js.map +1 -0
  59. package/build/src/metrics/NoopMeter.d.ts +39 -28
  60. package/build/src/metrics/NoopMeter.js +126 -47
  61. package/build/src/metrics/NoopMeter.js.map +1 -0
  62. package/build/src/metrics/NoopMeterProvider.d.ts +0 -15
  63. package/build/src/metrics/NoopMeterProvider.js +11 -7
  64. package/build/src/metrics/NoopMeterProvider.js.map +1 -0
  65. package/build/src/metrics/Observation.d.ts +9 -0
  66. package/build/src/metrics/Observation.js +18 -0
  67. package/build/src/metrics/Observation.js.map +1 -0
  68. package/build/src/metrics/ObserverResult.d.ts +2 -18
  69. package/build/src/metrics/ObserverResult.js +2 -2
  70. package/build/src/metrics/ObserverResult.js.map +1 -0
  71. package/build/src/platform/browser/globalThis.d.ts +0 -15
  72. package/build/src/platform/browser/globalThis.js +3 -2
  73. package/build/src/platform/browser/globalThis.js.map +1 -0
  74. package/build/src/platform/browser/index.d.ts +0 -15
  75. package/build/src/platform/browser/index.js +13 -6
  76. package/build/src/platform/browser/index.js.map +1 -0
  77. package/build/src/platform/index.d.ts +0 -15
  78. package/build/src/platform/index.js +13 -6
  79. package/build/src/platform/index.js.map +1 -0
  80. package/build/src/platform/node/globalThis.d.ts +0 -15
  81. package/build/src/platform/node/globalThis.js +3 -2
  82. package/build/src/platform/node/globalThis.js.map +1 -0
  83. package/build/src/platform/node/index.d.ts +0 -15
  84. package/build/src/platform/node/index.js +13 -6
  85. package/build/src/platform/node/index.js.map +1 -0
  86. package/build/src/trace/Event.d.ts +0 -15
  87. package/build/src/trace/Event.js +2 -2
  88. package/build/src/trace/Event.js.map +1 -0
  89. package/build/src/trace/NoopSpan.d.ts +0 -15
  90. package/build/src/trace/NoopSpan.js +25 -22
  91. package/build/src/trace/NoopSpan.js.map +1 -0
  92. package/build/src/trace/NoopTracer.d.ts +0 -15
  93. package/build/src/trace/NoopTracer.js +17 -13
  94. package/build/src/trace/NoopTracer.js.map +1 -0
  95. package/build/src/trace/NoopTracerProvider.d.ts +0 -15
  96. package/build/src/trace/NoopTracerProvider.js +11 -7
  97. package/build/src/trace/NoopTracerProvider.js.map +1 -0
  98. package/build/src/trace/Sampler.d.ts +15 -19
  99. package/build/src/trace/Sampler.js +2 -2
  100. package/build/src/trace/Sampler.js.map +1 -0
  101. package/build/src/trace/SamplingResult.d.ts +39 -0
  102. package/build/src/trace/SamplingResult.js +41 -0
  103. package/build/src/trace/SamplingResult.js.map +1 -0
  104. package/build/src/trace/SpanOptions.d.ts +0 -15
  105. package/build/src/trace/SpanOptions.js +2 -2
  106. package/build/src/trace/SpanOptions.js.map +1 -0
  107. package/build/src/trace/TimedEvent.d.ts +0 -15
  108. package/build/src/trace/TimedEvent.js +2 -2
  109. package/build/src/trace/TimedEvent.js.map +1 -0
  110. package/build/src/trace/attributes.d.ts +0 -19
  111. package/build/src/trace/attributes.js +0 -15
  112. package/build/src/trace/attributes.js.map +1 -0
  113. package/build/src/trace/instrumentation/Plugin.d.ts +0 -15
  114. package/build/src/trace/instrumentation/Plugin.js +2 -2
  115. package/build/src/trace/instrumentation/Plugin.js.map +1 -0
  116. package/build/src/trace/link.d.ts +0 -15
  117. package/build/src/trace/link.js +2 -2
  118. package/build/src/trace/link.js.map +1 -0
  119. package/build/src/trace/link_context.d.ts +0 -15
  120. package/build/src/trace/link_context.js +2 -2
  121. package/build/src/trace/link_context.js.map +1 -0
  122. package/build/src/trace/span.d.ts +0 -15
  123. package/build/src/trace/span.js +2 -2
  124. package/build/src/trace/span.js.map +1 -0
  125. package/build/src/trace/span_context.d.ts +0 -15
  126. package/build/src/trace/span_context.js +2 -2
  127. package/build/src/trace/span_context.js.map +1 -0
  128. package/build/src/trace/span_kind.d.ts +0 -19
  129. package/build/src/trace/span_kind.js +4 -7
  130. package/build/src/trace/span_kind.js.map +1 -0
  131. package/build/src/trace/status.d.ts +0 -19
  132. package/build/src/trace/status.js +1 -15
  133. package/build/src/trace/status.js.map +1 -0
  134. package/build/src/trace/trace_flags.d.ts +0 -20
  135. package/build/src/trace/trace_flags.js +4 -8
  136. package/build/src/trace/trace_flags.js.map +1 -0
  137. package/build/src/trace/trace_state.d.ts +0 -20
  138. package/build/src/trace/trace_state.js +0 -15
  139. package/build/src/trace/trace_state.js.map +1 -0
  140. package/build/src/trace/tracer.d.ts +1 -16
  141. package/build/src/trace/tracer.js +2 -2
  142. package/build/src/trace/tracer.js.map +1 -0
  143. package/build/src/trace/tracer_provider.d.ts +0 -15
  144. package/build/src/trace/tracer_provider.js +2 -2
  145. package/build/src/trace/tracer_provider.js.map +1 -0
  146. package/build/src/version.d.ts +1 -1
  147. package/build/src/version.js +3 -2
  148. package/build/src/version.js.map +1 -0
  149. package/package.json +24 -22
  150. package/build/src/metrics/MetricObservable.d.ts +0 -36
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- /*!
3
- * Copyright 2019, OpenTelemetry Authors
2
+ /*
3
+ * Copyright The OpenTelemetry Authors
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpTextPropagator.js","sourceRoot":"","sources":["../../../../src/context/propagation/HttpTextPropagator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG"}
@@ -1,18 +1,3 @@
1
- /*!
2
- * Copyright 2019, OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
1
  import { Context } from '@opentelemetry/context-base';
17
2
  import { HttpTextPropagator } from './HttpTextPropagator';
18
3
  /**
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- /*!
3
- * Copyright 2019, OpenTelemetry Authors
2
+ /*
3
+ * Copyright The OpenTelemetry Authors
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -15,17 +15,21 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.NOOP_HTTP_TEXT_PROPAGATOR = exports.NoopHttpTextPropagator = void 0;
18
19
  /**
19
20
  * No-op implementations of {@link HttpTextPropagator}.
20
21
  */
21
- class NoopHttpTextPropagator {
22
+ var NoopHttpTextPropagator = /** @class */ (function () {
23
+ function NoopHttpTextPropagator() {
24
+ }
22
25
  /** Noop inject function does nothing */
23
- inject(context, carrier, setter) { }
26
+ NoopHttpTextPropagator.prototype.inject = function (context, carrier, setter) { };
24
27
  /** Noop extract function does nothing and returns the input context */
25
- extract(context, carrier, getter) {
28
+ NoopHttpTextPropagator.prototype.extract = function (context, carrier, getter) {
26
29
  return context;
27
- }
28
- }
30
+ };
31
+ return NoopHttpTextPropagator;
32
+ }());
29
33
  exports.NoopHttpTextPropagator = NoopHttpTextPropagator;
30
34
  exports.NOOP_HTTP_TEXT_PROPAGATOR = new NoopHttpTextPropagator();
31
35
  //# sourceMappingURL=NoopHttpTextPropagator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NoopHttpTextPropagator.js","sourceRoot":"","sources":["../../../../src/context/propagation/NoopHttpTextPropagator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAKH;;GAEG;AACH;IAAA;IAOA,CAAC;IANC,wCAAwC;IACxC,uCAAM,GAAN,UAAO,OAAgB,EAAE,OAAgB,EAAE,MAAgB,IAAS,CAAC;IACrE,uEAAuE;IACvE,wCAAO,GAAP,UAAQ,OAAgB,EAAE,OAAgB,EAAE,MAAgB;QAC1D,OAAO,OAAO,CAAC;IACjB,CAAC;IACH,6BAAC;AAAD,CAAC,AAPD,IAOC;AAPY,wDAAsB;AAStB,QAAA,yBAAyB,GAAG,IAAI,sBAAsB,EAAE,CAAC"}
@@ -1,18 +1,3 @@
1
- /*!
2
- * Copyright 2020, OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
1
  export declare type GetterFunction<Carrier = any> = (carrier: Carrier, key: string) => unknown;
17
2
  /**
18
3
  * Default getter which just does a simple property access. Returns
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- /*!
3
- * Copyright 2020, OpenTelemetry Authors
2
+ /*
3
+ * Copyright The OpenTelemetry Authors
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.defaultGetter = void 0;
18
19
  /**
19
20
  * Default getter which just does a simple property access. Returns
20
21
  * undefined if the key is not set.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getter.js","sourceRoot":"","sources":["../../../../src/context/propagation/getter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAOH;;;;;;GAMG;AACH,SAAgB,aAAa,CAAC,OAAY,EAAE,GAAW;IACrD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC;AACtB,CAAC;AAFD,sCAEC"}
@@ -1,18 +1,3 @@
1
- /*!
2
- * Copyright 2020, OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
1
  export declare type SetterFunction<Carrier = any> = (carrier: Carrier, key: string, value: unknown) => void;
17
2
  /**
18
3
  * Default setter which sets value via direct property access
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- /*!
3
- * Copyright 2020, OpenTelemetry Authors
2
+ /*
3
+ * Copyright The OpenTelemetry Authors
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.defaultSetter = void 0;
18
19
  /**
19
20
  * Default setter which sets value via direct property access
20
21
  *
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setter.js","sourceRoot":"","sources":["../../../../src/context/propagation/setter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAQH;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,OAAY,EAAE,GAAW,EAAE,KAAc;IACrE,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AACvB,CAAC;AAFD,sCAEC"}
@@ -1,18 +1,3 @@
1
- /*!
2
- * Copyright 2019, OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
1
  import { EntryValue } from './EntryValue';
17
2
  /**
18
3
  * CorrelationContext represents collection of entries. Each key of
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- /*!
3
- * Copyright 2019, OpenTelemetry Authors
2
+ /*
3
+ * Copyright The OpenTelemetry Authors
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CorrelationContext.js","sourceRoot":"","sources":["../../../src/correlation_context/CorrelationContext.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG"}
@@ -1,22 +1,3 @@
1
- /*!
2
- * Copyright 2019, OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- /**
17
- * {@link EntryValue} contains properties associated with a {@link
18
- * CorrelationContext}.
19
- */
20
1
  export interface EntryValue {
21
2
  /** `String` value of the `EntryValue`. */
22
3
  value: string;
@@ -1,20 +1,6 @@
1
1
  "use strict";
2
- /*!
3
- * Copyright 2019, OpenTelemetry Authors
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * https://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EntryTtl = void 0;
18
4
  /**
19
5
  * EntryTtl is an integer that represents number of hops an entry can propagate.
20
6
  *
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntryValue.js","sourceRoot":"","sources":["../../../src/correlation_context/EntryValue.ts"],"names":[],"mappings":";;;AAyBA;;;;GAIG;AACH,IAAY,QASX;AATD,WAAY,QAAQ;IAClB;;;OAGG;IACH,2DAAkB,CAAA;IAElB,0DAA0D;IAC1D,0EAA0B,CAAA;AAC5B,CAAC,EATW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QASnB"}
@@ -1,18 +1,3 @@
1
- /*!
2
- * Copyright 2019, OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
1
  export * from './common/Logger';
17
2
  export * from './common/Time';
18
3
  export * from './context/propagation/getter';
@@ -21,13 +6,14 @@ export * from './context/propagation/NoopHttpTextPropagator';
21
6
  export * from './context/propagation/setter';
22
7
  export * from './correlation_context/CorrelationContext';
23
8
  export * from './correlation_context/EntryValue';
9
+ export * from './metrics/BatchObserverResult';
24
10
  export * from './metrics/BoundInstrument';
25
11
  export * from './metrics/Meter';
26
12
  export * from './metrics/MeterProvider';
27
13
  export * from './metrics/Metric';
28
- export * from './metrics/MetricObservable';
29
14
  export * from './metrics/NoopMeter';
30
15
  export * from './metrics/NoopMeterProvider';
16
+ export * from './metrics/Observation';
31
17
  export * from './metrics/ObserverResult';
32
18
  export * from './trace/attributes';
33
19
  export * from './trace/Event';
@@ -38,6 +24,7 @@ export * from './trace/NoopSpan';
38
24
  export * from './trace/NoopTracer';
39
25
  export * from './trace/NoopTracerProvider';
40
26
  export * from './trace/Sampler';
27
+ export * from './trace/SamplingResult';
41
28
  export * from './trace/span_context';
42
29
  export * from './trace/span_kind';
43
30
  export * from './trace/span';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- /*!
3
- * Copyright 2019, OpenTelemetry Authors
2
+ /*
3
+ * Copyright The OpenTelemetry Authors
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -14,35 +14,67 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- function __export(m) {
18
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
19
- }
17
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
25
+ for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
26
+ };
20
27
  Object.defineProperty(exports, "__esModule", { value: true });
21
- __export(require("./context/propagation/getter"));
22
- __export(require("./context/propagation/NoopHttpTextPropagator"));
23
- __export(require("./context/propagation/setter"));
24
- __export(require("./correlation_context/EntryValue"));
25
- __export(require("./metrics/Metric"));
26
- __export(require("./metrics/NoopMeter"));
27
- __export(require("./metrics/NoopMeterProvider"));
28
- __export(require("./trace/NoopSpan"));
29
- __export(require("./trace/NoopTracer"));
30
- __export(require("./trace/NoopTracerProvider"));
31
- __export(require("./trace/span_kind"));
32
- __export(require("./trace/status"));
33
- __export(require("./trace/trace_flags"));
28
+ exports.propagation = exports.metrics = exports.trace = exports.context = void 0;
29
+ __exportStar(require("./common/Logger"), exports);
30
+ __exportStar(require("./common/Time"), exports);
31
+ __exportStar(require("./context/propagation/getter"), exports);
32
+ __exportStar(require("./context/propagation/HttpTextPropagator"), exports);
33
+ __exportStar(require("./context/propagation/NoopHttpTextPropagator"), exports);
34
+ __exportStar(require("./context/propagation/setter"), exports);
35
+ __exportStar(require("./correlation_context/CorrelationContext"), exports);
36
+ __exportStar(require("./correlation_context/EntryValue"), exports);
37
+ __exportStar(require("./metrics/BatchObserverResult"), exports);
38
+ __exportStar(require("./metrics/BoundInstrument"), exports);
39
+ __exportStar(require("./metrics/Meter"), exports);
40
+ __exportStar(require("./metrics/MeterProvider"), exports);
41
+ __exportStar(require("./metrics/Metric"), exports);
42
+ __exportStar(require("./metrics/NoopMeter"), exports);
43
+ __exportStar(require("./metrics/NoopMeterProvider"), exports);
44
+ __exportStar(require("./metrics/Observation"), exports);
45
+ __exportStar(require("./metrics/ObserverResult"), exports);
46
+ __exportStar(require("./trace/attributes"), exports);
47
+ __exportStar(require("./trace/Event"), exports);
48
+ __exportStar(require("./trace/instrumentation/Plugin"), exports);
49
+ __exportStar(require("./trace/link_context"), exports);
50
+ __exportStar(require("./trace/link"), exports);
51
+ __exportStar(require("./trace/NoopSpan"), exports);
52
+ __exportStar(require("./trace/NoopTracer"), exports);
53
+ __exportStar(require("./trace/NoopTracerProvider"), exports);
54
+ __exportStar(require("./trace/Sampler"), exports);
55
+ __exportStar(require("./trace/SamplingResult"), exports);
56
+ __exportStar(require("./trace/span_context"), exports);
57
+ __exportStar(require("./trace/span_kind"), exports);
58
+ __exportStar(require("./trace/span"), exports);
59
+ __exportStar(require("./trace/SpanOptions"), exports);
60
+ __exportStar(require("./trace/status"), exports);
61
+ __exportStar(require("./trace/TimedEvent"), exports);
62
+ __exportStar(require("./trace/trace_flags"), exports);
63
+ __exportStar(require("./trace/trace_state"), exports);
64
+ __exportStar(require("./trace/tracer_provider"), exports);
65
+ __exportStar(require("./trace/tracer"), exports);
34
66
  var context_base_1 = require("@opentelemetry/context-base");
35
- exports.Context = context_base_1.Context;
36
- const context_1 = require("./api/context");
67
+ Object.defineProperty(exports, "Context", { enumerable: true, get: function () { return context_base_1.Context; } });
68
+ var context_1 = require("./api/context");
37
69
  /** Entrypoint for context API */
38
70
  exports.context = context_1.ContextAPI.getInstance();
39
- const trace_1 = require("./api/trace");
71
+ var trace_1 = require("./api/trace");
40
72
  /** Entrypoint for trace API */
41
73
  exports.trace = trace_1.TraceAPI.getInstance();
42
- const metrics_1 = require("./api/metrics");
74
+ var metrics_1 = require("./api/metrics");
43
75
  /** Entrypoint for metrics API */
44
76
  exports.metrics = metrics_1.MetricsAPI.getInstance();
45
- const propagation_1 = require("./api/propagation");
77
+ var propagation_1 = require("./api/propagation");
46
78
  /** Entrypoint for propagation API */
47
79
  exports.propagation = propagation_1.PropagationAPI.getInstance();
48
80
  exports.default = {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;AAEH,kDAAgC;AAChC,gDAA8B;AAC9B,+DAA6C;AAC7C,2EAAyD;AACzD,+EAA6D;AAC7D,+DAA6C;AAC7C,2EAAyD;AACzD,mEAAiD;AACjD,gEAA8C;AAC9C,4DAA0C;AAC1C,kDAAgC;AAChC,0DAAwC;AACxC,mDAAiC;AACjC,sDAAoC;AACpC,8DAA4C;AAC5C,wDAAsC;AACtC,2DAAyC;AACzC,qDAAmC;AACnC,gDAA8B;AAC9B,iEAA+C;AAC/C,uDAAqC;AACrC,+CAA6B;AAC7B,mDAAiC;AACjC,qDAAmC;AACnC,6DAA2C;AAC3C,kDAAgC;AAChC,yDAAuC;AACvC,uDAAqC;AACrC,oDAAkC;AAClC,+CAA6B;AAC7B,sDAAoC;AACpC,iDAA+B;AAC/B,qDAAmC;AACnC,sDAAoC;AACpC,sDAAoC;AACpC,0DAAwC;AACxC,iDAA+B;AAE/B,4DAAsD;AAA7C,uGAAA,OAAO,OAAA;AAEhB,yCAA2C;AAC3C,iCAAiC;AACpB,QAAA,OAAO,GAAG,oBAAU,CAAC,WAAW,EAAE,CAAC;AAEhD,qCAAuC;AACvC,+BAA+B;AAClB,QAAA,KAAK,GAAG,gBAAQ,CAAC,WAAW,EAAE,CAAC;AAE5C,yCAA2C;AAC3C,iCAAiC;AACpB,QAAA,OAAO,GAAG,oBAAU,CAAC,WAAW,EAAE,CAAC;AAEhD,iDAAmD;AACnD,qCAAqC;AACxB,QAAA,WAAW,GAAG,4BAAc,CAAC,WAAW,EAAE,CAAC;AAExD,kBAAe;IACb,KAAK,eAAA;IACL,OAAO,iBAAA;IACP,OAAO,iBAAA;IACP,WAAW,qBAAA;CACZ,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { Labels } from './Metric';
2
+ import { Observation } from './Observation';
3
+ /**
4
+ * Interface that is being used in callback function for Observer Metric
5
+ * for batch
6
+ */
7
+ export interface BatchObserverResult {
8
+ /**
9
+ * Used to observe (update) observations for certain labels
10
+ * @param labels
11
+ * @param observations
12
+ */
13
+ observe(labels: Labels, observations: Observation[]): void;
14
+ }
15
+ //# sourceMappingURL=BatchObserverResult.d.ts.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- /*!
3
- * Copyright 2020, OpenTelemetry Authors
2
+ /*
3
+ * Copyright The OpenTelemetry Authors
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -15,4 +15,4 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- //# sourceMappingURL=MetricObservable.js.map
18
+ //# sourceMappingURL=BatchObserverResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BatchObserverResult.js","sourceRoot":"","sources":["../../../src/metrics/BatchObserverResult.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG"}
@@ -1,18 +1,3 @@
1
- /*!
2
- * Copyright 2019, OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
1
  import { CorrelationContext } from '../correlation_context/CorrelationContext';
17
2
  import { SpanContext } from '../trace/span_context';
18
3
  /** An Instrument for Counter Metric. */
@@ -23,18 +8,22 @@ export interface BoundCounter {
23
8
  */
24
9
  add(value: number): void;
25
10
  }
26
- /** Measure to report instantaneous measurement of a value. */
27
- export interface BoundMeasure {
11
+ /** ValueRecorder to report instantaneous measurement of a value. */
12
+ export interface BoundValueRecorder {
28
13
  /**
29
- * Records the given value to this measure.
30
- * @param value the measurement to record.
14
+ * Records the given value to this value recorder.
15
+ * @param value to record.
31
16
  * @param correlationContext the correlationContext associated with the
32
- * measurements.
17
+ * values.
33
18
  * @param spanContext the {@link SpanContext} that identifies the {@link Span}
34
- * for which the measurements are associated with.
19
+ * which the values are associated with.
35
20
  */
36
21
  record(value: number): void;
37
22
  record(value: number, correlationContext: CorrelationContext): void;
38
23
  record(value: number, correlationContext: CorrelationContext, spanContext: SpanContext): void;
39
24
  }
25
+ /** An Instrument for Base Observer */
26
+ export interface BoundBaseObserver {
27
+ update(value: number): void;
28
+ }
40
29
  //# sourceMappingURL=BoundInstrument.d.ts.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- /*!
3
- * Copyright 2019, OpenTelemetry Authors
2
+ /*
3
+ * Copyright The OpenTelemetry Authors
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BoundInstrument.js","sourceRoot":"","sources":["../../../src/metrics/BoundInstrument.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG"}
@@ -1,33 +1,20 @@
1
- /*!
2
- * Copyright 2019, OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { MetricOptions, Counter, Measure, Observer } from './Metric';
1
+ import { BatchObserverResult } from './BatchObserverResult';
2
+ import { MetricOptions, Counter, ValueRecorder, ValueObserver, BatchObserver, BatchMetricOptions, UpDownCounter } from './Metric';
3
+ import { ObserverResult } from './ObserverResult';
17
4
  /**
18
5
  * An interface to allow the recording metrics.
19
6
  *
20
7
  * {@link Metric}s are used for recording pre-defined aggregation (`Counter`),
21
- * or raw values (`Measure`) in which the aggregation and labels
8
+ * or raw values (`ValueRecorder`) in which the aggregation and labels
22
9
  * for the exported metric are deferred.
23
10
  */
24
11
  export interface Meter {
25
12
  /**
26
- * Creates and returns a new `Measure`.
13
+ * Creates and returns a new `ValueRecorder`.
27
14
  * @param name the name of the metric.
28
15
  * @param [options] the metric options.
29
16
  */
30
- createMeasure(name: string, options?: MetricOptions): Measure;
17
+ createValueRecorder(name: string, options?: MetricOptions): ValueRecorder;
31
18
  /**
32
19
  * Creates a new `Counter` metric. Generally, this kind of metric when the
33
20
  * value is a quantity, the sum is of primary interest, and the event count
@@ -37,10 +24,37 @@ export interface Meter {
37
24
  */
38
25
  createCounter(name: string, options?: MetricOptions): Counter;
39
26
  /**
40
- * Creates a new `Observer` metric.
27
+ * Creates a new `UpDownCounter` metric. UpDownCounter is a synchronous
28
+ * instrument and very similar to Counter except that Add(increment)
29
+ * supports negative increments. It is generally useful for capturing changes
30
+ * in an amount of resources used, or any quantity that rises and falls
31
+ * during a request.
32
+ * Example uses for UpDownCounter:
33
+ * <ol>
34
+ * <li> count the number of active requests. </li>
35
+ * <li> count memory in use by instrumenting new and delete. </li>
36
+ * <li> count queue size by instrumenting enqueue and dequeue. </li>
37
+ * <li> count semaphore up and down operations. </li>
38
+ * </ol>
39
+ *
41
40
  * @param name the name of the metric.
42
41
  * @param [options] the metric options.
43
42
  */
44
- createObserver(name: string, options?: MetricOptions): Observer;
43
+ createUpDownCounter(name: string, options?: MetricOptions): UpDownCounter;
44
+ /**
45
+ * Creates a new `ValueObserver` metric.
46
+ * @param name the name of the metric.
47
+ * @param [options] the metric options.
48
+ * @param [callback] the observer callback
49
+ */
50
+ createValueObserver(name: string, options?: MetricOptions, callback?: (observerResult: ObserverResult) => void): ValueObserver;
51
+ /**
52
+ * Creates a new `BatchObserver` metric, can be used to update many metrics
53
+ * at the same time and when operations needs to be async
54
+ * @param name the name of the metric.
55
+ * @param callback the batch observer callback
56
+ * @param [options] the metric batch options.
57
+ */
58
+ createBatchObserver(name: string, callback: (batchObserverResult: BatchObserverResult) => void, options?: BatchMetricOptions): BatchObserver;
45
59
  }
46
60
  //# sourceMappingURL=Meter.d.ts.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- /*!
3
- * Copyright 2019, OpenTelemetry Authors
2
+ /*
3
+ * Copyright The OpenTelemetry Authors
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Meter.js","sourceRoot":"","sources":["../../../src/metrics/Meter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG"}
@@ -1,18 +1,3 @@
1
- /*!
2
- * Copyright 2019, OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
1
  import { Meter } from './Meter';
17
2
  /**
18
3
  * A registry for creating named {@link Meter}s.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- /*!
3
- * Copyright 2019, OpenTelemetry Authors
2
+ /*
3
+ * Copyright The OpenTelemetry Authors
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MeterProvider.js","sourceRoot":"","sources":["../../../src/metrics/MeterProvider.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG"}