@pydantic/logfire-browser 0.8.0 → 0.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.
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +9 -4
- package/dist/index.d.ts +9 -4
- package/dist/index.js +165 -86
- package/package.json +1 -2
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var m=Object.defineProperty;var p=(r,e,t)=>e in r?m(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var l=(r,e,t)=>p(r,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@opentelemetry/api"),A=require("@opentelemetry/instrumentation"),_=require("@opentelemetry/resources"),c=require("@opentelemetry/sdk-trace-web"),a=require("@opentelemetry/semantic-conventions"),i=require("@opentelemetry/semantic-conventions/incubating"),u=require("@pydantic/logfire-api"),g=require("@opentelemetry/core"),E=require("@opentelemetry/otlp-exporter-base"),S=require("@opentelemetry/otlp-exporter-base/browser-http"),R=require("@opentelemetry/otlp-transformer");function w(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,o.get?o:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const L=w(u),d="target_xpath",v="event_type",O={1:"trace",5:"debug",9:"info",10:"notice",13:"warning",17:"error",21:"fatal"},f={debug:"#E3E3E3",error:"#EA4335",fatal:"#EA4335",info:"#9EC1FB",notice:"#A5D490","on-debug":"#636262","on-error":"#FFEDE9","on-fatal":"#FFEDE9","on-info":"#063175","on-notice":"#222222","on-trace":"#636262","on-warning":"#613A0D",trace:"#E3E3E3",warning:"#EFB77A"};class D{export(e,t){this.sendSpans(e,t)}forceFlush(){return Promise.resolve()}shutdown(){return this.sendSpans([]),this.forceFlush()}exportInfo(e){var t;return{attributes:e.attributes,duration:g.hrTimeToMicroseconds(e.duration),events:e.events,id:e.spanContext().spanId,instrumentationScope:e.instrumentationScope,kind:e.kind,links:e.links,name:e.name,parentSpanContext:e.parentSpanContext,resource:{attributes:e.resource.attributes},status:e.status,timestamp:g.hrTimeToMicroseconds(e.startTime),traceId:e.spanContext().traceId,traceState:(t=e.spanContext().traceState)==null?void 0:t.serialize()}}sendSpans(e,t){for(const o of e){const n=O[o.attributes["logfire.level_num"]]??"info",{attributes:T,name:b,...h}=this.exportInfo(o);console.log(`%cLogfire %c${n}`,"background-color: #E520E9; color: #FFFFFF",`background-color: ${f[`on-${n}`]}; color: ${f[n]}`,b,T,h)}t&&t({code:g.ExportResultCode.SUCCESS})}}class x{constructor(e,t){l(this,"console");l(this,"wrapped");t&&(this.console=new c.SimpleSpanProcessor(new D)),this.wrapped=e}async forceFlush(){var e;return await((e=this.console)==null?void 0:e.forceFlush()),this.wrapped.forceFlush()}onEnd(e){var t;(t=this.console)==null||t.onEnd(e),this.wrapped.onEnd(e)}onStart(e,t){var o;if(i.ATTR_HTTP_URL in e.attributes){const n=new URL(e.attributes[i.ATTR_HTTP_URL]);Reflect.set(e,"name",`${e.name} ${n.pathname}`)}d in e.attributes&&Reflect.set(e,"name",`${e.attributes[v]??"unknown"} ${e.attributes[d]??""}`),(o=this.console)==null||o.onStart(e,t),this.wrapped.onStart(e,t)}async shutdown(){var e;return await((e=this.console)==null?void 0:e.shutdown()),this.wrapped.shutdown()}}class C extends E.OTLPExporterBase{constructor(e,t){const n={...E.mergeOtlpSharedConfigurationWithDefaults({compression:e.compression,concurrencyLimit:e.concurrencyLimit,timeoutMillis:e.timeoutMillis},{},E.getSharedConfigurationDefaults()),agentOptions:{keepAlive:!0},headers:()=>({"Content-Type":"application/json",...e.headers??{},...t?t():{}}),url:e.url??"http://localhost:4318/v1/traces"};super(S.createOtlpXhrExportDelegate(n,R.JsonTraceSerializer))}}function P(){return{}}function F(r){r.diagLogLevel!==void 0&&s.diag.setLogger(new s.DiagConsoleLogger,r.diagLogLevel),r.scrubbing!==void 0&&L.configureLogfireApi({scrubbing:r.scrubbing});const e=_.resourceFromAttributes({[i.ATTR_BROWSER_LANGUAGE]:navigator.language,[a.ATTR_SERVICE_NAME]:r.serviceName??"logfire-browser",[a.ATTR_SERVICE_VERSION]:r.serviceVersion??"0.0.1",[a.ATTR_TELEMETRY_SDK_LANGUAGE]:a.TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS,[a.ATTR_TELEMETRY_SDK_NAME]:"logfire-browser",...r.environment?{[i.ATTR_DEPLOYMENT_ENVIRONMENT_NAME]:r.environment}:{},[a.ATTR_TELEMETRY_SDK_VERSION]:"0.9.0",...navigator.userAgentData?{[i.ATTR_BROWSER_BRANDS]:navigator.userAgentData.brands.map(n=>`${n.brand} ${n.version}`),[i.ATTR_BROWSER_MOBILE]:navigator.userAgentData.mobile,[i.ATTR_BROWSER_PLATFORM]:navigator.userAgentData.platform}:{[a.ATTR_USER_AGENT_ORIGINAL]:navigator.userAgent}});s.diag.info("logfire-browser: starting");const t=new c.WebTracerProvider({idGenerator:new u.ULIDGenerator,resource:e,spanProcessors:[new x(new c.BatchSpanProcessor(new C({...r.traceExporterConfig,url:r.traceUrl},r.traceExporterHeaders??P),r.batchSpanProcessorConfig),!!r.console)]});t.register({contextManager:r.contextManager??new c.StackContextManager});const o=A.registerInstrumentations({instrumentations:r.instrumentations??[],tracerProvider:t});return async()=>{s.diag.info("logfire-browser: shutting down"),o(),await t.forceFlush(),await t.shutdown(),s.diag.info("logfire-browser: shut down complete")}}Object.defineProperty(exports,"DiagLogLevel",{enumerable:!0,get:()=>s.DiagLogLevel});exports.configure=F;Object.keys(u).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(exports,r)&&Object.defineProperty(exports,r,{enumerable:!0,get:()=>u[r]})});
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BufferConfig } from '@opentelemetry/sdk-trace-web';
|
|
2
|
+
import { ContextManager } from '@opentelemetry/api';
|
|
2
3
|
import { DiagLogLevel } from '@opentelemetry/api';
|
|
3
4
|
import { Instrumentation } from '@opentelemetry/instrumentation';
|
|
4
5
|
import * as logfireApi from '@pydantic/logfire-api';
|
|
@@ -14,13 +15,17 @@ export declare interface LogfireConfigOptions {
|
|
|
14
15
|
*/
|
|
15
16
|
batchSpanProcessorConfig?: BufferConfig;
|
|
16
17
|
/**
|
|
17
|
-
*
|
|
18
|
+
* Whether to log the spans to the console in addition to sending them to the Logfire API.
|
|
18
19
|
*/
|
|
19
|
-
|
|
20
|
+
console?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Pass a context manager (e.g. ZoneContextManager) to use.
|
|
23
|
+
*/
|
|
24
|
+
contextManager?: ContextManager;
|
|
20
25
|
/**
|
|
21
|
-
*
|
|
26
|
+
* Defines the available internal logging levels for the diagnostic logger.
|
|
22
27
|
*/
|
|
23
|
-
|
|
28
|
+
diagLogLevel?: DiagLogLevel;
|
|
24
29
|
/**
|
|
25
30
|
* The environment this service is running in, e.g. `staging` or `prod`. Sets the deployment.environment.name resource attribute. Useful for filtering within projects in the Logfire UI.
|
|
26
31
|
* Defaults to the `LOGFIRE_ENVIRONMENT` environment variable.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BufferConfig } from '@opentelemetry/sdk-trace-web';
|
|
2
|
+
import { ContextManager } from '@opentelemetry/api';
|
|
2
3
|
import { DiagLogLevel } from '@opentelemetry/api';
|
|
3
4
|
import { Instrumentation } from '@opentelemetry/instrumentation';
|
|
4
5
|
import * as logfireApi from '@pydantic/logfire-api';
|
|
@@ -14,13 +15,17 @@ export declare interface LogfireConfigOptions {
|
|
|
14
15
|
*/
|
|
15
16
|
batchSpanProcessorConfig?: BufferConfig;
|
|
16
17
|
/**
|
|
17
|
-
*
|
|
18
|
+
* Whether to log the spans to the console in addition to sending them to the Logfire API.
|
|
18
19
|
*/
|
|
19
|
-
|
|
20
|
+
console?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Pass a context manager (e.g. ZoneContextManager) to use.
|
|
23
|
+
*/
|
|
24
|
+
contextManager?: ContextManager;
|
|
20
25
|
/**
|
|
21
|
-
*
|
|
26
|
+
* Defines the available internal logging levels for the diagnostic logger.
|
|
22
27
|
*/
|
|
23
|
-
|
|
28
|
+
diagLogLevel?: DiagLogLevel;
|
|
24
29
|
/**
|
|
25
30
|
* The environment this service is running in, e.g. `staging` or `prod`. Sets the deployment.environment.name resource attribute. Useful for filtering within projects in the Logfire UI.
|
|
26
31
|
* Defaults to the `LOGFIRE_ENVIRONMENT` environment variable.
|
package/dist/index.js
CHANGED
|
@@ -1,116 +1,195 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var i = (e, r
|
|
4
|
-
import { diag as
|
|
5
|
-
import { DiagLogLevel as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { ULIDGenerator as M } from "@pydantic/logfire-api";
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
|
+
var T = (t, e, r) => e in t ? m(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var i = (t, e, r) => T(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { diag as a, DiagConsoleLogger as d } from "@opentelemetry/api";
|
|
5
|
+
import { DiagLogLevel as le } from "@opentelemetry/api";
|
|
6
|
+
import { registerInstrumentations as h } from "@opentelemetry/instrumentation";
|
|
7
|
+
import { resourceFromAttributes as A } from "@opentelemetry/resources";
|
|
8
|
+
import { SimpleSpanProcessor as p, WebTracerProvider as R, BatchSpanProcessor as S, StackContextManager as _ } from "@opentelemetry/sdk-trace-web";
|
|
9
|
+
import { TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS as w, ATTR_USER_AGENT_ORIGINAL as b, ATTR_TELEMETRY_SDK_VERSION as L, ATTR_TELEMETRY_SDK_NAME as v, ATTR_TELEMETRY_SDK_LANGUAGE as x, ATTR_SERVICE_VERSION as C, ATTR_SERVICE_NAME as D } from "@opentelemetry/semantic-conventions";
|
|
10
|
+
import { ATTR_HTTP_URL as s, ATTR_BROWSER_PLATFORM as F, ATTR_BROWSER_MOBILE as M, ATTR_BROWSER_BRANDS as N, ATTR_DEPLOYMENT_ENVIRONMENT_NAME as O, ATTR_BROWSER_LANGUAGE as I } from "@opentelemetry/semantic-conventions/incubating";
|
|
11
|
+
import * as P from "@pydantic/logfire-api";
|
|
12
|
+
import { ULIDGenerator as B } from "@pydantic/logfire-api";
|
|
14
13
|
export * from "@pydantic/logfire-api";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
import { hrTimeToMicroseconds as c, ExportResultCode as G } from "@opentelemetry/core";
|
|
15
|
+
import { OTLPExporterBase as U, mergeOtlpSharedConfigurationWithDefaults as $, getSharedConfigurationDefaults as k } from "@opentelemetry/otlp-exporter-base";
|
|
16
|
+
import { createOtlpXhrExportDelegate as y } from "@opentelemetry/otlp-exporter-base/browser-http";
|
|
17
|
+
import { JsonTraceSerializer as V } from "@opentelemetry/otlp-transformer";
|
|
18
|
+
const u = "target_xpath", W = "event_type", Y = {
|
|
19
|
+
1: "trace",
|
|
20
|
+
5: "debug",
|
|
21
|
+
9: "info",
|
|
22
|
+
10: "notice",
|
|
23
|
+
13: "warning",
|
|
24
|
+
17: "error",
|
|
25
|
+
21: "fatal"
|
|
26
|
+
}, l = {
|
|
27
|
+
debug: "#E3E3E3",
|
|
28
|
+
error: "#EA4335",
|
|
29
|
+
fatal: "#EA4335",
|
|
30
|
+
info: "#9EC1FB",
|
|
31
|
+
notice: "#A5D490",
|
|
32
|
+
"on-debug": "#636262",
|
|
33
|
+
"on-error": "#FFEDE9",
|
|
34
|
+
"on-fatal": "#FFEDE9",
|
|
35
|
+
"on-info": "#063175",
|
|
36
|
+
"on-notice": "#222222",
|
|
37
|
+
"on-trace": "#636262",
|
|
38
|
+
"on-warning": "#613A0D",
|
|
39
|
+
trace: "#E3E3E3",
|
|
40
|
+
warning: "#EFB77A"
|
|
41
|
+
};
|
|
42
|
+
class H {
|
|
43
|
+
export(e, r) {
|
|
44
|
+
this.sendSpans(e, r);
|
|
45
|
+
}
|
|
46
|
+
forceFlush() {
|
|
47
|
+
return Promise.resolve();
|
|
48
|
+
}
|
|
49
|
+
shutdown() {
|
|
50
|
+
return this.sendSpans([]), this.forceFlush();
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* converts span info into more readable format
|
|
54
|
+
* @param span
|
|
55
|
+
*/
|
|
56
|
+
exportInfo(e) {
|
|
57
|
+
var r;
|
|
58
|
+
return {
|
|
59
|
+
attributes: e.attributes,
|
|
60
|
+
duration: c(e.duration),
|
|
61
|
+
events: e.events,
|
|
62
|
+
id: e.spanContext().spanId,
|
|
63
|
+
instrumentationScope: e.instrumentationScope,
|
|
64
|
+
kind: e.kind,
|
|
65
|
+
links: e.links,
|
|
66
|
+
name: e.name,
|
|
67
|
+
parentSpanContext: e.parentSpanContext,
|
|
68
|
+
resource: {
|
|
69
|
+
attributes: e.resource.attributes
|
|
70
|
+
},
|
|
71
|
+
status: e.status,
|
|
72
|
+
timestamp: c(e.startTime),
|
|
73
|
+
traceId: e.spanContext().traceId,
|
|
74
|
+
traceState: (r = e.spanContext().traceState) == null ? void 0 : r.serialize()
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
sendSpans(e, r) {
|
|
78
|
+
for (const n of e) {
|
|
79
|
+
const o = Y[n.attributes["logfire.level_num"]] ?? "info", { attributes: E, name: g, ...f } = this.exportInfo(n);
|
|
80
|
+
console.log(
|
|
81
|
+
`%cLogfire %c${o}`,
|
|
82
|
+
"background-color: #E520E9; color: #FFFFFF",
|
|
83
|
+
`background-color: ${l[`on-${o}`]}; color: ${l[o]}`,
|
|
84
|
+
g,
|
|
85
|
+
E,
|
|
86
|
+
f
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
r && r({ code: G.SUCCESS });
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
class K {
|
|
93
|
+
constructor(e, r) {
|
|
94
|
+
i(this, "console");
|
|
95
|
+
i(this, "wrapped");
|
|
96
|
+
r && (this.console = new p(new H())), this.wrapped = e;
|
|
97
|
+
}
|
|
98
|
+
async forceFlush() {
|
|
99
|
+
var e;
|
|
100
|
+
return await ((e = this.console) == null ? void 0 : e.forceFlush()), this.wrapped.forceFlush();
|
|
101
|
+
}
|
|
102
|
+
onEnd(e) {
|
|
103
|
+
var r;
|
|
104
|
+
(r = this.console) == null || r.onEnd(e), this.wrapped.onEnd(e);
|
|
105
|
+
}
|
|
106
|
+
onStart(e, r) {
|
|
107
|
+
var n;
|
|
108
|
+
if (s in e.attributes) {
|
|
109
|
+
const o = new URL(e.attributes[s]);
|
|
110
|
+
Reflect.set(e, "name", `${e.name} ${o.pathname}`);
|
|
111
|
+
}
|
|
112
|
+
u in e.attributes && Reflect.set(e, "name", `${e.attributes[W] ?? "unknown"} ${e.attributes[u] ?? ""}`), (n = this.console) == null || n.onStart(e, r), this.wrapped.onStart(e, r);
|
|
113
|
+
}
|
|
114
|
+
async shutdown() {
|
|
115
|
+
var e;
|
|
116
|
+
return await ((e = this.console) == null ? void 0 : e.shutdown()), this.wrapped.shutdown();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
class z extends U {
|
|
120
|
+
constructor(e, r) {
|
|
121
|
+
const o = {
|
|
122
|
+
...$(
|
|
22
123
|
{
|
|
23
|
-
compression:
|
|
24
|
-
concurrencyLimit:
|
|
25
|
-
timeoutMillis:
|
|
124
|
+
compression: e.compression,
|
|
125
|
+
concurrencyLimit: e.concurrencyLimit,
|
|
126
|
+
timeoutMillis: e.timeoutMillis
|
|
26
127
|
},
|
|
27
128
|
{},
|
|
28
|
-
|
|
129
|
+
k()
|
|
29
130
|
),
|
|
30
131
|
agentOptions: { keepAlive: !0 },
|
|
31
132
|
headers: () => ({
|
|
32
133
|
"Content-Type": "application/json",
|
|
33
|
-
...
|
|
34
|
-
...
|
|
134
|
+
...e.headers ?? {},
|
|
135
|
+
...r ? r() : {}
|
|
35
136
|
}),
|
|
36
|
-
url:
|
|
137
|
+
url: e.url ?? "http://localhost:4318/v1/traces"
|
|
37
138
|
};
|
|
38
|
-
super(
|
|
139
|
+
super(y(o, V));
|
|
39
140
|
}
|
|
40
141
|
}
|
|
41
|
-
|
|
42
|
-
function y() {
|
|
142
|
+
function J() {
|
|
43
143
|
return {};
|
|
44
144
|
}
|
|
45
|
-
function
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
[
|
|
49
|
-
[
|
|
50
|
-
[
|
|
51
|
-
[
|
|
52
|
-
[
|
|
53
|
-
...
|
|
145
|
+
function se(t) {
|
|
146
|
+
t.diagLogLevel !== void 0 && a.setLogger(new d(), t.diagLogLevel), t.scrubbing !== void 0 && P.configureLogfireApi({ scrubbing: t.scrubbing });
|
|
147
|
+
const e = A({
|
|
148
|
+
[I]: navigator.language,
|
|
149
|
+
[D]: t.serviceName ?? "logfire-browser",
|
|
150
|
+
[C]: t.serviceVersion ?? "0.0.1",
|
|
151
|
+
[x]: w,
|
|
152
|
+
[v]: "logfire-browser",
|
|
153
|
+
...t.environment ? { [O]: t.environment } : {},
|
|
54
154
|
// eslint-disable-next-line no-undef
|
|
55
|
-
[
|
|
155
|
+
[L]: "0.9.0",
|
|
56
156
|
...navigator.userAgentData ? {
|
|
57
|
-
[
|
|
58
|
-
[
|
|
59
|
-
[
|
|
157
|
+
[N]: navigator.userAgentData.brands.map((o) => `${o.brand} ${o.version}`),
|
|
158
|
+
[M]: navigator.userAgentData.mobile,
|
|
159
|
+
[F]: navigator.userAgentData.platform
|
|
60
160
|
} : {
|
|
61
|
-
[
|
|
161
|
+
[b]: navigator.userAgent
|
|
62
162
|
}
|
|
63
163
|
});
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
idGenerator: new
|
|
67
|
-
resource:
|
|
164
|
+
a.info("logfire-browser: starting");
|
|
165
|
+
const r = new R({
|
|
166
|
+
idGenerator: new B(),
|
|
167
|
+
resource: e,
|
|
68
168
|
spanProcessors: [
|
|
69
|
-
new
|
|
70
|
-
new
|
|
71
|
-
new
|
|
72
|
-
{ ...
|
|
73
|
-
|
|
169
|
+
new K(
|
|
170
|
+
new S(
|
|
171
|
+
new z(
|
|
172
|
+
{ ...t.traceExporterConfig, url: t.traceUrl },
|
|
173
|
+
t.traceExporterHeaders ?? J
|
|
74
174
|
),
|
|
75
|
-
|
|
76
|
-
)
|
|
175
|
+
t.batchSpanProcessorConfig
|
|
176
|
+
),
|
|
177
|
+
!!t.console
|
|
77
178
|
)
|
|
78
179
|
]
|
|
79
180
|
});
|
|
80
|
-
|
|
81
|
-
contextManager: new
|
|
82
|
-
})
|
|
83
|
-
const n =
|
|
84
|
-
instrumentations:
|
|
85
|
-
tracerProvider:
|
|
181
|
+
r.register({
|
|
182
|
+
contextManager: t.contextManager ?? new _()
|
|
183
|
+
});
|
|
184
|
+
const n = h({
|
|
185
|
+
instrumentations: t.instrumentations ?? [],
|
|
186
|
+
tracerProvider: r
|
|
86
187
|
});
|
|
87
188
|
return async () => {
|
|
88
|
-
|
|
189
|
+
a.info("logfire-browser: shutting down"), n(), await r.forceFlush(), await r.shutdown(), a.info("logfire-browser: shut down complete");
|
|
89
190
|
};
|
|
90
191
|
}
|
|
91
|
-
class V {
|
|
92
|
-
constructor(r) {
|
|
93
|
-
i(this, "wrapped");
|
|
94
|
-
this.wrapped = r;
|
|
95
|
-
}
|
|
96
|
-
async forceFlush() {
|
|
97
|
-
return this.wrapped.forceFlush();
|
|
98
|
-
}
|
|
99
|
-
onEnd(r) {
|
|
100
|
-
this.wrapped.onEnd(r);
|
|
101
|
-
}
|
|
102
|
-
onStart(r, t) {
|
|
103
|
-
if (s in r.attributes) {
|
|
104
|
-
const n = new URL(r.attributes[s]);
|
|
105
|
-
Reflect.set(r, "name", `${r.name} ${n.pathname}`);
|
|
106
|
-
}
|
|
107
|
-
c in r.attributes && Reflect.set(r, "name", `${r.attributes[U] ?? "unknown"} ${r.attributes[c] ?? ""}`), this.wrapped.onStart(r, t);
|
|
108
|
-
}
|
|
109
|
-
async shutdown() {
|
|
110
|
-
return this.wrapped.shutdown();
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
192
|
export {
|
|
114
|
-
|
|
115
|
-
|
|
193
|
+
le as DiagLogLevel,
|
|
194
|
+
se as configure
|
|
116
195
|
};
|
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"stats",
|
|
22
22
|
"monitoring"
|
|
23
23
|
],
|
|
24
|
-
"version": "0.
|
|
24
|
+
"version": "0.9.0",
|
|
25
25
|
"type": "module",
|
|
26
26
|
"main": "./dist/index.cjs",
|
|
27
27
|
"module": "./dist/index.js",
|
|
@@ -50,7 +50,6 @@
|
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@opentelemetry/api": "^1.9.0",
|
|
53
|
-
"@opentelemetry/context-zone": "^2.0.1",
|
|
54
53
|
"@opentelemetry/core": "^2.0.1",
|
|
55
54
|
"@opentelemetry/exporter-trace-otlp-http": "^0.202.0",
|
|
56
55
|
"@opentelemetry/instrumentation": "^0.202.0",
|