@pydantic/logfire-browser 0.12.2 → 0.13.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 CHANGED
@@ -1 +1 @@
1
- "use strict";var L=Object.defineProperty;var S=(r,e,t)=>e in r?L(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var l=(r,e,t)=>S(r,typeof e!="symbol"?e+"":e,t);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("@opentelemetry/api"),h=require("@opentelemetry/instrumentation"),_=require("@opentelemetry/resources"),u=require("@opentelemetry/sdk-trace-web"),a=require("@opentelemetry/semantic-conventions"),c=require("@opentelemetry/semantic-conventions/incubating"),o=require("logfire"),g=require("@opentelemetry/core"),f=require("@opentelemetry/otlp-exporter-base"),R=require("@opentelemetry/otlp-exporter-base/browser-http"),m=require("@opentelemetry/otlp-transformer"),E="target_xpath",w="event_type",v={1:"trace",5:"debug",9:"info",10:"notice",13:"warning",17:"error",21:"fatal"},d={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 i of e){const n=v[i.attributes["logfire.level_num"]]??"info",{attributes:b,name:A,...p}=this.exportInfo(i);console.log(`%cLogfire %c${n}`,"background-color: #E520E9; color: #FFFFFF",`background-color: ${d[`on-${n}`]}; color: ${d[n]}`,A,b,p)}t&&t({code:g.ExportResultCode.SUCCESS})}}class C{constructor(e,t){l(this,"console");l(this,"wrapped");t&&(this.console=new u.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 i;if(c.ATTR_HTTP_URL in e.attributes){const n=new URL(e.attributes[c.ATTR_HTTP_URL]);Reflect.set(e,"name",`${e.name} ${n.pathname}`)}E in e.attributes&&Reflect.set(e,"name",`${e.attributes[w]??"unknown"} ${e.attributes[E]??""}`),(i=this.console)==null||i.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 x extends f.OTLPExporterBase{constructor(e,t){const n={...f.mergeOtlpSharedConfigurationWithDefaults({compression:e.compression,concurrencyLimit:e.concurrencyLimit,timeoutMillis:e.timeoutMillis},{},f.getSharedConfigurationDefaults()),agentOptions:{keepAlive:!0},headers:()=>({"Content-Type":"application/json",...e.headers??{},...t?t():{}}),url:e.url??"http://localhost:4318/v1/traces"};super(R.createOtlpXhrExportDelegate(n,m.JsonTraceSerializer))}}function O(){return{}}function T(r){r.diagLogLevel!==void 0&&s.diag.setLogger(new s.DiagConsoleLogger,r.diagLogLevel),r.scrubbing!==void 0&&o.configureLogfireApi({scrubbing:r.scrubbing});const e=_.resourceFromAttributes({[c.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?{[c.ATTR_DEPLOYMENT_ENVIRONMENT_NAME]:r.environment}:{},[a.ATTR_TELEMETRY_SDK_VERSION]:"0.12.2",...navigator.userAgentData?{[c.ATTR_BROWSER_BRANDS]:navigator.userAgentData.brands.map(n=>`${n.brand} ${n.version}`),[c.ATTR_BROWSER_MOBILE]:navigator.userAgentData.mobile,[c.ATTR_BROWSER_PLATFORM]:navigator.userAgentData.platform}:{[a.ATTR_USER_AGENT_ORIGINAL]:navigator.userAgent}});s.diag.info("logfire-browser: starting");const t=new u.WebTracerProvider({idGenerator:new o.ULIDGenerator,resource:e,spanProcessors:[new C(new u.BatchSpanProcessor(new x({...r.traceExporterConfig,url:r.traceUrl},r.traceExporterHeaders??O),r.batchSpanProcessorConfig),!!r.console)]});t.register({contextManager:r.contextManager??new u.StackContextManager});const i=h.registerInstrumentations({instrumentations:r.instrumentations??[],tracerProvider:t});return async()=>{s.diag.info("logfire-browser: shutting down"),i(),await t.forceFlush(),await t.shutdown(),s.diag.info("logfire-browser: shut down complete")}}const F={configure:T,configureLogfireApi:o.configureLogfireApi,debug:o.debug,DiagLogLevel:s.DiagLogLevel,error:o.error,fatal:o.fatal,info:o.info,Level:o.Level,log:o.log,logfireApiConfig:o.logfireApiConfig,LogfireAttributeScrubber:o.LogfireAttributeScrubber,NoopAttributeScrubber:o.NoopAttributeScrubber,notice:o.notice,reportError:o.reportError,resolveBaseUrl:o.resolveBaseUrl,resolveSendToLogfire:o.resolveSendToLogfire,serializeAttributes:o.serializeAttributes,span:o.span,startSpan:o.startSpan,trace:o.trace,ULIDGenerator:o.ULIDGenerator,warning:o.warning};Object.defineProperty(exports,"DiagLogLevel",{enumerable:!0,get:()=>s.DiagLogLevel});exports.configure=T;exports.default=F;Object.keys(o).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(exports,r)&&Object.defineProperty(exports,r,{enumerable:!0,get:()=>o[r]})});
1
+ "use strict";var L=Object.defineProperty;var S=(r,e,t)=>e in r?L(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var l=(r,e,t)=>S(r,typeof e!="symbol"?e+"":e,t);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("@opentelemetry/api"),h=require("@opentelemetry/instrumentation"),_=require("@opentelemetry/resources"),u=require("@opentelemetry/sdk-trace-web"),a=require("@opentelemetry/semantic-conventions"),c=require("@opentelemetry/semantic-conventions/incubating"),o=require("logfire"),g=require("@opentelemetry/core"),f=require("@opentelemetry/otlp-exporter-base"),R=require("@opentelemetry/otlp-exporter-base/browser-http"),m=require("@opentelemetry/otlp-transformer"),d="target_xpath",w="event_type",v={1:"trace",5:"debug",9:"info",10:"notice",13:"warning",17:"error",21:"fatal"},T={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 i of e){const n=v[i.attributes["logfire.level_num"]]??"info",{attributes:E,name:A,...p}=this.exportInfo(i);console.log(`%cLogfire %c${n}`,"background-color: #E520E9; color: #FFFFFF",`background-color: ${T[`on-${n}`]}; color: ${T[n]}`,A,E,p)}t&&t({code:g.ExportResultCode.SUCCESS})}}class C{constructor(e,t){l(this,"console");l(this,"wrapped");t&&(this.console=new u.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 i;if(c.ATTR_HTTP_URL in e.attributes){const n=new URL(e.attributes[c.ATTR_HTTP_URL]);Reflect.set(e,"name",`${e.name} ${n.pathname}`)}d in e.attributes&&Reflect.set(e,"name",`${e.attributes[w]??"unknown"} ${e.attributes[d]??""}`),(i=this.console)==null||i.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 x extends f.OTLPExporterBase{constructor(e,t){const n={...f.mergeOtlpSharedConfigurationWithDefaults({compression:e.compression,concurrencyLimit:e.concurrencyLimit,timeoutMillis:e.timeoutMillis},{},f.getSharedConfigurationDefaults()),agentOptions:{keepAlive:!0},headers:async()=>({"Content-Type":"application/json",...typeof e.headers=="function"?await e.headers():e.headers??{},...(t==null?void 0:t())??{}}),url:e.url??"http://localhost:4318/v1/traces"};super(R.createOtlpXhrExportDelegate(n,m.JsonTraceSerializer))}}function F(){return{}}function b(r){r.diagLogLevel!==void 0&&s.diag.setLogger(new s.DiagConsoleLogger,r.diagLogLevel),o.configureLogfireApi({errorFingerprinting:r.errorFingerprinting??!1,scrubbing:r.scrubbing});const e=_.resourceFromAttributes({[c.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?{[c.ATTR_DEPLOYMENT_ENVIRONMENT_NAME]:r.environment}:{},[a.ATTR_TELEMETRY_SDK_VERSION]:"0.13.0",...navigator.userAgentData?{[c.ATTR_BROWSER_BRANDS]:navigator.userAgentData.brands.map(n=>`${n.brand} ${n.version}`),[c.ATTR_BROWSER_MOBILE]:navigator.userAgentData.mobile,[c.ATTR_BROWSER_PLATFORM]:navigator.userAgentData.platform}:{[a.ATTR_USER_AGENT_ORIGINAL]:navigator.userAgent}});s.diag.info("logfire-browser: starting");const t=new u.WebTracerProvider({idGenerator:new o.ULIDGenerator,resource:e,spanProcessors:[new C(new u.BatchSpanProcessor(new x({...r.traceExporterConfig,url:r.traceUrl},r.traceExporterHeaders??F),r.batchSpanProcessorConfig),!!r.console)]});t.register({contextManager:r.contextManager??new u.StackContextManager});const i=h.registerInstrumentations({instrumentations:r.instrumentations??[],tracerProvider:t});return async()=>{s.diag.info("logfire-browser: shutting down"),i(),await t.forceFlush(),await t.shutdown(),s.diag.info("logfire-browser: shut down complete")}}const O={configure:b,configureLogfireApi:o.configureLogfireApi,debug:o.debug,DiagLogLevel:s.DiagLogLevel,error:o.error,fatal:o.fatal,info:o.info,Level:o.Level,log:o.log,logfireApiConfig:o.logfireApiConfig,LogfireAttributeScrubber:o.LogfireAttributeScrubber,NoopAttributeScrubber:o.NoopAttributeScrubber,notice:o.notice,reportError:o.reportError,resolveBaseUrl:o.resolveBaseUrl,resolveSendToLogfire:o.resolveSendToLogfire,serializeAttributes:o.serializeAttributes,span:o.span,startSpan:o.startSpan,trace:o.trace,ULIDGenerator:o.ULIDGenerator,warning:o.warning};Object.defineProperty(exports,"DiagLogLevel",{enumerable:!0,get:()=>s.DiagLogLevel});exports.configure=b;exports.default=O;Object.keys(o).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(exports,r)&&Object.defineProperty(exports,r,{enumerable:!0,get:()=>o[r]})});
package/dist/index.d.cts CHANGED
@@ -84,6 +84,11 @@ export declare interface LogfireConfigOptions {
84
84
  * Defaults to the `LOGFIRE_ENVIRONMENT` environment variable.
85
85
  */
86
86
  environment?: string;
87
+ /**
88
+ * Whether to compute fingerprints for errors reported via reportError().
89
+ * Defaults to false for browser since minified code produces unstable fingerprints.
90
+ */
91
+ errorFingerprinting?: boolean;
87
92
  /**
88
93
  * The instrumentations to register - a common one [is the fetch instrumentation](https://www.npmjs.com/package/@opentelemetry/instrumentation-fetch).
89
94
  */
package/dist/index.d.ts CHANGED
@@ -84,6 +84,11 @@ export declare interface LogfireConfigOptions {
84
84
  * Defaults to the `LOGFIRE_ENVIRONMENT` environment variable.
85
85
  */
86
86
  environment?: string;
87
+ /**
88
+ * Whether to compute fingerprints for errors reported via reportError().
89
+ * Defaults to false for browser since minified code produces unstable fingerprints.
90
+ */
91
+ errorFingerprinting?: boolean;
87
92
  /**
88
93
  * The instrumentations to register - a common one [is the fetch instrumentation](https://www.npmjs.com/package/@opentelemetry/instrumentation-fetch).
89
94
  */
package/dist/index.js CHANGED
@@ -1,20 +1,20 @@
1
1
  var d = Object.defineProperty;
2
- var A = (t, e, r) => e in t ? d(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var a = (t, e, r) => A(t, typeof e != "symbol" ? e + "" : e, r);
4
- import { DiagLogLevel as p, diag as i, DiagConsoleLogger as h } from "@opentelemetry/api";
2
+ var p = (t, e, r) => e in t ? d(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var a = (t, e, r) => p(t, typeof e != "symbol" ? e + "" : e, r);
4
+ import { DiagLogLevel as A, diag as i, DiagConsoleLogger as h } from "@opentelemetry/api";
5
5
  import { DiagLogLevel as Fe } from "@opentelemetry/api";
6
6
  import { registerInstrumentations as S } from "@opentelemetry/instrumentation";
7
- import { resourceFromAttributes as b } from "@opentelemetry/resources";
8
- import { SimpleSpanProcessor as R, WebTracerProvider as _, BatchSpanProcessor as L, StackContextManager as w } from "@opentelemetry/sdk-trace-web";
7
+ import { resourceFromAttributes as R } from "@opentelemetry/resources";
8
+ import { SimpleSpanProcessor as _, WebTracerProvider as b, BatchSpanProcessor as w, StackContextManager as L } from "@opentelemetry/sdk-trace-web";
9
9
  import { TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS as v, ATTR_USER_AGENT_ORIGINAL as x, ATTR_TELEMETRY_SDK_VERSION as C, ATTR_TELEMETRY_SDK_NAME as D, ATTR_TELEMETRY_SDK_LANGUAGE as F, ATTR_SERVICE_VERSION as N, ATTR_SERVICE_NAME as M } from "@opentelemetry/semantic-conventions";
10
- import { ATTR_HTTP_URL as s, ATTR_BROWSER_PLATFORM as O, ATTR_BROWSER_MOBILE as I, ATTR_BROWSER_BRANDS as P, ATTR_DEPLOYMENT_ENVIRONMENT_NAME as B, ATTR_BROWSER_LANGUAGE as G } from "@opentelemetry/semantic-conventions/incubating";
11
- import { warning as U, ULIDGenerator as g, trace as $, startSpan as k, span as y, serializeAttributes as V, resolveSendToLogfire as W, resolveBaseUrl as Y, reportError as H, notice as K, NoopAttributeScrubber as z, LogfireAttributeScrubber as J, logfireApiConfig as X, log as j, Level as q, info as Q, fatal as Z, error as ee, debug as re, configureLogfireApi as E } from "logfire";
10
+ import { ATTR_HTTP_URL as c, ATTR_BROWSER_PLATFORM as O, ATTR_BROWSER_MOBILE as I, ATTR_BROWSER_BRANDS as P, ATTR_DEPLOYMENT_ENVIRONMENT_NAME as B, ATTR_BROWSER_LANGUAGE as y } from "@opentelemetry/semantic-conventions/incubating";
11
+ import { warning as G, ULIDGenerator as f, trace as U, startSpan as $, span as k, serializeAttributes as V, resolveSendToLogfire as W, resolveBaseUrl as Y, reportError as K, notice as z, NoopAttributeScrubber as H, LogfireAttributeScrubber as J, logfireApiConfig as X, log as j, Level as q, info as Q, fatal as Z, error as ee, debug as re, configureLogfireApi as E } from "logfire";
12
12
  export * from "logfire";
13
- import { hrTimeToMicroseconds as c, ExportResultCode as te } from "@opentelemetry/core";
13
+ import { hrTimeToMicroseconds as u, ExportResultCode as te } from "@opentelemetry/core";
14
14
  import { OTLPExporterBase as oe, mergeOtlpSharedConfigurationWithDefaults as ne, getSharedConfigurationDefaults as ie } from "@opentelemetry/otlp-exporter-base";
15
15
  import { createOtlpXhrExportDelegate as ae } from "@opentelemetry/otlp-exporter-base/browser-http";
16
16
  import { JsonTraceSerializer as se } from "@opentelemetry/otlp-transformer";
17
- const u = "target_xpath", ce = "event_type", ue = {
17
+ const l = "target_xpath", ce = "event_type", ue = {
18
18
  1: "trace",
19
19
  5: "debug",
20
20
  9: "info",
@@ -22,7 +22,7 @@ const u = "target_xpath", ce = "event_type", ue = {
22
22
  13: "warning",
23
23
  17: "error",
24
24
  21: "fatal"
25
- }, l = {
25
+ }, g = {
26
26
  debug: "#E3E3E3",
27
27
  error: "#EA4335",
28
28
  fatal: "#EA4335",
@@ -56,7 +56,7 @@ class le {
56
56
  var r;
57
57
  return {
58
58
  attributes: e.attributes,
59
- duration: c(e.duration),
59
+ duration: u(e.duration),
60
60
  events: e.events,
61
61
  id: e.spanContext().spanId,
62
62
  instrumentationScope: e.instrumentationScope,
@@ -68,20 +68,20 @@ class le {
68
68
  attributes: e.resource.attributes
69
69
  },
70
70
  status: e.status,
71
- timestamp: c(e.startTime),
71
+ timestamp: u(e.startTime),
72
72
  traceId: e.spanContext().traceId,
73
73
  traceState: (r = e.spanContext().traceState) == null ? void 0 : r.serialize()
74
74
  };
75
75
  }
76
76
  sendSpans(e, r) {
77
77
  for (const n of e) {
78
- const o = ue[n.attributes["logfire.level_num"]] ?? "info", { attributes: f, name: m, ...T } = this.exportInfo(n);
78
+ const o = ue[n.attributes["logfire.level_num"]] ?? "info", { attributes: s, name: m, ...T } = this.exportInfo(n);
79
79
  console.log(
80
80
  `%cLogfire %c${o}`,
81
81
  "background-color: #E520E9; color: #FFFFFF",
82
- `background-color: ${l[`on-${o}`]}; color: ${l[o]}`,
82
+ `background-color: ${g[`on-${o}`]}; color: ${g[o]}`,
83
83
  m,
84
- f,
84
+ s,
85
85
  T
86
86
  );
87
87
  }
@@ -92,7 +92,7 @@ class ge {
92
92
  constructor(e, r) {
93
93
  a(this, "console");
94
94
  a(this, "wrapped");
95
- r && (this.console = new R(new le())), this.wrapped = e;
95
+ r && (this.console = new _(new le())), this.wrapped = e;
96
96
  }
97
97
  async forceFlush() {
98
98
  var e;
@@ -104,18 +104,18 @@ class ge {
104
104
  }
105
105
  onStart(e, r) {
106
106
  var n;
107
- if (s in e.attributes) {
108
- const o = new URL(e.attributes[s]);
107
+ if (c in e.attributes) {
108
+ const o = new URL(e.attributes[c]);
109
109
  Reflect.set(e, "name", `${e.name} ${o.pathname}`);
110
110
  }
111
- u in e.attributes && Reflect.set(e, "name", `${e.attributes[ce] ?? "unknown"} ${e.attributes[u] ?? ""}`), (n = this.console) == null || n.onStart(e, r), this.wrapped.onStart(e, r);
111
+ l in e.attributes && Reflect.set(e, "name", `${e.attributes[ce] ?? "unknown"} ${e.attributes[l] ?? ""}`), (n = this.console) == null || n.onStart(e, r), this.wrapped.onStart(e, r);
112
112
  }
113
113
  async shutdown() {
114
114
  var e;
115
115
  return await ((e = this.console) == null ? void 0 : e.shutdown()), this.wrapped.shutdown();
116
116
  }
117
117
  }
118
- class Ee extends oe {
118
+ class fe extends oe {
119
119
  constructor(e, r) {
120
120
  const o = {
121
121
  ...ne(
@@ -128,30 +128,33 @@ class Ee extends oe {
128
128
  ie()
129
129
  ),
130
130
  agentOptions: { keepAlive: !0 },
131
- headers: () => ({
131
+ headers: async () => ({
132
132
  "Content-Type": "application/json",
133
- ...e.headers ?? {},
134
- ...r ? r() : {}
133
+ ...typeof e.headers == "function" ? await e.headers() : e.headers ?? {},
134
+ ...(r == null ? void 0 : r()) ?? {}
135
135
  }),
136
136
  url: e.url ?? "http://localhost:4318/v1/traces"
137
137
  };
138
138
  super(ae(o, se));
139
139
  }
140
140
  }
141
- function fe() {
141
+ function Ee() {
142
142
  return {};
143
143
  }
144
144
  function me(t) {
145
- t.diagLogLevel !== void 0 && i.setLogger(new h(), t.diagLogLevel), t.scrubbing !== void 0 && E({ scrubbing: t.scrubbing });
146
- const e = b({
147
- [G]: navigator.language,
145
+ t.diagLogLevel !== void 0 && i.setLogger(new h(), t.diagLogLevel), E({
146
+ errorFingerprinting: t.errorFingerprinting ?? !1,
147
+ scrubbing: t.scrubbing
148
+ });
149
+ const e = R({
150
+ [y]: navigator.language,
148
151
  [M]: t.serviceName ?? "logfire-browser",
149
152
  [N]: t.serviceVersion ?? "0.0.1",
150
153
  [F]: v,
151
154
  [D]: "logfire-browser",
152
155
  ...t.environment ? { [B]: t.environment } : {},
153
156
  // eslint-disable-next-line no-undef
154
- [C]: "0.12.2",
157
+ [C]: "0.13.0",
155
158
  ...navigator.userAgentData ? {
156
159
  [P]: navigator.userAgentData.brands.map((o) => `${o.brand} ${o.version}`),
157
160
  [I]: navigator.userAgentData.mobile,
@@ -161,15 +164,15 @@ function me(t) {
161
164
  }
162
165
  });
163
166
  i.info("logfire-browser: starting");
164
- const r = new _({
165
- idGenerator: new g(),
167
+ const r = new b({
168
+ idGenerator: new f(),
166
169
  resource: e,
167
170
  spanProcessors: [
168
171
  new ge(
169
- new L(
170
- new Ee(
172
+ new w(
173
+ new fe(
171
174
  { ...t.traceExporterConfig, url: t.traceUrl },
172
- t.traceExporterHeaders ?? fe
175
+ t.traceExporterHeaders ?? Ee
173
176
  ),
174
177
  t.batchSpanProcessorConfig
175
178
  ),
@@ -178,7 +181,7 @@ function me(t) {
178
181
  ]
179
182
  });
180
183
  r.register({
181
- contextManager: t.contextManager ?? new w()
184
+ contextManager: t.contextManager ?? new L()
182
185
  });
183
186
  const n = S({
184
187
  instrumentations: t.instrumentations ?? [],
@@ -192,7 +195,7 @@ const xe = {
192
195
  configure: me,
193
196
  configureLogfireApi: E,
194
197
  debug: re,
195
- DiagLogLevel: p,
198
+ DiagLogLevel: A,
196
199
  error: ee,
197
200
  fatal: Z,
198
201
  info: Q,
@@ -201,17 +204,17 @@ const xe = {
201
204
  log: j,
202
205
  logfireApiConfig: X,
203
206
  LogfireAttributeScrubber: J,
204
- NoopAttributeScrubber: z,
205
- notice: K,
206
- reportError: H,
207
+ NoopAttributeScrubber: H,
208
+ notice: z,
209
+ reportError: K,
207
210
  resolveBaseUrl: Y,
208
211
  resolveSendToLogfire: W,
209
212
  serializeAttributes: V,
210
- span: y,
211
- startSpan: k,
212
- trace: $,
213
- ULIDGenerator: g,
214
- warning: U
213
+ span: k,
214
+ startSpan: $,
215
+ trace: U,
216
+ ULIDGenerator: f,
217
+ warning: G
215
218
  };
216
219
  export {
217
220
  Fe as DiagLogLevel,
package/package.json CHANGED
@@ -25,7 +25,7 @@
25
25
  "stats",
26
26
  "monitoring"
27
27
  ],
28
- "version": "0.12.2",
28
+ "version": "0.13.0",
29
29
  "type": "module",
30
30
  "main": "./dist/index.cjs",
31
31
  "module": "./dist/index.js",
@@ -42,25 +42,15 @@
42
42
  }
43
43
  }
44
44
  },
45
- "scripts": {
46
- "dev": "vite build",
47
- "build": "vite build",
48
- "lint": "eslint",
49
- "preview": "vite preview",
50
- "typecheck": "tsc",
51
- "prepack": "cp ../../LICENSE .",
52
- "postpack": "rm LICENSE",
53
- "test": "vitest run --passWithNoTests"
54
- },
55
45
  "dependencies": {
56
46
  "@opentelemetry/api": "^1.9.0",
57
47
  "@opentelemetry/core": "^2.0.1",
58
- "@opentelemetry/exporter-trace-otlp-http": "^0.202.0",
59
- "@opentelemetry/instrumentation": "^0.202.0",
60
- "@opentelemetry/otlp-exporter-base": "^0.203.0",
61
- "@opentelemetry/otlp-transformer": "^0.202.0",
48
+ "@opentelemetry/exporter-trace-otlp-http": "^0.209.0",
49
+ "@opentelemetry/instrumentation": "^0.209.0",
50
+ "@opentelemetry/otlp-exporter-base": "^0.209.0",
51
+ "@opentelemetry/otlp-transformer": "^0.209.0",
62
52
  "@opentelemetry/resources": "^2.0.1",
63
- "logfire": "^0.11.0"
53
+ "logfire": "0.12.0"
64
54
  },
65
55
  "peerDependencies": {
66
56
  "@opentelemetry/sdk-trace-web": "^2.0.1",
@@ -69,16 +59,18 @@
69
59
  "devDependencies": {
70
60
  "@opentelemetry/sdk-trace-web": "^2.0.1",
71
61
  "@opentelemetry/semantic-conventions": "^1.34.0",
72
- "eslint": "^9.22.0",
73
- "prettier": "3.5.3",
74
- "typescript": "^5.8.2",
75
- "user-agent-data-types": "^0.4.2",
76
- "vite": "^6.2.0",
77
- "vite-plugin-dts": "^4.5.3",
78
- "vitest": "^3.1.1"
62
+ "user-agent-data-types": "^0.4.2"
79
63
  },
80
64
  "files": [
81
65
  "dist",
82
66
  "LICENSE"
83
- ]
84
- }
67
+ ],
68
+ "scripts": {
69
+ "dev": "vite build",
70
+ "build": "vite build",
71
+ "lint": "eslint",
72
+ "preview": "vite preview",
73
+ "typecheck": "tsc",
74
+ "test": "vitest run --passWithNoTests"
75
+ }
76
+ }