@bentocache/otel 0.1.1
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.
- package/LICENSE.md +9 -0
- package/README.md +30 -0
- package/build/index.d.ts +38 -0
- package/build/index.js +261 -0
- package/build/src/types.d.ts +48 -0
- package/build/src/types.js +0 -0
- package/package.json +84 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# The MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# @bentocache/otel
|
|
2
|
+
|
|
3
|
+
Official OpenTelemetry instrumentation for Bentocache.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @bentocache/otel
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { BentoCacheInstrumentation } from '@bentocache/otel'
|
|
15
|
+
|
|
16
|
+
const instrumentation = new BentoCacheInstrumentation({
|
|
17
|
+
requireParentSpan: true,
|
|
18
|
+
includeKeys: false,
|
|
19
|
+
suppressInternalOperations: true,
|
|
20
|
+
})
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Options
|
|
24
|
+
|
|
25
|
+
- `requireParentSpan` (default: `true`) Only create spans when a parent span exists
|
|
26
|
+
- `includeKeys` (default: `false`) Include cache keys in span attributes
|
|
27
|
+
- `keySanitizer` Sanitize keys before adding them as attributes
|
|
28
|
+
- `spanName` Custom span name factory
|
|
29
|
+
- `spanNamePrefix` (default: `cache`) Prefix for default span names
|
|
30
|
+
- `suppressInternalOperations` (default: `true`) Suppress internal L2/bus operations
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Span } from '@opentelemetry/api';
|
|
2
|
+
import { CacheOperationMessage } from 'bentocache';
|
|
3
|
+
import { TracingChannelSubscribers } from 'node:diagnostics_channel';
|
|
4
|
+
import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
|
|
5
|
+
import { BentoCacheInstrumentationConfig, BentoCacheModuleExports } from './src/types.js';
|
|
6
|
+
|
|
7
|
+
declare class BentoCacheInstrumentation extends InstrumentationBase<BentoCacheInstrumentationConfig> {
|
|
8
|
+
#private;
|
|
9
|
+
protected subscribed: boolean;
|
|
10
|
+
protected spans: WeakMap<object, Span>;
|
|
11
|
+
protected handlers?: TracingChannelSubscribers<CacheOperationMessage>;
|
|
12
|
+
/**
|
|
13
|
+
* Creates a new instrumentation instance with default and user config merged.
|
|
14
|
+
*/
|
|
15
|
+
constructor(config?: BentoCacheInstrumentationConfig);
|
|
16
|
+
/**
|
|
17
|
+
* Applies runtime config updates while preserving default values.
|
|
18
|
+
*/
|
|
19
|
+
setConfig(config?: BentoCacheInstrumentationConfig): void;
|
|
20
|
+
/**
|
|
21
|
+
* Declares the module patching lifecycle for bentocache instrumentation.
|
|
22
|
+
*/
|
|
23
|
+
protected init(): InstrumentationNodeModuleDefinition[];
|
|
24
|
+
/**
|
|
25
|
+
* Enables instrumentation and subscribes to diagnostics channels when possible.
|
|
26
|
+
*/
|
|
27
|
+
enable(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Disables instrumentation and cleans up subscribed channel handlers.
|
|
30
|
+
*/
|
|
31
|
+
disable(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Registers channel hooks manually when module interception is not available.
|
|
34
|
+
*/
|
|
35
|
+
manuallyRegister(moduleExports: BentoCacheModuleExports): void;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { BentoCacheInstrumentation, BentoCacheInstrumentationConfig };
|
package/build/index.js
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
// src/instrumentation.ts
|
|
2
|
+
import { suppressTracing } from "@opentelemetry/core";
|
|
3
|
+
import { context, SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
4
|
+
import {
|
|
5
|
+
InstrumentationBase,
|
|
6
|
+
InstrumentationNodeModuleDefinition
|
|
7
|
+
} from "@opentelemetry/instrumentation";
|
|
8
|
+
var DEFAULT_CONFIG = {
|
|
9
|
+
requireParentSpan: true,
|
|
10
|
+
includeKeys: false,
|
|
11
|
+
spanNamePrefix: "cache",
|
|
12
|
+
suppressInternalOperations: true
|
|
13
|
+
};
|
|
14
|
+
var BentoCacheInstrumentation = class extends InstrumentationBase {
|
|
15
|
+
subscribed = false;
|
|
16
|
+
spans = /* @__PURE__ */ new WeakMap();
|
|
17
|
+
handlers;
|
|
18
|
+
/**
|
|
19
|
+
* Tracks active getOrSet contexts so child operations (factory, set)
|
|
20
|
+
* can be parented to the getOrSet span. Keyed by `store:key`.
|
|
21
|
+
*/
|
|
22
|
+
#activeContexts = /* @__PURE__ */ new Map();
|
|
23
|
+
#cacheOperation;
|
|
24
|
+
#originalBentoCache;
|
|
25
|
+
/**
|
|
26
|
+
* Resolves CJS and ESM exports to a stable module shape.
|
|
27
|
+
*/
|
|
28
|
+
#getModuleExports(moduleExports) {
|
|
29
|
+
if (!moduleExports) return;
|
|
30
|
+
if (moduleExports[Symbol.toStringTag] === "Module") {
|
|
31
|
+
return moduleExports.default ?? moduleExports;
|
|
32
|
+
}
|
|
33
|
+
return moduleExports;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Replaces BentoCache constructor to inject instrumentation config wrappers.
|
|
37
|
+
*/
|
|
38
|
+
#patchBentoCache(moduleExports) {
|
|
39
|
+
if (!moduleExports.BentoCache) return;
|
|
40
|
+
if (!this.#originalBentoCache) {
|
|
41
|
+
this.#originalBentoCache = moduleExports.BentoCache;
|
|
42
|
+
}
|
|
43
|
+
if (moduleExports.BentoCache !== this.#originalBentoCache) return;
|
|
44
|
+
const original = this.#originalBentoCache;
|
|
45
|
+
const instrumentation = this;
|
|
46
|
+
const BentoCachePatched = class BentoCachePatched extends original {
|
|
47
|
+
/**
|
|
48
|
+
* Wraps user config before delegating to the original BentoCache constructor.
|
|
49
|
+
*/
|
|
50
|
+
constructor(config) {
|
|
51
|
+
super(instrumentation.#patchConfig(config));
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
Object.setPrototypeOf(BentoCachePatched, original);
|
|
55
|
+
try {
|
|
56
|
+
moduleExports.BentoCache = BentoCachePatched;
|
|
57
|
+
} catch {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Restores the original BentoCache constructor when instrumentation is removed.
|
|
63
|
+
*/
|
|
64
|
+
#unpatchBentoCache(moduleExports) {
|
|
65
|
+
if (!this.#originalBentoCache) return;
|
|
66
|
+
if (!moduleExports.BentoCache) return;
|
|
67
|
+
moduleExports.BentoCache = this.#originalBentoCache;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Adds internal operation suppression to BentoCache config when enabled.
|
|
71
|
+
*/
|
|
72
|
+
#patchConfig(config) {
|
|
73
|
+
if (!config || typeof config !== "object") return config;
|
|
74
|
+
const instrumentationConfig = this.getConfig();
|
|
75
|
+
if (instrumentationConfig.suppressInternalOperations !== true) return config;
|
|
76
|
+
const wrappedConfig = { ...config };
|
|
77
|
+
const suppressWrapper = (fn) => context.with(suppressTracing(context.active()), fn);
|
|
78
|
+
if (wrappedConfig.internalOperationWrapper) {
|
|
79
|
+
const userWrapper = wrappedConfig.internalOperationWrapper;
|
|
80
|
+
wrappedConfig.internalOperationWrapper = (fn) => userWrapper(() => suppressWrapper(fn));
|
|
81
|
+
} else {
|
|
82
|
+
wrappedConfig.internalOperationWrapper = suppressWrapper;
|
|
83
|
+
}
|
|
84
|
+
return wrappedConfig;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Subscribes handlers to the cache operation channel when instrumentation is active.
|
|
88
|
+
*/
|
|
89
|
+
#subscribeIfEnabled() {
|
|
90
|
+
if (!this.isEnabled()) return;
|
|
91
|
+
if (this.subscribed) return;
|
|
92
|
+
if (!this.#cacheOperation) return;
|
|
93
|
+
this.subscribed = true;
|
|
94
|
+
this.handlers = {
|
|
95
|
+
start: (message) => this.#handleStart(message),
|
|
96
|
+
end: () => {
|
|
97
|
+
},
|
|
98
|
+
asyncStart: () => {
|
|
99
|
+
},
|
|
100
|
+
asyncEnd: (message) => this.#handleAsyncEnd(message),
|
|
101
|
+
error: (message) => this.#handleError(message)
|
|
102
|
+
};
|
|
103
|
+
this.#cacheOperation.subscribe(this.handlers);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Unsubscribes handlers and clears runtime state tied to active spans.
|
|
107
|
+
*/
|
|
108
|
+
#unsubscribe() {
|
|
109
|
+
if (!this.subscribed || !this.handlers || !this.#cacheOperation) return;
|
|
110
|
+
this.#cacheOperation.unsubscribe(this.handlers);
|
|
111
|
+
this.subscribed = false;
|
|
112
|
+
this.handlers = void 0;
|
|
113
|
+
this.spans = /* @__PURE__ */ new WeakMap();
|
|
114
|
+
this.#activeContexts.clear();
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Starts a span for each cache operation event and tracks getOrSet parent contexts.
|
|
118
|
+
*/
|
|
119
|
+
#handleStart(message) {
|
|
120
|
+
const config = this.getConfig();
|
|
121
|
+
const contextKey = `${message.store}:${message.key}`;
|
|
122
|
+
const parentContext = this.#activeContexts.get(contextKey) ?? context.active();
|
|
123
|
+
const parentSpan = trace.getSpan(parentContext);
|
|
124
|
+
if (config.requireParentSpan && !parentSpan) return;
|
|
125
|
+
const spanName = this.#getSpanName(message);
|
|
126
|
+
const span = this.tracer.startSpan(
|
|
127
|
+
spanName,
|
|
128
|
+
{
|
|
129
|
+
kind: SpanKind.INTERNAL,
|
|
130
|
+
attributes: this.#getStartAttributes(message)
|
|
131
|
+
},
|
|
132
|
+
parentContext
|
|
133
|
+
);
|
|
134
|
+
this.spans.set(message, span);
|
|
135
|
+
if (message.operation === "getOrSet") {
|
|
136
|
+
this.#activeContexts.set(contextKey, trace.setSpan(parentContext, span));
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Finalizes successful async spans and records result attributes.
|
|
141
|
+
*/
|
|
142
|
+
#handleAsyncEnd(message) {
|
|
143
|
+
const span = this.spans.get(message);
|
|
144
|
+
if (!span) return;
|
|
145
|
+
if (message.hit !== void 0) span.setAttribute("cache.hit", message.hit);
|
|
146
|
+
if (message.tier) span.setAttribute("cache.tier", message.tier);
|
|
147
|
+
if (message.graced !== void 0) span.setAttribute("cache.graced", message.graced);
|
|
148
|
+
span.end();
|
|
149
|
+
this.spans.delete(message);
|
|
150
|
+
if (message.operation === "getOrSet") {
|
|
151
|
+
this.#activeContexts.delete(`${message.store}:${message.key}`);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Finalizes failed spans and records exception details when available.
|
|
156
|
+
*/
|
|
157
|
+
#handleError(message) {
|
|
158
|
+
const span = this.spans.get(message);
|
|
159
|
+
if (!span) return;
|
|
160
|
+
if (message.error instanceof Error) {
|
|
161
|
+
span.recordException(message.error);
|
|
162
|
+
span.setStatus({ code: SpanStatusCode.ERROR, message: message.error.message });
|
|
163
|
+
}
|
|
164
|
+
span.end();
|
|
165
|
+
this.spans.delete(message);
|
|
166
|
+
if (message.operation === "getOrSet") {
|
|
167
|
+
this.#activeContexts.delete(`${message.store}:${message.key}`);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Builds the final span name using custom naming or the configured prefix.
|
|
172
|
+
*/
|
|
173
|
+
#getSpanName(message) {
|
|
174
|
+
const config = this.getConfig();
|
|
175
|
+
if (config.spanName) return config.spanName(message);
|
|
176
|
+
const prefix = config.spanNamePrefix ?? DEFAULT_CONFIG.spanNamePrefix;
|
|
177
|
+
return `${prefix}.${message.operation}`;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Builds initial attributes attached to spans at operation start.
|
|
181
|
+
*/
|
|
182
|
+
#getStartAttributes(message) {
|
|
183
|
+
const config = this.getConfig();
|
|
184
|
+
const attributes = {
|
|
185
|
+
"cache.operation": message.operation,
|
|
186
|
+
"cache.store": message.store
|
|
187
|
+
};
|
|
188
|
+
if (config.includeKeys) {
|
|
189
|
+
if (message.key) {
|
|
190
|
+
const key = config.keySanitizer ? config.keySanitizer(message.key) : message.key;
|
|
191
|
+
if (key) attributes["cache.key"] = key;
|
|
192
|
+
}
|
|
193
|
+
if (message.keys?.length) {
|
|
194
|
+
const keys = config.keySanitizer ? message.keys.map((key) => config.keySanitizer?.(key)).filter((key) => !!key) : message.keys;
|
|
195
|
+
if (keys.length) attributes["cache.keys"] = keys;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return attributes;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Creates a new instrumentation instance with default and user config merged.
|
|
202
|
+
*/
|
|
203
|
+
constructor(config = {}) {
|
|
204
|
+
super("@bentocache/otel", "0.1.0", { ...DEFAULT_CONFIG, ...config });
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Applies runtime config updates while preserving default values.
|
|
208
|
+
*/
|
|
209
|
+
setConfig(config = {}) {
|
|
210
|
+
super.setConfig({ ...DEFAULT_CONFIG, ...config });
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Declares the module patching lifecycle for bentocache instrumentation.
|
|
214
|
+
*/
|
|
215
|
+
init() {
|
|
216
|
+
return [
|
|
217
|
+
new InstrumentationNodeModuleDefinition(
|
|
218
|
+
"bentocache",
|
|
219
|
+
[">=1.6.0"],
|
|
220
|
+
(moduleExports) => {
|
|
221
|
+
const exports = this.#getModuleExports(moduleExports);
|
|
222
|
+
if (!exports) return moduleExports;
|
|
223
|
+
this.#patchBentoCache(exports);
|
|
224
|
+
this.#cacheOperation = exports.tracingChannels?.cacheOperation;
|
|
225
|
+
this.#subscribeIfEnabled();
|
|
226
|
+
return moduleExports;
|
|
227
|
+
},
|
|
228
|
+
(moduleExports) => {
|
|
229
|
+
const exports = this.#getModuleExports(moduleExports);
|
|
230
|
+
if (!exports) return;
|
|
231
|
+
this.#unpatchBentoCache(exports);
|
|
232
|
+
}
|
|
233
|
+
)
|
|
234
|
+
];
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Enables instrumentation and subscribes to diagnostics channels when possible.
|
|
238
|
+
*/
|
|
239
|
+
enable() {
|
|
240
|
+
super.enable();
|
|
241
|
+
if (this.subscribed !== void 0) this.#subscribeIfEnabled();
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Disables instrumentation and cleans up subscribed channel handlers.
|
|
245
|
+
*/
|
|
246
|
+
disable() {
|
|
247
|
+
if (this.subscribed !== void 0) this.#unsubscribe();
|
|
248
|
+
super.disable();
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Registers channel hooks manually when module interception is not available.
|
|
252
|
+
*/
|
|
253
|
+
manuallyRegister(moduleExports) {
|
|
254
|
+
this.#cacheOperation = moduleExports.tracingChannels?.cacheOperation;
|
|
255
|
+
this.#patchBentoCache(moduleExports);
|
|
256
|
+
this.#subscribeIfEnabled();
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
export {
|
|
260
|
+
BentoCacheInstrumentation
|
|
261
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { CacheOperationMessage } from 'bentocache';
|
|
2
|
+
import { TracingChannelSubscribers } from 'node:diagnostics_channel';
|
|
3
|
+
import { InstrumentationConfig } from '@opentelemetry/instrumentation';
|
|
4
|
+
|
|
5
|
+
type CacheOperationChannel = {
|
|
6
|
+
subscribe: (subscribers: TracingChannelSubscribers<CacheOperationMessage>) => void;
|
|
7
|
+
unsubscribe: (subscribers: TracingChannelSubscribers<CacheOperationMessage>) => void;
|
|
8
|
+
};
|
|
9
|
+
type BentoCacheModuleExports = {
|
|
10
|
+
BentoCache?: new (...args: any[]) => any;
|
|
11
|
+
tracingChannels?: {
|
|
12
|
+
cacheOperation?: CacheOperationChannel;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
type CacheKeySanitizer = (key?: string) => string | undefined;
|
|
16
|
+
type SpanNameFactory = (message: CacheOperationMessage) => string;
|
|
17
|
+
interface BentoCacheInstrumentationConfig extends InstrumentationConfig {
|
|
18
|
+
/**
|
|
19
|
+
* Only create spans when a parent span exists
|
|
20
|
+
* @default true
|
|
21
|
+
*/
|
|
22
|
+
requireParentSpan?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Include cache keys in span attributes
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
includeKeys?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Sanitize cache keys before adding them as attributes
|
|
30
|
+
*/
|
|
31
|
+
keySanitizer?: CacheKeySanitizer;
|
|
32
|
+
/**
|
|
33
|
+
* Custom span name factory
|
|
34
|
+
*/
|
|
35
|
+
spanName?: SpanNameFactory;
|
|
36
|
+
/**
|
|
37
|
+
* Prefix used when building the default span name
|
|
38
|
+
* @default 'cache'
|
|
39
|
+
*/
|
|
40
|
+
spanNamePrefix?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Suppress internal Bentocache operations (L2 + bus)
|
|
43
|
+
* @default true
|
|
44
|
+
*/
|
|
45
|
+
suppressInternalOperations?: boolean;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type { BentoCacheInstrumentationConfig, BentoCacheModuleExports, CacheKeySanitizer, CacheOperationChannel, SpanNameFactory };
|
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bentocache/otel",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.1.1",
|
|
5
|
+
"description": "OpenTelemetry instrumentation for Bentocache",
|
|
6
|
+
"author": "Julien Ripouteau <julien@ripouteau.com>",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"bentocache",
|
|
10
|
+
"opentelemetry",
|
|
11
|
+
"otel",
|
|
12
|
+
"instrumentation",
|
|
13
|
+
"tracing"
|
|
14
|
+
],
|
|
15
|
+
"exports": {
|
|
16
|
+
".": "./build/index.js",
|
|
17
|
+
"./types": "./build/src/types.js"
|
|
18
|
+
},
|
|
19
|
+
"main": "build/index.js",
|
|
20
|
+
"files": [
|
|
21
|
+
"build"
|
|
22
|
+
],
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"bentocache": "^1.6.0"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@opentelemetry/api": "^1.9.0",
|
|
28
|
+
"@opentelemetry/core": "^1.9.0",
|
|
29
|
+
"@opentelemetry/instrumentation": "^0.57.0"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@julr/utils": "^1.9.0",
|
|
33
|
+
"@opentelemetry/sdk-trace-base": "^1.9.0",
|
|
34
|
+
"bentocache": "1.6.1"
|
|
35
|
+
},
|
|
36
|
+
"tsup": {
|
|
37
|
+
"entry": [
|
|
38
|
+
"./index.ts",
|
|
39
|
+
"./src/types.ts"
|
|
40
|
+
],
|
|
41
|
+
"outDir": "./build",
|
|
42
|
+
"clean": true,
|
|
43
|
+
"format": "esm",
|
|
44
|
+
"dts": true,
|
|
45
|
+
"target": "esnext"
|
|
46
|
+
},
|
|
47
|
+
"c8": {
|
|
48
|
+
"reporter": [
|
|
49
|
+
"text",
|
|
50
|
+
"html"
|
|
51
|
+
],
|
|
52
|
+
"exclude": [
|
|
53
|
+
"bin",
|
|
54
|
+
"tests/**",
|
|
55
|
+
"test_helpers/**",
|
|
56
|
+
"factories/**"
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
"publishConfig": {
|
|
60
|
+
"access": "public",
|
|
61
|
+
"tag": "latest"
|
|
62
|
+
},
|
|
63
|
+
"release-it": {
|
|
64
|
+
"git": {
|
|
65
|
+
"commitMessage": "chore(release): @bentocache/otel@${version}",
|
|
66
|
+
"tagAnnotation": "release ${version}",
|
|
67
|
+
"tagName": "@bentocache/otel@${version}"
|
|
68
|
+
},
|
|
69
|
+
"github": {
|
|
70
|
+
"release": true,
|
|
71
|
+
"releaseName": "@bentocache/otel@${version}",
|
|
72
|
+
"web": true
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"scripts": {
|
|
76
|
+
"test": "c8 pnpm quick:test",
|
|
77
|
+
"quick:test": "cross-env NODE_NO_WARNINGS=1 node --enable-source-maps --loader=ts-node/esm bin/test.ts",
|
|
78
|
+
"build": "tsup-node",
|
|
79
|
+
"typecheck": "tsc --noEmit",
|
|
80
|
+
"lint": "eslint .",
|
|
81
|
+
"release": "pnpm build && pnpm release-it",
|
|
82
|
+
"checks": "pnpm lint && pnpm typecheck"
|
|
83
|
+
}
|
|
84
|
+
}
|