@obzerver/server 0.15.0 → 0.17.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/alerts.js +9 -3
- package/dist/alerts.js.map +1 -1
- package/dist/checkpoint.d.ts +9 -0
- package/dist/checkpoint.js +65 -12
- package/dist/checkpoint.js.map +1 -1
- package/dist/cli.js +3 -1
- package/dist/cli.js.map +1 -1
- package/dist/db.d.ts +28 -2
- package/dist/db.js +136 -9
- package/dist/db.js.map +1 -1
- package/dist/history.js +3 -2
- package/dist/history.js.map +1 -1
- package/dist/ingest.d.ts +1 -1
- package/dist/ingest.js +78 -2
- package/dist/ingest.js.map +1 -1
- package/dist/ingestqueue.d.ts +2 -0
- package/dist/ingestqueue.js +20 -2
- package/dist/ingestqueue.js.map +1 -1
- package/dist/mathutil.d.ts +3 -0
- package/dist/mathutil.js +4 -0
- package/dist/mathutil.js.map +1 -0
- package/dist/otlp.d.ts +67 -0
- package/dist/otlp.js +680 -0
- package/dist/otlp.js.map +1 -0
- package/dist/queries.d.ts +69 -0
- package/dist/queries.js +407 -79
- package/dist/queries.js.map +1 -1
- package/dist/reader.d.ts +34 -0
- package/dist/reader.js +104 -0
- package/dist/reader.js.map +1 -0
- package/dist/readworker.d.ts +32 -0
- package/dist/readworker.js +35 -0
- package/dist/readworker.js.map +1 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.js +113 -34
- package/dist/server.js.map +1 -1
- package/dist/usage.js +20 -6
- package/dist/usage.js.map +1 -1
- package/package.json +12 -3
- package/public/assets/{index-lWLgVxWi.js → index-CW1YpnVk.js} +1 -1
- package/public/index.html +1 -1
package/dist/mathutil.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Math.max / Math.min over a list of any length: spreading a long list into them overflows the call stack. */
|
|
2
|
+
export const maxOf = (arr) => arr.reduce((a, b) => (b > a ? b : a), -Infinity);
|
|
3
|
+
export const minOf = (arr) => arr.reduce((a, b) => (b < a ? b : a), Infinity);
|
|
4
|
+
//# sourceMappingURL=mathutil.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mathutil.js","sourceRoot":"","sources":["../src/mathutil.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAC/G,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,GAAa,EAAU,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;AACjG,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,GAAa,EAAU,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC"}
|
package/dist/otlp.d.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { IngestPayload, StackFrame } from '@obzerver/node/protocol';
|
|
2
|
+
export type Attrs = Record<string, unknown>;
|
|
3
|
+
export interface OtelSpan {
|
|
4
|
+
traceId: string;
|
|
5
|
+
spanId: string;
|
|
6
|
+
parentId: string | null;
|
|
7
|
+
name: string;
|
|
8
|
+
/** 0 unspecified, 1 internal, 2 server, 3 client, 4 producer, 5 consumer */
|
|
9
|
+
kind: number;
|
|
10
|
+
start: number;
|
|
11
|
+
end: number;
|
|
12
|
+
attrs: Attrs;
|
|
13
|
+
/** 0 unset, 1 ok, 2 error */
|
|
14
|
+
status: number;
|
|
15
|
+
statusMessage: string;
|
|
16
|
+
events: Array<{
|
|
17
|
+
name: string;
|
|
18
|
+
time: number;
|
|
19
|
+
attrs: Attrs;
|
|
20
|
+
}>;
|
|
21
|
+
scope: string;
|
|
22
|
+
}
|
|
23
|
+
export interface OtelResource {
|
|
24
|
+
attrs: Attrs;
|
|
25
|
+
spans: OtelSpan[];
|
|
26
|
+
scopes: string[];
|
|
27
|
+
}
|
|
28
|
+
/** ExportTraceServiceRequest, protobuf. */
|
|
29
|
+
export declare function decodeProtobuf(buf: Uint8Array): OtelResource[];
|
|
30
|
+
type J = Record<string, any>;
|
|
31
|
+
/** ExportTraceServiceRequest, JSON. */
|
|
32
|
+
export declare function decodeJson(body: J): OtelResource[];
|
|
33
|
+
/** Framework names from instrumentation scope names, across languages. */
|
|
34
|
+
export declare function frameworksOf(scopes: string[]): string[];
|
|
35
|
+
/** Stack frames from a stack trace in Node, Python, .NET or Java format. */
|
|
36
|
+
export declare function framesOf(stack: string): StackFrame[];
|
|
37
|
+
/**
|
|
38
|
+
* How long a request's span waits for the rest of its spans before its execution is written. Exporters send
|
|
39
|
+
* spans as they end, often several requests in flight at once, so a child can arrive just after its parent.
|
|
40
|
+
*/
|
|
41
|
+
export declare const GRACE_MS = 2000;
|
|
42
|
+
/**
|
|
43
|
+
* Turns OTLP exports into ingest payloads. Spans are kept by trace; a trace with a request (SERVER or CONSUMER
|
|
44
|
+
* span) is written GRACE_MS after that span came, with every span under it by then. Spans with no request yet
|
|
45
|
+
* wait up to PENDING_MS, then are dropped (counted).
|
|
46
|
+
*/
|
|
47
|
+
export declare class OtlpConverter {
|
|
48
|
+
private traces;
|
|
49
|
+
private count;
|
|
50
|
+
/** Spans dropped: their request never came, or the buffer was full. */
|
|
51
|
+
dropped: number;
|
|
52
|
+
/** The names of the last few dropped spans, to see what is missing its request. */
|
|
53
|
+
lastDropped: string[];
|
|
54
|
+
private drop;
|
|
55
|
+
add(resources: OtelResource[], now?: number): void;
|
|
56
|
+
/** Payloads for the traces whose wait is over (all of them with `all`, when the server stops). */
|
|
57
|
+
take(now?: number, all?: boolean): IngestPayload[];
|
|
58
|
+
/** Spans waiting (for their request, or for the grace period to end). */
|
|
59
|
+
get waiting(): number;
|
|
60
|
+
}
|
|
61
|
+
/** ExportTrace/Metrics/LogsServiceResponse with a partial-success message (field 1, its error_message = 2). */
|
|
62
|
+
export declare function partialSuccess(message: string, protobuf: boolean): Buffer | {
|
|
63
|
+
partialSuccess: {
|
|
64
|
+
errorMessage: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
export {};
|