@eggjs/tracer 4.0.0-beta.18 → 4.0.0-beta.20
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/agent-BIRzex1X.d.ts +1 -0
- package/dist/agent-DMs8TuGb.js +7 -0
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +2 -1
- package/dist/app/extend/agent.d.ts +3 -1
- package/dist/app/extend/agent.js +2 -5
- package/dist/app/extend/application.d.ts +2 -11
- package/dist/app/extend/application.js +1 -17
- package/dist/app/extend/context.d.ts +2 -11
- package/dist/app/extend/context.js +1 -15
- package/dist/app.d.ts +1 -1
- package/dist/app.js +2 -1
- package/dist/application-Bpc_jS36.d.ts +12 -0
- package/dist/application-Do2tZ6Ff.js +19 -0
- package/dist/boot-BHzaa8zz.js +18 -0
- package/dist/boot-DuVOgs2H.d.ts +10 -0
- package/dist/boot.d.ts +1 -9
- package/dist/boot.js +2 -16
- package/dist/config/config.default.d.ts +2 -10
- package/dist/config/config.default.js +2 -5
- package/dist/config.default-Cp2e1RDe.d.ts +11 -0
- package/dist/config.default-i_jeaXdB.js +7 -0
- package/dist/context-CPCWK8N6.js +17 -0
- package/dist/context-Ck5bPugW.d.ts +12 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.js +6 -4
- package/dist/lib/tracer.d.ts +1 -10
- package/dist/lib/tracer.js +1 -15
- package/dist/tracer-BevLwEkm.js +17 -0
- package/dist/tracer-afyJeed0.d.ts +11 -0
- package/dist/types-BnPNhHXc.d.ts +21 -0
- package/dist/types-DnJpiSJb.js +1 -0
- package/dist/types.d.ts +3 -21
- package/dist/types.js +2 -0
- package/package.json +6 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/agent.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { TracerBoot } from "./boot.js";
|
|
1
|
+
import { TracerBoot } from "./boot-DuVOgs2H.js";
|
|
2
2
|
export { TracerBoot as default };
|
package/dist/agent.js
CHANGED
package/dist/app/extend/agent.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../../application-Do2tZ6Ff.js";
|
|
2
|
+
import { agent_default } from "../../agent-DMs8TuGb.js";
|
|
2
3
|
|
|
3
|
-
//#region src/app/extend/agent.ts
|
|
4
|
-
var agent_default = TracerApplication;
|
|
5
|
-
|
|
6
|
-
//#endregion
|
|
7
4
|
export { agent_default as default };
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
//#region src/app/extend/application.d.ts
|
|
5
|
-
declare const cacheTracer: unique symbol;
|
|
6
|
-
declare const isReady: unique symbol;
|
|
7
|
-
declare class TracerApplication extends Application {
|
|
8
|
-
[cacheTracer]: Tracer | undefined;
|
|
9
|
-
get tracer(): Tracer;
|
|
10
|
-
}
|
|
11
|
-
//#endregion
|
|
1
|
+
import "../../tracer-afyJeed0.js";
|
|
2
|
+
import { TracerApplication, isReady } from "../../application-Bpc_jS36.js";
|
|
12
3
|
export { TracerApplication as default, isReady };
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Application } from "egg";
|
|
1
|
+
import { TracerApplication, isReady } from "../../application-Do2tZ6Ff.js";
|
|
3
2
|
|
|
4
|
-
//#region src/app/extend/application.ts
|
|
5
|
-
const debug = debuglog("egg/tracer/app/extend/application");
|
|
6
|
-
const cacheTracer = Symbol("before_ready_tracer");
|
|
7
|
-
const isReady = Symbol("egg_tracer_is_ready");
|
|
8
|
-
var TracerApplication = class extends Application {
|
|
9
|
-
[cacheTracer];
|
|
10
|
-
get tracer() {
|
|
11
|
-
if (this[isReady]) return new this.config.tracer.Class(this.createAnonymousContext());
|
|
12
|
-
if (!this[cacheTracer]) this[cacheTracer] = new this.config.tracer.Class(this.createAnonymousContext());
|
|
13
|
-
debug("use cached tracer before ready, type: %o", this.type);
|
|
14
|
-
return this[cacheTracer];
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
//#endregion
|
|
19
3
|
export { TracerApplication as default, isReady };
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
//#region src/app/extend/context.d.ts
|
|
5
|
-
declare const TRACER: unique symbol;
|
|
6
|
-
declare class TracerContext extends Context {
|
|
7
|
-
[TRACER]: Tracer | undefined;
|
|
8
|
-
get tracer(): Tracer;
|
|
9
|
-
get traceId(): string;
|
|
10
|
-
}
|
|
11
|
-
//#endregion
|
|
1
|
+
import "../../tracer-afyJeed0.js";
|
|
2
|
+
import { TracerContext } from "../../context-Ck5bPugW.js";
|
|
12
3
|
export { TracerContext as default };
|
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TracerContext } from "../../context-CPCWK8N6.js";
|
|
2
2
|
|
|
3
|
-
//#region src/app/extend/context.ts
|
|
4
|
-
const TRACER = Symbol("context tracer");
|
|
5
|
-
var TracerContext = class extends Context {
|
|
6
|
-
[TRACER];
|
|
7
|
-
get tracer() {
|
|
8
|
-
if (!this[TRACER]) this[TRACER] = new this.app.config.tracer.Class(this);
|
|
9
|
-
return this[TRACER];
|
|
10
|
-
}
|
|
11
|
-
get traceId() {
|
|
12
|
-
return this.tracer.traceId;
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
//#endregion
|
|
17
3
|
export { TracerContext as default };
|
package/dist/app.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { TracerBoot } from "./boot.js";
|
|
1
|
+
import { TracerBoot } from "./boot-DuVOgs2H.js";
|
|
2
2
|
export { TracerBoot as default };
|
package/dist/app.js
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Tracer } from "./tracer-afyJeed0.js";
|
|
2
|
+
import { Application } from "egg";
|
|
3
|
+
|
|
4
|
+
//#region src/app/extend/application.d.ts
|
|
5
|
+
declare const cacheTracer: unique symbol;
|
|
6
|
+
declare const isReady: unique symbol;
|
|
7
|
+
declare class TracerApplication extends Application {
|
|
8
|
+
[cacheTracer]: Tracer | undefined;
|
|
9
|
+
get tracer(): Tracer;
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { TracerApplication, isReady };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { debuglog } from "node:util";
|
|
2
|
+
import { Application } from "egg";
|
|
3
|
+
|
|
4
|
+
//#region src/app/extend/application.ts
|
|
5
|
+
const debug = debuglog("egg/tracer/app/extend/application");
|
|
6
|
+
const cacheTracer = Symbol("before_ready_tracer");
|
|
7
|
+
const isReady = Symbol("egg_tracer_is_ready");
|
|
8
|
+
var TracerApplication = class extends Application {
|
|
9
|
+
[cacheTracer];
|
|
10
|
+
get tracer() {
|
|
11
|
+
if (this[isReady]) return new this.config.tracer.Class(this.createAnonymousContext());
|
|
12
|
+
if (!this[cacheTracer]) this[cacheTracer] = new this.config.tracer.Class(this.createAnonymousContext());
|
|
13
|
+
debug("use cached tracer before ready, type: %o", this.type);
|
|
14
|
+
return this[cacheTracer];
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { TracerApplication, isReady };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { isReady } from "./application-Do2tZ6Ff.js";
|
|
2
|
+
import { debuglog } from "node:util";
|
|
3
|
+
|
|
4
|
+
//#region src/boot.ts
|
|
5
|
+
const debug = debuglog("egg/tracer/boot");
|
|
6
|
+
var TracerBoot = class {
|
|
7
|
+
app;
|
|
8
|
+
constructor(app) {
|
|
9
|
+
this.app = app;
|
|
10
|
+
}
|
|
11
|
+
async didLoad() {
|
|
12
|
+
debug("didLoad %o", this.app.type);
|
|
13
|
+
this.app[isReady] = true;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { TracerBoot };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Application, ILifecycleBoot } from "egg";
|
|
2
|
+
|
|
3
|
+
//#region src/boot.d.ts
|
|
4
|
+
declare class TracerBoot implements ILifecycleBoot {
|
|
5
|
+
private readonly app;
|
|
6
|
+
constructor(app: Application);
|
|
7
|
+
didLoad(): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { TracerBoot };
|
package/dist/boot.d.ts
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
//#region src/boot.d.ts
|
|
4
|
-
declare class TracerBoot implements ILifecycleBoot {
|
|
5
|
-
private readonly app;
|
|
6
|
-
constructor(app: Application);
|
|
7
|
-
didLoad(): Promise<void>;
|
|
8
|
-
}
|
|
9
|
-
//#endregion
|
|
1
|
+
import { TracerBoot } from "./boot-DuVOgs2H.js";
|
|
10
2
|
export { TracerBoot };
|
package/dist/boot.js
CHANGED
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import "./application-Do2tZ6Ff.js";
|
|
2
|
+
import { TracerBoot } from "./boot-BHzaa8zz.js";
|
|
3
3
|
|
|
4
|
-
//#region src/boot.ts
|
|
5
|
-
const debug = debuglog("egg/tracer/boot");
|
|
6
|
-
var TracerBoot = class {
|
|
7
|
-
app;
|
|
8
|
-
constructor(app) {
|
|
9
|
-
this.app = app;
|
|
10
|
-
}
|
|
11
|
-
async didLoad() {
|
|
12
|
-
debug("didLoad %o", this.app.type);
|
|
13
|
-
this.app[isReady] = true;
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
//#endregion
|
|
18
4
|
export { TracerBoot };
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
//#region src/config/config.default.d.ts
|
|
4
|
-
interface TracerConfig {
|
|
5
|
-
Class: typeof Tracer;
|
|
6
|
-
}
|
|
7
|
-
declare const _default: {
|
|
8
|
-
tracer: TracerConfig;
|
|
9
|
-
};
|
|
10
|
-
//#endregion
|
|
1
|
+
import "../tracer-afyJeed0.js";
|
|
2
|
+
import { TracerConfig, _default } from "../config.default-Cp2e1RDe.js";
|
|
11
3
|
export { TracerConfig, _default as default };
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../tracer-BevLwEkm.js";
|
|
2
|
+
import { config_default_default } from "../config.default-i_jeaXdB.js";
|
|
2
3
|
|
|
3
|
-
//#region src/config/config.default.ts
|
|
4
|
-
var config_default_default = { tracer: { Class: Tracer } };
|
|
5
|
-
|
|
6
|
-
//#endregion
|
|
7
4
|
export { config_default_default as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Context } from "egg";
|
|
2
|
+
|
|
3
|
+
//#region src/app/extend/context.ts
|
|
4
|
+
const TRACER = Symbol("context tracer");
|
|
5
|
+
var TracerContext = class extends Context {
|
|
6
|
+
[TRACER];
|
|
7
|
+
get tracer() {
|
|
8
|
+
if (!this[TRACER]) this[TRACER] = new this.app.config.tracer.Class(this);
|
|
9
|
+
return this[TRACER];
|
|
10
|
+
}
|
|
11
|
+
get traceId() {
|
|
12
|
+
return this.tracer.traceId;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { TracerContext };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Tracer } from "./tracer-afyJeed0.js";
|
|
2
|
+
import { Context } from "egg";
|
|
3
|
+
|
|
4
|
+
//#region src/app/extend/context.d.ts
|
|
5
|
+
declare const TRACER: unique symbol;
|
|
6
|
+
declare class TracerContext extends Context {
|
|
7
|
+
[TRACER]: Tracer | undefined;
|
|
8
|
+
get tracer(): Tracer;
|
|
9
|
+
get traceId(): string;
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { TracerContext };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
import { Tracer } from "./
|
|
1
|
+
import { Tracer } from "./tracer-afyJeed0.js";
|
|
2
|
+
import "./application-Bpc_jS36.js";
|
|
3
|
+
import "./agent-BIRzex1X.js";
|
|
4
|
+
import "./context-Ck5bPugW.js";
|
|
5
|
+
import "./config.default-Cp2e1RDe.js";
|
|
6
|
+
import "./types-BnPNhHXc.js";
|
|
2
7
|
export { Tracer };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import { Tracer } from "./
|
|
3
|
-
import "./
|
|
4
|
-
import "./
|
|
1
|
+
import "./application-Do2tZ6Ff.js";
|
|
2
|
+
import { Tracer } from "./tracer-BevLwEkm.js";
|
|
3
|
+
import "./config.default-i_jeaXdB.js";
|
|
4
|
+
import "./agent-DMs8TuGb.js";
|
|
5
|
+
import "./context-CPCWK8N6.js";
|
|
6
|
+
import "./types-DnJpiSJb.js";
|
|
5
7
|
|
|
6
8
|
export { Tracer };
|
package/dist/lib/tracer.d.ts
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
//#region src/lib/tracer.d.ts
|
|
4
|
-
declare class Tracer {
|
|
5
|
-
#private;
|
|
6
|
-
readonly ctx: Context;
|
|
7
|
-
constructor(ctx: Context);
|
|
8
|
-
get traceId(): string;
|
|
9
|
-
}
|
|
10
|
-
//#endregion
|
|
1
|
+
import { Tracer } from "../tracer-afyJeed0.js";
|
|
11
2
|
export { Tracer };
|
package/dist/lib/tracer.js
CHANGED
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Tracer } from "../tracer-BevLwEkm.js";
|
|
2
2
|
|
|
3
|
-
//#region src/lib/tracer.ts
|
|
4
|
-
var Tracer = class {
|
|
5
|
-
ctx;
|
|
6
|
-
#traceId;
|
|
7
|
-
constructor(ctx) {
|
|
8
|
-
this.ctx = ctx;
|
|
9
|
-
}
|
|
10
|
-
get traceId() {
|
|
11
|
-
if (!this.#traceId) this.#traceId = randomUUID();
|
|
12
|
-
return this.#traceId;
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
//#endregion
|
|
17
3
|
export { Tracer };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
|
|
3
|
+
//#region src/lib/tracer.ts
|
|
4
|
+
var Tracer = class {
|
|
5
|
+
ctx;
|
|
6
|
+
#traceId;
|
|
7
|
+
constructor(ctx) {
|
|
8
|
+
this.ctx = ctx;
|
|
9
|
+
}
|
|
10
|
+
get traceId() {
|
|
11
|
+
if (!this.#traceId) this.#traceId = randomUUID();
|
|
12
|
+
return this.#traceId;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { Tracer };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Tracer } from "./tracer-afyJeed0.js";
|
|
2
|
+
import { TracerConfig } from "./config.default-Cp2e1RDe.js";
|
|
3
|
+
|
|
4
|
+
//#region src/types.d.ts
|
|
5
|
+
declare module 'egg' {
|
|
6
|
+
interface EggAppConfig {
|
|
7
|
+
/**
|
|
8
|
+
* tracer config
|
|
9
|
+
* @member Config#tracer
|
|
10
|
+
* @property {Tracer} Class - tracer class name
|
|
11
|
+
*/
|
|
12
|
+
tracer: TracerConfig;
|
|
13
|
+
}
|
|
14
|
+
interface Application {
|
|
15
|
+
tracer: Tracer;
|
|
16
|
+
}
|
|
17
|
+
interface Context {
|
|
18
|
+
tracer: Tracer;
|
|
19
|
+
traceId: string;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
//#region src/types.d.ts
|
|
5
|
-
declare module 'egg' {
|
|
6
|
-
interface EggAppConfig {
|
|
7
|
-
/**
|
|
8
|
-
* tracer config
|
|
9
|
-
* @member Config#tracer
|
|
10
|
-
* @property {Tracer} Class - tracer class name
|
|
11
|
-
*/
|
|
12
|
-
tracer: TracerConfig;
|
|
13
|
-
}
|
|
14
|
-
interface Application {
|
|
15
|
-
tracer: Tracer;
|
|
16
|
-
}
|
|
17
|
-
interface Context {
|
|
18
|
-
tracer: Tracer;
|
|
19
|
-
traceId: string;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
1
|
+
import "./tracer-afyJeed0.js";
|
|
2
|
+
import "./config.default-Cp2e1RDe.js";
|
|
3
|
+
import "./types-BnPNhHXc.js";
|
package/dist/types.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eggjs/tracer",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.20",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"egg": "4.1.0-beta.
|
|
36
|
+
"egg": "4.1.0-beta.20"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"tsdown": "^0.15.4",
|
|
40
|
-
"typescript": "5.9.
|
|
41
|
-
"vitest": "4.0.0-beta.
|
|
42
|
-
"@eggjs/
|
|
43
|
-
"@eggjs/
|
|
40
|
+
"typescript": "^5.9.3",
|
|
41
|
+
"vitest": "4.0.0-beta.16",
|
|
42
|
+
"@eggjs/mock": "7.0.0-beta.20",
|
|
43
|
+
"@eggjs/tsconfig": "3.1.0-beta.20"
|
|
44
44
|
},
|
|
45
45
|
"type": "module",
|
|
46
46
|
"exports": {
|