@opentelemetry/api 1.7.0 → 1.9.0

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 (80) hide show
  1. package/README.md +1 -2
  2. package/build/esm/experimental/index.d.ts +3 -0
  3. package/build/esm/experimental/index.js +17 -0
  4. package/build/esm/experimental/index.js.map +1 -0
  5. package/build/esm/experimental/trace/SugaredOptions.d.ts +13 -0
  6. package/build/esm/experimental/trace/SugaredOptions.js +17 -0
  7. package/build/esm/experimental/trace/SugaredOptions.js.map +1 -0
  8. package/build/esm/experimental/trace/SugaredTracer.d.ts +64 -0
  9. package/build/esm/experimental/trace/SugaredTracer.js +92 -0
  10. package/build/esm/experimental/trace/SugaredTracer.js.map +1 -0
  11. package/build/esm/index.d.ts +1 -1
  12. package/build/esm/index.js.map +1 -1
  13. package/build/esm/metrics/Meter.d.ts +7 -1
  14. package/build/esm/metrics/Meter.js.map +1 -1
  15. package/build/esm/metrics/Metric.d.ts +6 -0
  16. package/build/esm/metrics/Metric.js.map +1 -1
  17. package/build/esm/metrics/NoopMeter.d.ts +9 -1
  18. package/build/esm/metrics/NoopMeter.js +16 -0
  19. package/build/esm/metrics/NoopMeter.js.map +1 -1
  20. package/build/esm/trace/NonRecordingSpan.d.ts +3 -0
  21. package/build/esm/trace/NonRecordingSpan.js +6 -0
  22. package/build/esm/trace/NonRecordingSpan.js.map +1 -1
  23. package/build/esm/trace/span.d.ts +19 -0
  24. package/build/esm/trace/span.js.map +1 -1
  25. package/build/esm/version.d.ts +1 -1
  26. package/build/esm/version.js +1 -1
  27. package/build/esm/version.js.map +1 -1
  28. package/build/esnext/experimental/index.d.ts +3 -0
  29. package/build/esnext/experimental/index.js +17 -0
  30. package/build/esnext/experimental/index.js.map +1 -0
  31. package/build/esnext/experimental/trace/SugaredOptions.d.ts +13 -0
  32. package/build/esnext/experimental/trace/SugaredOptions.js +17 -0
  33. package/build/esnext/experimental/trace/SugaredOptions.js.map +1 -0
  34. package/build/esnext/experimental/trace/SugaredTracer.d.ts +64 -0
  35. package/build/esnext/experimental/trace/SugaredTracer.js +88 -0
  36. package/build/esnext/experimental/trace/SugaredTracer.js.map +1 -0
  37. package/build/esnext/index.d.ts +1 -1
  38. package/build/esnext/index.js.map +1 -1
  39. package/build/esnext/metrics/Meter.d.ts +7 -1
  40. package/build/esnext/metrics/Meter.js.map +1 -1
  41. package/build/esnext/metrics/Metric.d.ts +6 -0
  42. package/build/esnext/metrics/Metric.js.map +1 -1
  43. package/build/esnext/metrics/NoopMeter.d.ts +9 -1
  44. package/build/esnext/metrics/NoopMeter.js +10 -0
  45. package/build/esnext/metrics/NoopMeter.js.map +1 -1
  46. package/build/esnext/trace/NonRecordingSpan.d.ts +3 -0
  47. package/build/esnext/trace/NonRecordingSpan.js +6 -0
  48. package/build/esnext/trace/NonRecordingSpan.js.map +1 -1
  49. package/build/esnext/trace/span.d.ts +19 -0
  50. package/build/esnext/trace/span.js.map +1 -1
  51. package/build/esnext/version.d.ts +1 -1
  52. package/build/esnext/version.js +1 -1
  53. package/build/esnext/version.js.map +1 -1
  54. package/build/src/experimental/index.d.ts +3 -0
  55. package/build/src/experimental/index.js +22 -0
  56. package/build/src/experimental/index.js.map +1 -0
  57. package/build/src/experimental/trace/SugaredOptions.d.ts +13 -0
  58. package/build/src/experimental/trace/SugaredOptions.js +18 -0
  59. package/build/src/experimental/trace/SugaredOptions.js.map +1 -0
  60. package/build/src/experimental/trace/SugaredTracer.d.ts +64 -0
  61. package/build/src/experimental/trace/SugaredTracer.js +93 -0
  62. package/build/src/experimental/trace/SugaredTracer.js.map +1 -0
  63. package/build/src/index.d.ts +1 -1
  64. package/build/src/index.js.map +1 -1
  65. package/build/src/metrics/Meter.d.ts +7 -1
  66. package/build/src/metrics/Meter.js.map +1 -1
  67. package/build/src/metrics/Metric.d.ts +6 -0
  68. package/build/src/metrics/Metric.js.map +1 -1
  69. package/build/src/metrics/NoopMeter.d.ts +9 -1
  70. package/build/src/metrics/NoopMeter.js +12 -1
  71. package/build/src/metrics/NoopMeter.js.map +1 -1
  72. package/build/src/trace/NonRecordingSpan.d.ts +3 -0
  73. package/build/src/trace/NonRecordingSpan.js +6 -0
  74. package/build/src/trace/NonRecordingSpan.js.map +1 -1
  75. package/build/src/trace/span.d.ts +19 -0
  76. package/build/src/trace/span.js.map +1 -1
  77. package/build/src/version.d.ts +1 -1
  78. package/build/src/version.js +1 -1
  79. package/build/src/version.js.map +1 -1
  80. package/package.json +24 -10
@@ -3,6 +3,7 @@ import { TimeInput } from '../common/Time';
3
3
  import { SpanAttributes, SpanAttributeValue } from './attributes';
4
4
  import { SpanContext } from './span_context';
5
5
  import { SpanStatus } from './status';
6
+ import { Link } from './link';
6
7
  /**
7
8
  * An interface that represents a span. A span represents a single operation
8
9
  * within a trace. Examples of span might include remote procedure calls or a
@@ -51,6 +52,24 @@ export interface Span {
51
52
  * @param [startTime] start time of the event.
52
53
  */
53
54
  addEvent(name: string, attributesOrStartTime?: SpanAttributes | TimeInput, startTime?: TimeInput): this;
55
+ /**
56
+ * Adds a single link to the span.
57
+ *
58
+ * Links added after the creation will not affect the sampling decision.
59
+ * It is preferred span links be added at span creation.
60
+ *
61
+ * @param link the link to add.
62
+ */
63
+ addLink(link: Link): this;
64
+ /**
65
+ * Adds multiple links to the span.
66
+ *
67
+ * Links added after the creation will not affect the sampling decision.
68
+ * It is preferred span links be added at span creation.
69
+ *
70
+ * @param links the links to add.
71
+ */
72
+ addLinks(links: Link[]): this;
54
73
  /**
55
74
  * Sets a status to the span. If used, this will override the default Span
56
75
  * status. Default is {@link SpanStatusCode.UNSET}. SetStatus overrides the value
@@ -1 +1 @@
1
- {"version":3,"file":"span.js","sourceRoot":"","sources":["../../../src/trace/span.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Exception } from '../common/Exception';\nimport { TimeInput } from '../common/Time';\nimport { SpanAttributes, SpanAttributeValue } from './attributes';\nimport { SpanContext } from './span_context';\nimport { SpanStatus } from './status';\n\n/**\n * An interface that represents a span. A span represents a single operation\n * within a trace. Examples of span might include remote procedure calls or a\n * in-process function calls to sub-components. A Trace has a single, top-level\n * \"root\" Span that in turn may have zero or more child Spans, which in turn\n * may have children.\n *\n * Spans are created by the {@link Tracer.startSpan} method.\n */\nexport interface Span {\n /**\n * Returns the {@link SpanContext} object associated with this Span.\n *\n * Get an immutable, serializable identifier for this span that can be used\n * to create new child spans. Returned SpanContext is usable even after the\n * span ends.\n *\n * @returns the SpanContext object associated with this Span.\n */\n spanContext(): SpanContext;\n\n /**\n * Sets an attribute to the span.\n *\n * Sets a single Attribute with the key and value passed as arguments.\n *\n * @param key the key for this attribute.\n * @param value the value for this attribute. Setting a value null or\n * undefined is invalid and will result in undefined behavior.\n */\n setAttribute(key: string, value: SpanAttributeValue): this;\n\n /**\n * Sets attributes to the span.\n *\n * @param attributes the attributes that will be added.\n * null or undefined attribute values\n * are invalid and will result in undefined behavior.\n */\n setAttributes(attributes: SpanAttributes): this;\n\n /**\n * Adds an event to the Span.\n *\n * @param name the name of the event.\n * @param [attributesOrStartTime] the attributes that will be added; these are\n * associated with this event. Can be also a start time\n * if type is {@type TimeInput} and 3rd param is undefined\n * @param [startTime] start time of the event.\n */\n addEvent(\n name: string,\n attributesOrStartTime?: SpanAttributes | TimeInput,\n startTime?: TimeInput\n ): this;\n\n /**\n * Sets a status to the span. If used, this will override the default Span\n * status. Default is {@link SpanStatusCode.UNSET}. SetStatus overrides the value\n * of previous calls to SetStatus on the Span.\n *\n * @param status the SpanStatus to set.\n */\n setStatus(status: SpanStatus): this;\n\n /**\n * Updates the Span name.\n *\n * This will override the name provided via {@link Tracer.startSpan}.\n *\n * Upon this update, any sampling behavior based on Span name will depend on\n * the implementation.\n *\n * @param name the Span name.\n */\n updateName(name: string): this;\n\n /**\n * Marks the end of Span execution.\n *\n * Call to End of a Span MUST not have any effects on child spans. Those may\n * still be running and can be ended later.\n *\n * Do not return `this`. The Span generally should not be used after it\n * is ended so chaining is not desired in this context.\n *\n * @param [endTime] the time to set as Span's end time. If not provided,\n * use the current time as the span's end time.\n */\n end(endTime?: TimeInput): void;\n\n /**\n * Returns the flag whether this span will be recorded.\n *\n * @returns true if this Span is active and recording information like events\n * with the `AddEvent` operation and attributes using `setAttributes`.\n */\n isRecording(): boolean;\n\n /**\n * Sets exception as a span event\n * @param exception the exception the only accepted values are string or Error\n * @param [time] the time to set as Span's event time. If not provided,\n * use the current time.\n */\n recordException(exception: Exception, time?: TimeInput): void;\n}\n"]}
1
+ {"version":3,"file":"span.js","sourceRoot":"","sources":["../../../src/trace/span.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Exception } from '../common/Exception';\nimport { TimeInput } from '../common/Time';\nimport { SpanAttributes, SpanAttributeValue } from './attributes';\nimport { SpanContext } from './span_context';\nimport { SpanStatus } from './status';\nimport { Link } from './link';\n\n/**\n * An interface that represents a span. A span represents a single operation\n * within a trace. Examples of span might include remote procedure calls or a\n * in-process function calls to sub-components. A Trace has a single, top-level\n * \"root\" Span that in turn may have zero or more child Spans, which in turn\n * may have children.\n *\n * Spans are created by the {@link Tracer.startSpan} method.\n */\nexport interface Span {\n /**\n * Returns the {@link SpanContext} object associated with this Span.\n *\n * Get an immutable, serializable identifier for this span that can be used\n * to create new child spans. Returned SpanContext is usable even after the\n * span ends.\n *\n * @returns the SpanContext object associated with this Span.\n */\n spanContext(): SpanContext;\n\n /**\n * Sets an attribute to the span.\n *\n * Sets a single Attribute with the key and value passed as arguments.\n *\n * @param key the key for this attribute.\n * @param value the value for this attribute. Setting a value null or\n * undefined is invalid and will result in undefined behavior.\n */\n setAttribute(key: string, value: SpanAttributeValue): this;\n\n /**\n * Sets attributes to the span.\n *\n * @param attributes the attributes that will be added.\n * null or undefined attribute values\n * are invalid and will result in undefined behavior.\n */\n setAttributes(attributes: SpanAttributes): this;\n\n /**\n * Adds an event to the Span.\n *\n * @param name the name of the event.\n * @param [attributesOrStartTime] the attributes that will be added; these are\n * associated with this event. Can be also a start time\n * if type is {@type TimeInput} and 3rd param is undefined\n * @param [startTime] start time of the event.\n */\n addEvent(\n name: string,\n attributesOrStartTime?: SpanAttributes | TimeInput,\n startTime?: TimeInput\n ): this;\n\n /**\n * Adds a single link to the span.\n *\n * Links added after the creation will not affect the sampling decision.\n * It is preferred span links be added at span creation.\n *\n * @param link the link to add.\n */\n addLink(link: Link): this;\n\n /**\n * Adds multiple links to the span.\n *\n * Links added after the creation will not affect the sampling decision.\n * It is preferred span links be added at span creation.\n *\n * @param links the links to add.\n */\n addLinks(links: Link[]): this;\n\n /**\n * Sets a status to the span. If used, this will override the default Span\n * status. Default is {@link SpanStatusCode.UNSET}. SetStatus overrides the value\n * of previous calls to SetStatus on the Span.\n *\n * @param status the SpanStatus to set.\n */\n setStatus(status: SpanStatus): this;\n\n /**\n * Updates the Span name.\n *\n * This will override the name provided via {@link Tracer.startSpan}.\n *\n * Upon this update, any sampling behavior based on Span name will depend on\n * the implementation.\n *\n * @param name the Span name.\n */\n updateName(name: string): this;\n\n /**\n * Marks the end of Span execution.\n *\n * Call to End of a Span MUST not have any effects on child spans. Those may\n * still be running and can be ended later.\n *\n * Do not return `this`. The Span generally should not be used after it\n * is ended so chaining is not desired in this context.\n *\n * @param [endTime] the time to set as Span's end time. If not provided,\n * use the current time as the span's end time.\n */\n end(endTime?: TimeInput): void;\n\n /**\n * Returns the flag whether this span will be recorded.\n *\n * @returns true if this Span is active and recording information like events\n * with the `AddEvent` operation and attributes using `setAttributes`.\n */\n isRecording(): boolean;\n\n /**\n * Sets exception as a span event\n * @param exception the exception the only accepted values are string or Error\n * @param [time] the time to set as Span's event time. If not provided,\n * use the current time.\n */\n recordException(exception: Exception, time?: TimeInput): void;\n}\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.7.0";
1
+ export declare const VERSION = "1.9.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -17,5 +17,5 @@
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.VERSION = void 0;
19
19
  // this is autogenerated file, see scripts/version-update.js
20
- exports.VERSION = '1.7.0';
20
+ exports.VERSION = '1.9.0';
21
21
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,OAAO,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '1.7.0';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,OAAO,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '1.9.0';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentelemetry/api",
3
- "version": "1.7.0",
3
+ "version": "1.9.0",
4
4
  "description": "Public API for OpenTelemetry",
5
5
  "main": "build/src/index.js",
6
6
  "module": "build/esm/index.js",
@@ -12,6 +12,20 @@
12
12
  "./build/esnext/platform/index.js": "./build/esnext/platform/browser/index.js",
13
13
  "./build/src/platform/index.js": "./build/src/platform/browser/index.js"
14
14
  },
15
+ "exports": {
16
+ ".": {
17
+ "module": "./build/esm/index.js",
18
+ "esnext": "./build/esnext/index.js",
19
+ "types": "./build/src/index.d.ts",
20
+ "default": "./build/src/index.js"
21
+ },
22
+ "./experimental": {
23
+ "module": "./build/esm/experimental/index.js",
24
+ "esnext": "./build/esnext/experimental/index.js",
25
+ "types": "./build/src/experimental/index.d.ts",
26
+ "default": "./build/src/experimental/index.js"
27
+ }
28
+ },
15
29
  "repository": "open-telemetry/opentelemetry-js",
16
30
  "scripts": {
17
31
  "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
@@ -66,34 +80,34 @@
66
80
  "access": "public"
67
81
  },
68
82
  "devDependencies": {
69
- "@types/mocha": "10.0.3",
83
+ "@types/mocha": "10.0.6",
70
84
  "@types/node": "18.6.5",
71
- "@types/sinon": "10.0.20",
72
- "@types/webpack": "4.41.35",
85
+ "@types/sinon": "17.0.3",
86
+ "@types/webpack": "5.28.5",
73
87
  "@types/webpack-env": "1.16.3",
74
88
  "babel-plugin-istanbul": "6.1.1",
75
89
  "codecov": "3.8.3",
76
90
  "cross-var": "1.1.0",
77
91
  "dpdm": "3.13.1",
78
- "karma": "6.4.2",
92
+ "karma": "6.4.3",
79
93
  "karma-chrome-launcher": "3.1.0",
80
94
  "karma-coverage": "2.2.1",
81
95
  "karma-mocha": "2.0.1",
82
96
  "karma-mocha-webworker": "1.3.0",
83
97
  "karma-spec-reporter": "0.0.36",
84
- "karma-webpack": "4.0.2",
98
+ "karma-webpack": "5.0.1",
85
99
  "lerna": "6.6.2",
86
100
  "memfs": "3.5.3",
87
101
  "mocha": "10.2.0",
88
102
  "nyc": "15.1.0",
89
103
  "sinon": "15.1.2",
90
- "ts-loader": "8.4.0",
104
+ "ts-loader": "9.5.1",
91
105
  "ts-mocha": "10.0.0",
92
106
  "typescript": "4.4.4",
93
- "unionfs": "4.5.1",
94
- "webpack": "4.46.0"
107
+ "unionfs": "4.5.4",
108
+ "webpack": "5.89.0"
95
109
  },
96
110
  "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/api",
97
111
  "sideEffects": false,
98
- "gitHead": "73b446688f10fd8dc4cf403a085f0a39070df7b4"
112
+ "gitHead": "c4d3351b6b3f5593c8d7cbfec97b45cea9fe1511"
99
113
  }