@xylabs/telemetry-exporter 5.0.94 → 5.0.96

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 (2) hide show
  1. package/README.md +92 -88
  2. package/package.json +7 -11
package/README.md CHANGED
@@ -1,43 +1,52 @@
1
1
  # @xylabs/telemetry-exporter
2
2
 
3
- [![logo][]](https://xylabs.com)
3
+ [![npm][npm-badge]][npm-link]
4
+ [![license][license-badge]][license-link]
4
5
 
5
- [![main-build][]][main-build-link]
6
- [![npm-badge][]][npm-link]
7
- [![npm-downloads-badge][]][npm-link]
8
- [![jsdelivr-badge][]][jsdelivr-link]
9
- [![npm-license-badge][]](LICENSE)
10
- [![codacy-badge][]][codacy-link]
11
- [![codeclimate-badge][]][codeclimate-link]
12
- [![snyk-badge][]][snyk-link]
13
- [![socket-badge][]][socket-link]
6
+ > Base functionality used throughout XY Labs TypeScript/JavaScript libraries
14
7
 
8
+ ## Install
15
9
 
16
- Base functionality used throughout XY Labs TypeScript/JavaScript libraries
10
+ Using npm:
17
11
 
12
+ ```sh
13
+ npm install {{name}}
14
+ ```
18
15
 
16
+ Using yarn:
19
17
 
20
- ## Reference
18
+ ```sh
19
+ yarn add {{name}}
20
+ ```
21
21
 
22
- **@xylabs/telemetry-exporter**
22
+ Using pnpm:
23
+
24
+ ```sh
25
+ pnpm add {{name}}
26
+ ```
27
+
28
+ Using bun:
29
+
30
+ ```sh
31
+ bun add {{name}}
32
+ ```
23
33
 
24
- ***
25
34
 
26
- ## Classes
35
+ ## License
27
36
 
28
- | Class | Description |
29
- | ------ | ------ |
30
- | [XyConsoleSpanExporter](#classes/XyConsoleSpanExporter) | A console span exporter that formats spans with color-coded durations using chalk. Spans are filtered by a configurable log level based on their duration. |
37
+ See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).
31
38
 
32
- ## Functions
39
+ ## Reference
33
40
 
34
- | Function | Description |
35
- | ------ | ------ |
36
- | [spanDurationInMillis](#functions/spanDurationInMillis) | Calculates the duration of a span in milliseconds from its high-resolution time tuple. |
41
+ ### packages
37
42
 
38
- ### classes
43
+ ### telemetry-exporter
39
44
 
40
- ### <a id="XyConsoleSpanExporter"></a>XyConsoleSpanExporter
45
+ ### .temp-typedoc
46
+
47
+ ### classes
48
+
49
+ ### <a id="XyConsoleSpanExporter"></a>XyConsoleSpanExporter
41
50
 
42
51
  [**@xylabs/telemetry-exporter**](#../README)
43
52
 
@@ -55,15 +64,18 @@ Spans are filtered by a configurable log level based on their duration.
55
64
  ### Constructor
56
65
 
57
66
  ```ts
58
- new XyConsoleSpanExporter(logLevel?: number, logger?: Logger): XyConsoleSpanExporter;
67
+ new XyConsoleSpanExporter(logLevel?, logger?): XyConsoleSpanExporter;
59
68
  ```
60
69
 
61
70
  ### Parameters
62
71
 
63
- | Parameter | Type | Default value |
64
- | ------ | ------ | ------ |
65
- | `logLevel` | `number` | `0` |
66
- | `logger` | `Logger` | `console` |
72
+ #### logLevel?
73
+
74
+ `number` = `0`
75
+
76
+ #### logger?
77
+
78
+ `Logger` = `console`
67
79
 
68
80
  ### Returns
69
81
 
@@ -77,11 +89,31 @@ ConsoleSpanExporter.constructor
77
89
 
78
90
  ## Properties
79
91
 
80
- | Property | Modifier | Type | Description |
81
- | ------ | ------ | ------ | ------ |
82
- | <a id="durationtologlevel"></a> `durationToLogLevel` | `readonly` | `number`[] | Duration thresholds (in ms) that map to increasing log levels. |
83
- | <a id="logleveltochalkcolor"></a> `logLevelToChalkColor` | `readonly` | `ChalkInstance`[] | Chalk color functions corresponding to each log level. |
84
- | <a id="logger"></a> `logger` | `public` | `Logger` | - |
92
+ ### durationToLogLevel
93
+
94
+ ```ts
95
+ readonly static durationToLogLevel: number[];
96
+ ```
97
+
98
+ Duration thresholds (in ms) that map to increasing log levels.
99
+
100
+ ***
101
+
102
+ ### logLevelToChalkColor
103
+
104
+ ```ts
105
+ readonly static logLevelToChalkColor: ChalkInstance[];
106
+ ```
107
+
108
+ Chalk color functions corresponding to each log level.
109
+
110
+ ***
111
+
112
+ ### logger
113
+
114
+ ```ts
115
+ logger: Logger;
116
+ ```
85
117
 
86
118
  ## Accessors
87
119
 
@@ -104,16 +136,16 @@ The minimum log level required for a span to be exported.
104
136
  ### export()
105
137
 
106
138
  ```ts
107
- export(spans: ReadableSpan[]): void;
139
+ export(spans): void;
108
140
  ```
109
141
 
110
142
  Export spans.
111
143
 
112
144
  ### Parameters
113
145
 
114
- | Parameter | Type | Description |
115
- | ------ | ------ | ------ |
116
- | `spans` | `ReadableSpan`[] | - |
146
+ #### spans
147
+
148
+ `ReadableSpan`[]
117
149
 
118
150
  ### Returns
119
151
 
@@ -130,16 +162,18 @@ ConsoleSpanExporter.export
130
162
  ### logColor()
131
163
 
132
164
  ```ts
133
- logColor(level: number): ChalkInstance;
165
+ logColor(level): ChalkInstance;
134
166
  ```
135
167
 
136
168
  Returns the chalk color function for the given log level.
137
169
 
138
170
  ### Parameters
139
171
 
140
- | Parameter | Type | Description |
141
- | ------ | ------ | ------ |
142
- | `level` | `number` | The log level index. |
172
+ #### level
173
+
174
+ `number`
175
+
176
+ The log level index.
143
177
 
144
178
  ### Returns
145
179
 
@@ -152,16 +186,18 @@ A chalk color function.
152
186
  ### spanLevel()
153
187
 
154
188
  ```ts
155
- spanLevel(span: ReadableSpan): number;
189
+ spanLevel(span): number;
156
190
  ```
157
191
 
158
192
  Determines the log level of a span based on its duration.
159
193
 
160
194
  ### Parameters
161
195
 
162
- | Parameter | Type | Description |
163
- | ------ | ------ | ------ |
164
- | `span` | `ReadableSpan` | The span to evaluate. |
196
+ #### span
197
+
198
+ `ReadableSpan`
199
+
200
+ The span to evaluate.
165
201
 
166
202
  ### Returns
167
203
 
@@ -169,25 +205,27 @@ Determines the log level of a span based on its duration.
169
205
 
170
206
  The numeric log level (index into durationToLogLevel).
171
207
 
172
- ### functions
208
+ ### functions
173
209
 
174
- ### <a id="spanDurationInMillis"></a>spanDurationInMillis
210
+ ### <a id="spanDurationInMillis"></a>spanDurationInMillis
175
211
 
176
212
  [**@xylabs/telemetry-exporter**](#../README)
177
213
 
178
214
  ***
179
215
 
180
216
  ```ts
181
- function spanDurationInMillis(span: ReadableSpan): number;
217
+ function spanDurationInMillis(span): number;
182
218
  ```
183
219
 
184
220
  Calculates the duration of a span in milliseconds from its high-resolution time tuple.
185
221
 
186
222
  ## Parameters
187
223
 
188
- | Parameter | Type | Description |
189
- | ------ | ------ | ------ |
190
- | `span` | `ReadableSpan` | The span to measure. |
224
+ ### span
225
+
226
+ `ReadableSpan`
227
+
228
+ The span to measure.
191
229
 
192
230
  ## Returns
193
231
 
@@ -196,41 +234,7 @@ Calculates the duration of a span in milliseconds from its high-resolution time
196
234
  The span duration in milliseconds.
197
235
 
198
236
 
199
- Part of [sdk-js](https://www.npmjs.com/package/@xyo-network/sdk-js)
200
-
201
- ## Maintainers
202
-
203
- - [Arie Trouw](https://github.com/arietrouw) ([arietrouw.com](https://arietrouw.com))
204
- - [Matt Jones](https://github.com/jonesmac)
205
- - [Joel Carter](https://github.com/JoelBCarter)
206
- - [Jordan Trouw](https://github.com/jordantrouw)
207
-
208
- ## License
209
-
210
- > See the [LICENSE](LICENSE) file for license details
211
-
212
- ## Credits
213
-
214
- [Made with 🔥 and ❄️ by XYLabs](https://xylabs.com)
215
-
216
- [logo]: https://cdn.xy.company/img/brand/XYPersistentCompany_Logo_Icon_Colored.svg
217
-
218
- [main-build]: https://github.com/xylabs/sdk-js/actions/workflows/build.yml/badge.svg
219
- [main-build-link]: https://github.com/xylabs/sdk-js/actions/workflows/build.yml
220
237
  [npm-badge]: https://img.shields.io/npm/v/@xylabs/telemetry-exporter.svg
221
238
  [npm-link]: https://www.npmjs.com/package/@xylabs/telemetry-exporter
222
- [codacy-badge]: https://app.codacy.com/project/badge/Grade/c8e15e14f37741c18cfb47ac7245c698
223
- [codacy-link]: https://www.codacy.com/gh/xylabs/sdk-js/dashboard?utm_source=github.com&utm_medium=referral&utm_content=xylabs/sdk-js&utm_campaign=Badge_Grade
224
- [codeclimate-badge]: https://api.codeclimate.com/v1/badges/c5eb068f806f0b047ea7/maintainability
225
- [codeclimate-link]: https://codeclimate.com/github/xylabs/sdk-js/maintainability
226
- [snyk-badge]: https://snyk.io/test/github/xylabs/sdk-js/badge.svg?targetFile=package.json
227
- [snyk-link]: https://snyk.io/test/github/xylabs/sdk-js?targetFile=package.json
228
-
229
- [npm-downloads-badge]: https://img.shields.io/npm/dw/@xylabs/telemetry-exporter
230
- [npm-license-badge]: https://img.shields.io/npm/l/@xylabs/telemetry-exporter
231
-
232
- [jsdelivr-badge]: https://data.jsdelivr.com/v1/package/npm/@xylabs/telemetry-exporter/badge
233
- [jsdelivr-link]: https://www.jsdelivr.com/package/npm/@xylabs/telemetry-exporter
234
-
235
- [socket-badge]: https://socket.dev/api/badge/npm/package/@xylabs/telemetry-exporter
236
- [socket-link]: https://socket.dev/npm/package/@xylabs/telemetry-exporter
239
+ [license-badge]: https://img.shields.io/npm/l/@xylabs/telemetry-exporter.svg
240
+ [license-link]: https://github.com/xylabs/sdk-js/blob/main/LICENSE
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylabs/telemetry-exporter",
3
- "version": "5.0.94",
3
+ "version": "5.0.96",
4
4
  "description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
5
5
  "keywords": [
6
6
  "hex",
@@ -29,12 +29,10 @@
29
29
  "exports": {
30
30
  ".": {
31
31
  "types": "./dist/neutral/index.d.ts",
32
- "import": "./dist/neutral/index.mjs",
33
32
  "default": "./dist/neutral/index.mjs"
34
33
  },
35
34
  "./package.json": "./package.json"
36
35
  },
37
- "types": "./dist/neutral/index.d.ts",
38
36
  "files": [
39
37
  "dist",
40
38
  "!**/*.bench.*",
@@ -45,19 +43,17 @@
45
43
  "dependencies": {
46
44
  "@opentelemetry/sdk-trace-base": "^2.6.1",
47
45
  "chalk": "~5.6.2",
48
- "@xylabs/logger": "~5.0.94"
46
+ "@xylabs/logger": "~5.0.96"
49
47
  },
50
48
  "devDependencies": {
51
49
  "@opentelemetry/api": "^1.9.1",
52
- "@types/node": "^25.5.2",
53
- "@xylabs/ts-scripts-common": "~7.7.3",
54
- "@xylabs/ts-scripts-pnpm": "~7.7.3",
55
- "@xylabs/tsconfig": "~7.7.3",
56
- "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0",
50
+ "@types/node": "^25.6.0",
51
+ "@xylabs/toolchain": "~7.10.4",
52
+ "@xylabs/tsconfig": "~7.10.4",
57
53
  "esbuild": "^0.28.0",
58
54
  "typescript": "^5",
59
- "vite": "^6.0.0 || ^7.0.0 || ^8.0.0",
60
- "vitest": "^4.1.2"
55
+ "vite": "^8.0.8",
56
+ "vitest": "^4.1.4"
61
57
  },
62
58
  "peerDependencies": {
63
59
  "@opentelemetry/api": "^1"