@rbxts/scribe-telemetry 2.5.0 → 2.6.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 +21 -21
- package/Scribe-source-map.json +1 -1
- package/index.d.ts +155 -150
- package/init.luau +18 -0
- package/package.json +2 -2
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 ericplane
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ericplane
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/Scribe-source-map.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"2.
|
|
1
|
+
{"version":"2.6.1","format":1,"description":"Segments are [packedLine, sourceLine]. Use the last segment at or before the packed line, then add its line offset.","files":{"addons/telemetry/ScribeTelemetry/Config.luau":{"sourceSha256":"d2c9b8060f2c26bcf59436e209f39a65c9ed69c167eb81930859826ab63dc10c","packedSha256":"d2c9b8060f2c26bcf59436e209f39a65c9ed69c167eb81930859826ab63dc10c","segments":[[1,1]],"packagePath":"Config.luau"},"addons/telemetry/ScribeTelemetry/Diagnostics.luau":{"sourceSha256":"81d2b4ddb797654a4643a7161408fd4040a9057d2f267a4f143fad5876e03780","packedSha256":"81d2b4ddb797654a4643a7161408fd4040a9057d2f267a4f143fad5876e03780","segments":[[1,1]],"packagePath":"Diagnostics.luau"},"addons/telemetry/ScribeTelemetry/Format.luau":{"sourceSha256":"d2b7917dd2518e838bab3ac0d819420d6b93bf488e68f9ca3764d7720f57fa2f","packedSha256":"d2b7917dd2518e838bab3ac0d819420d6b93bf488e68f9ca3764d7720f57fa2f","segments":[[1,1]],"packagePath":"Format.luau"},"addons/telemetry/ScribeTelemetry/LeaderboardMonitor.luau":{"sourceSha256":"25dd1f55847e94f3b5d46074008fca3141196eb35e3ed5a083038bd7a83fa1fd","packedSha256":"25dd1f55847e94f3b5d46074008fca3141196eb35e3ed5a083038bd7a83fa1fd","segments":[[1,1]],"packagePath":"LeaderboardMonitor.luau"},"addons/telemetry/ScribeTelemetry/Preview.luau":{"sourceSha256":"e5e5813ab3b8e24c181ebf8c7ac7d18d1d2183b2d1af95cff248ee754870ae6e","packedSha256":"e5e5813ab3b8e24c181ebf8c7ac7d18d1d2183b2d1af95cff248ee754870ae6e","segments":[[1,1]],"packagePath":"Preview.luau"},"addons/telemetry/ScribeTelemetry/Router.luau":{"sourceSha256":"f45b51bde5e33b2de1ab23338518caec54a1a4a8b642a3eff3e5b11d0669adb9","packedSha256":"f45b51bde5e33b2de1ab23338518caec54a1a4a8b642a3eff3e5b11d0669adb9","segments":[[1,1]],"packagePath":"Router.luau"},"addons/telemetry/ScribeTelemetry/Sanitize.luau":{"sourceSha256":"41846d913c9ee350053778121521e2aca3fbd53e3845d4394e79bfededfefd5c","packedSha256":"41846d913c9ee350053778121521e2aca3fbd53e3845d4394e79bfededfefd5c","segments":[[1,1]],"packagePath":"Sanitize.luau"},"addons/telemetry/ScribeTelemetry/Transport.luau":{"sourceSha256":"ac306390638dc90cbe097b6d037ac5cf88c8b7882f82efd741628ea4b48c05cf","packedSha256":"ac306390638dc90cbe097b6d037ac5cf88c8b7882f82efd741628ea4b48c05cf","segments":[[1,1]],"packagePath":"Transport.luau"},"addons/telemetry/ScribeTelemetry/init.luau":{"sourceSha256":"b00fa59c0fdfbb06c0beeb8b9ba87f2c2edc13351c83255722935ec9eb915ad8","packedSha256":"b00fa59c0fdfbb06c0beeb8b9ba87f2c2edc13351c83255722935ec9eb915ad8","segments":[[1,1]],"packagePath":"init.luau"}}}
|
package/index.d.ts
CHANGED
|
@@ -1,150 +1,155 @@
|
|
|
1
|
-
import type Scribe from "@rbxts/scribe";
|
|
2
|
-
|
|
3
|
-
/** Optional server-side diagnostics reporter. Importing it does not start reporting. */
|
|
4
|
-
declare namespace ScribeTelemetry {
|
|
5
|
-
const Version: string;
|
|
6
|
-
const LogoUrl: string;
|
|
7
|
-
const DefaultWarningCodes: readonly string[];
|
|
8
|
-
type LogEntry = Scribe.LogEntry;
|
|
9
|
-
|
|
10
|
-
type Category = "Health" | "Issues" | "Warnings" | "Performance" | "Summaries" | "Leaderboards";
|
|
11
|
-
type MentionKind = "Fatal" | "Error" | "Outage" | "Degraded" | "Recovery" | "Performance";
|
|
12
|
-
type Route<Destination extends string = string> = Destination | readonly Destination[] | false;
|
|
13
|
-
type PreviewKind =
|
|
14
|
-
| "All" | "Health" | "Issues" | "Warnings" | "Grouping" | "Performance" | "Leaderboards" | "Summaries" | "Formatting"
|
|
15
|
-
| "HealthyStartup" | "Degraded" | "Outage" | "PartialRecovery" | "Recovery" | "IncidentUnderway"
|
|
16
|
-
| "Warning" | "Error" | "Fatal" | "Repeat" | "UpstreamSuppressed"
|
|
17
|
-
| "SlowLoad" | "SlowLeavingHook" | "ReceiptCapacity" | "ReceiptRoutingRetry"
|
|
18
|
-
| "LeaderboardDegraded" | "LeaderboardRecovery"
|
|
19
|
-
| "SlowSaves" | "SlowSavesCleared" | "SaveFailures" | "SaveFailuresCleared" | "Traffic" | "TrafficCleared"
|
|
20
|
-
| "Summary" | "SummaryNoSamples" | "SummaryNoBudget" | "LongMessage" | "RedactedContext";
|
|
21
|
-
|
|
22
|
-
interface WebhookOptions {
|
|
23
|
-
Url: string;
|
|
24
|
-
Enabled?: boolean;
|
|
25
|
-
Mention?: { RoleId: string; On?: readonly MentionKind[]; Cooldown?: number };
|
|
26
|
-
}
|
|
27
|
-
interface RuleOptions {
|
|
28
|
-
/** Positive threshold; a rule has no default threshold. */
|
|
29
|
-
Threshold: number;
|
|
30
|
-
MinSamples?: number;
|
|
31
|
-
Enabled?: boolean;
|
|
32
|
-
}
|
|
33
|
-
interface RuleSetOptions {
|
|
34
|
-
SlowSaves?: RuleOptions;
|
|
35
|
-
SaveFailures?: RuleOptions;
|
|
36
|
-
Traffic?: RuleOptions;
|
|
37
|
-
}
|
|
38
|
-
interface WarningOptions { Include?: readonly string[]; Categories?: readonly string[] }
|
|
39
|
-
interface IssueOptions { ExcludeCodes?: readonly string[]; ExcludeCategories?: readonly string[] }
|
|
40
|
-
interface GroupingOptions { Interval?: number; Expiry?: number; MaxGroups?: number }
|
|
41
|
-
interface SummaryOptions { Enabled?: boolean; Interval?: number }
|
|
42
|
-
/** Observes cached leaderboard snapshots; never requests a leaderboard refresh. */
|
|
43
|
-
interface LeaderboardOptions { Enabled?: boolean; Interval?: number; MaxBoards?: number }
|
|
44
|
-
interface PerformanceOptions { Interval?: number; Checks?: number; Rules?: RuleSetOptions }
|
|
45
|
-
interface LimitOptions {
|
|
46
|
-
MaxQueued?: number;
|
|
47
|
-
MaxQueuedBytes?: number;
|
|
48
|
-
PerDestination?: number;
|
|
49
|
-
MaxAge?: number;
|
|
50
|
-
MaxAttempts?: number;
|
|
51
|
-
MaxRetryDelay?: number;
|
|
52
|
-
}
|
|
53
|
-
interface HttpResponse {
|
|
54
|
-
Ok: boolean;
|
|
55
|
-
Status?: number;
|
|
56
|
-
Headers?: { [name: string]: string | undefined };
|
|
57
|
-
Body?: string;
|
|
58
|
-
Error?: string;
|
|
59
|
-
}
|
|
60
|
-
interface Http { readonly Post: (this: void, url: string, body: string) => HttpResponse }
|
|
61
|
-
interface Clock { readonly Now: (this: void) => number; readonly Monotonic: (this: void) => number }
|
|
62
|
-
interface Scheduler { readonly Spawn: (this: void, callback: (this: void) => void) => void; readonly Wait: (this: void, seconds: number) => void }
|
|
63
|
-
interface Json { readonly Encode: (this: void, value: unknown) => string; readonly Decode: (this: void, text: string) => unknown }
|
|
64
|
-
|
|
65
|
-
interface Options<Destination extends string = string> {
|
|
66
|
-
Webhooks: { [K in Destination]: WebhookOptions };
|
|
67
|
-
Default?: NoInfer<Destination>;
|
|
68
|
-
Routes?: Partial<Record<Category, Route<NoInfer<Destination>>>>;
|
|
69
|
-
Warnings?: WarningOptions;
|
|
70
|
-
Issues?: IssueOptions;
|
|
71
|
-
Grouping?: GroupingOptions;
|
|
72
|
-
Summaries?: SummaryOptions;
|
|
73
|
-
Leaderboards?: LeaderboardOptions;
|
|
74
|
-
Performance?: PerformanceOptions;
|
|
75
|
-
Limits?: LimitOptions;
|
|
76
|
-
IncludePlayerIds?: boolean;
|
|
77
|
-
Environment?: string;
|
|
78
|
-
AllowStudio?: boolean;
|
|
79
|
-
ReportHealthyStartup?: boolean;
|
|
80
|
-
/** Dependency seams for tests. Omit in normal game code. */
|
|
81
|
-
Http?: Http;
|
|
82
|
-
Clock?: Clock;
|
|
83
|
-
Scheduler?: Scheduler;
|
|
84
|
-
Json?: Json;
|
|
85
|
-
Jitter?: (this: void) => number;
|
|
86
|
-
Studio?: boolean;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
interface Dropped {
|
|
90
|
-
Overflow: number;
|
|
91
|
-
Expired: number;
|
|
92
|
-
Malformed: number;
|
|
93
|
-
DeadDestination: number;
|
|
94
|
-
Exhausted: number;
|
|
95
|
-
Stopped: number;
|
|
96
|
-
Coalesced: number;
|
|
97
|
-
}
|
|
98
|
-
interface DestinationStats {
|
|
99
|
-
State: "Ready" | "Dead" | "Stopped";
|
|
100
|
-
Queued: number;
|
|
101
|
-
Delivered: number;
|
|
102
|
-
Failures: number;
|
|
103
|
-
LastDeliveredAt?: number;
|
|
104
|
-
LastError?: string;
|
|
105
|
-
}
|
|
106
|
-
type LeaderboardMonitorState = "Available" | "Unavailable" | "Disabled" | "DisabledInStudio" | "Stopped";
|
|
107
|
-
interface LeaderboardStats {
|
|
108
|
-
State: LeaderboardMonitorState;
|
|
109
|
-
Monitored: number;
|
|
110
|
-
Omitted: number;
|
|
111
|
-
SnapshotAge?: number;
|
|
112
|
-
LastError?: string;
|
|
113
|
-
}
|
|
114
|
-
interface Stats<Destination extends string = string> {
|
|
115
|
-
State: "Running" | "DisabledInStudio" | "Stopped";
|
|
116
|
-
Queued: number;
|
|
117
|
-
QueuedBytes: number;
|
|
118
|
-
Delivered: number;
|
|
119
|
-
Retries: number;
|
|
120
|
-
Uncertain: number;
|
|
121
|
-
Dropped: Dropped;
|
|
122
|
-
LastDeliveredAt?: number;
|
|
123
|
-
/** Empty when disabled in Studio; entries must be checked before reading. */
|
|
124
|
-
Destinations: Partial<Record<Destination, DestinationStats>>;
|
|
125
|
-
Reports: number;
|
|
126
|
-
Previews: number;
|
|
127
|
-
Skipped: Partial<Record<Category, number>>;
|
|
128
|
-
Filtered: { Issues: number; Warnings: number; Ignored: number };
|
|
129
|
-
Groups: number;
|
|
130
|
-
EncodeFailures: number;
|
|
131
|
-
LastTickError?: string;
|
|
132
|
-
Leaderboards: LeaderboardStats;
|
|
133
|
-
}
|
|
134
|
-
interface Handle<Destination extends string = string> {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
1
|
+
import type Scribe from "@rbxts/scribe";
|
|
2
|
+
|
|
3
|
+
/** Optional server-side diagnostics reporter. Importing it does not start reporting. */
|
|
4
|
+
declare namespace ScribeTelemetry {
|
|
5
|
+
const Version: string;
|
|
6
|
+
const LogoUrl: string;
|
|
7
|
+
const DefaultWarningCodes: readonly string[];
|
|
8
|
+
type LogEntry = Scribe.LogEntry;
|
|
9
|
+
|
|
10
|
+
type Category = "Health" | "Issues" | "Warnings" | "Performance" | "Summaries" | "Leaderboards";
|
|
11
|
+
type MentionKind = "Fatal" | "Error" | "Outage" | "Degraded" | "Recovery" | "Performance";
|
|
12
|
+
type Route<Destination extends string = string> = Destination | readonly Destination[] | false;
|
|
13
|
+
type PreviewKind =
|
|
14
|
+
| "All" | "Health" | "Issues" | "Warnings" | "Grouping" | "Performance" | "Leaderboards" | "Summaries" | "Formatting"
|
|
15
|
+
| "HealthyStartup" | "Degraded" | "Outage" | "PartialRecovery" | "Recovery" | "IncidentUnderway"
|
|
16
|
+
| "Warning" | "Error" | "Fatal" | "Repeat" | "UpstreamSuppressed"
|
|
17
|
+
| "SlowLoad" | "SlowLeavingHook" | "ReceiptCapacity" | "ReceiptRoutingRetry"
|
|
18
|
+
| "LeaderboardDegraded" | "LeaderboardRecovery"
|
|
19
|
+
| "SlowSaves" | "SlowSavesCleared" | "SaveFailures" | "SaveFailuresCleared" | "Traffic" | "TrafficCleared"
|
|
20
|
+
| "Summary" | "SummaryNoSamples" | "SummaryNoBudget" | "LongMessage" | "RedactedContext";
|
|
21
|
+
|
|
22
|
+
interface WebhookOptions {
|
|
23
|
+
Url: string;
|
|
24
|
+
Enabled?: boolean;
|
|
25
|
+
Mention?: { RoleId: string; On?: readonly MentionKind[]; Cooldown?: number };
|
|
26
|
+
}
|
|
27
|
+
interface RuleOptions {
|
|
28
|
+
/** Positive threshold; a rule has no default threshold. */
|
|
29
|
+
Threshold: number;
|
|
30
|
+
MinSamples?: number;
|
|
31
|
+
Enabled?: boolean;
|
|
32
|
+
}
|
|
33
|
+
interface RuleSetOptions {
|
|
34
|
+
SlowSaves?: RuleOptions;
|
|
35
|
+
SaveFailures?: RuleOptions;
|
|
36
|
+
Traffic?: RuleOptions;
|
|
37
|
+
}
|
|
38
|
+
interface WarningOptions { Include?: readonly string[]; Categories?: readonly string[] }
|
|
39
|
+
interface IssueOptions { ExcludeCodes?: readonly string[]; ExcludeCategories?: readonly string[] }
|
|
40
|
+
interface GroupingOptions { Interval?: number; Expiry?: number; MaxGroups?: number }
|
|
41
|
+
interface SummaryOptions { Enabled?: boolean; Interval?: number }
|
|
42
|
+
/** Observes cached leaderboard snapshots; never requests a leaderboard refresh. */
|
|
43
|
+
interface LeaderboardOptions { Enabled?: boolean; Interval?: number; MaxBoards?: number }
|
|
44
|
+
interface PerformanceOptions { Interval?: number; Checks?: number; Rules?: RuleSetOptions }
|
|
45
|
+
interface LimitOptions {
|
|
46
|
+
MaxQueued?: number;
|
|
47
|
+
MaxQueuedBytes?: number;
|
|
48
|
+
PerDestination?: number;
|
|
49
|
+
MaxAge?: number;
|
|
50
|
+
MaxAttempts?: number;
|
|
51
|
+
MaxRetryDelay?: number;
|
|
52
|
+
}
|
|
53
|
+
interface HttpResponse {
|
|
54
|
+
Ok: boolean;
|
|
55
|
+
Status?: number;
|
|
56
|
+
Headers?: { [name: string]: string | undefined };
|
|
57
|
+
Body?: string;
|
|
58
|
+
Error?: string;
|
|
59
|
+
}
|
|
60
|
+
interface Http { readonly Post: (this: void, url: string, body: string) => HttpResponse }
|
|
61
|
+
interface Clock { readonly Now: (this: void) => number; readonly Monotonic: (this: void) => number }
|
|
62
|
+
interface Scheduler { readonly Spawn: (this: void, callback: (this: void) => void) => void; readonly Wait: (this: void, seconds: number) => void }
|
|
63
|
+
interface Json { readonly Encode: (this: void, value: unknown) => string; readonly Decode: (this: void, text: string) => unknown }
|
|
64
|
+
|
|
65
|
+
interface Options<Destination extends string = string> {
|
|
66
|
+
Webhooks: { [K in Destination]: WebhookOptions };
|
|
67
|
+
Default?: NoInfer<Destination>;
|
|
68
|
+
Routes?: Partial<Record<Category, Route<NoInfer<Destination>>>>;
|
|
69
|
+
Warnings?: WarningOptions;
|
|
70
|
+
Issues?: IssueOptions;
|
|
71
|
+
Grouping?: GroupingOptions;
|
|
72
|
+
Summaries?: SummaryOptions;
|
|
73
|
+
Leaderboards?: LeaderboardOptions;
|
|
74
|
+
Performance?: PerformanceOptions;
|
|
75
|
+
Limits?: LimitOptions;
|
|
76
|
+
IncludePlayerIds?: boolean;
|
|
77
|
+
Environment?: string;
|
|
78
|
+
AllowStudio?: boolean;
|
|
79
|
+
ReportHealthyStartup?: boolean;
|
|
80
|
+
/** Dependency seams for tests. Omit in normal game code. */
|
|
81
|
+
Http?: Http;
|
|
82
|
+
Clock?: Clock;
|
|
83
|
+
Scheduler?: Scheduler;
|
|
84
|
+
Json?: Json;
|
|
85
|
+
Jitter?: (this: void) => number;
|
|
86
|
+
Studio?: boolean;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
interface Dropped {
|
|
90
|
+
Overflow: number;
|
|
91
|
+
Expired: number;
|
|
92
|
+
Malformed: number;
|
|
93
|
+
DeadDestination: number;
|
|
94
|
+
Exhausted: number;
|
|
95
|
+
Stopped: number;
|
|
96
|
+
Coalesced: number;
|
|
97
|
+
}
|
|
98
|
+
interface DestinationStats {
|
|
99
|
+
State: "Ready" | "Dead" | "Stopped";
|
|
100
|
+
Queued: number;
|
|
101
|
+
Delivered: number;
|
|
102
|
+
Failures: number;
|
|
103
|
+
LastDeliveredAt?: number;
|
|
104
|
+
LastError?: string;
|
|
105
|
+
}
|
|
106
|
+
type LeaderboardMonitorState = "Available" | "Unavailable" | "Disabled" | "DisabledInStudio" | "Stopped";
|
|
107
|
+
interface LeaderboardStats {
|
|
108
|
+
State: LeaderboardMonitorState;
|
|
109
|
+
Monitored: number;
|
|
110
|
+
Omitted: number;
|
|
111
|
+
SnapshotAge?: number;
|
|
112
|
+
LastError?: string;
|
|
113
|
+
}
|
|
114
|
+
interface Stats<Destination extends string = string> {
|
|
115
|
+
State: "Running" | "DisabledInStudio" | "Stopped";
|
|
116
|
+
Queued: number;
|
|
117
|
+
QueuedBytes: number;
|
|
118
|
+
Delivered: number;
|
|
119
|
+
Retries: number;
|
|
120
|
+
Uncertain: number;
|
|
121
|
+
Dropped: Dropped;
|
|
122
|
+
LastDeliveredAt?: number;
|
|
123
|
+
/** Empty when disabled in Studio; entries must be checked before reading. */
|
|
124
|
+
Destinations: Partial<Record<Destination, DestinationStats>>;
|
|
125
|
+
Reports: number;
|
|
126
|
+
Previews: number;
|
|
127
|
+
Skipped: Partial<Record<Category, number>>;
|
|
128
|
+
Filtered: { Issues: number; Warnings: number; Ignored: number };
|
|
129
|
+
Groups: number;
|
|
130
|
+
EncodeFailures: number;
|
|
131
|
+
LastTickError?: string;
|
|
132
|
+
Leaderboards: LeaderboardStats;
|
|
133
|
+
}
|
|
134
|
+
interface Handle<Destination extends string = string> {
|
|
135
|
+
/** Queues a test message; returns false and a reason if refused. */
|
|
136
|
+
Test(destination: Destination): LuaTuple<[boolean, string | undefined]>;
|
|
137
|
+
/** Queues sample embeds without mentions or real incidents; defaults to all previews. */
|
|
138
|
+
Preview(destination: Destination, kind?: PreviewKind): LuaTuple<[boolean, string | undefined]>;
|
|
139
|
+
/** Waits up to five seconds by default; returns whether the queues drained. */
|
|
140
|
+
Flush(timeout?: number): boolean;
|
|
141
|
+
/** Returns reporting, delivery and queue statistics. */
|
|
142
|
+
GetStats(): Stats<Destination>;
|
|
143
|
+
/** Stops reporting and discards queued reports; safe to repeat. */
|
|
144
|
+
Stop(): void;
|
|
145
|
+
}
|
|
146
|
+
type ScribeModule = Pick<typeof Scribe,
|
|
147
|
+
"AddLogSink" | "GetStatus" | "GetMetrics" | "GetPercentiles"
|
|
148
|
+
> & { readonly OnStatusChanged: Pick<typeof Scribe.OnStatusChanged, "Connect"> }
|
|
149
|
+
& Partial<Pick<typeof Scribe, "Version" | "GetBudgetSnapshot" | "GetLeaderboardSnapshot" | "GetProfileKeyPrefix" | "RegisterAddon">>;
|
|
150
|
+
|
|
151
|
+
/** Starts webhook reporting; stop any existing handle for this Scribe module first. */
|
|
152
|
+
function Start<Destination extends string>(scribe: ScribeModule, options: Options<Destination>): Handle<Destination>;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export = ScribeTelemetry;
|
package/init.luau
CHANGED
|
@@ -27,10 +27,25 @@ export type Stats = Transport.Stats & {
|
|
|
27
27
|
Leaderboards: { State: string, Monitored: number, Omitted: number, SnapshotAge: number?, LastError: string? },
|
|
28
28
|
}
|
|
29
29
|
export type Handle = {
|
|
30
|
+
--[[
|
|
31
|
+
Queues a test message; returns false and a reason if refused.
|
|
32
|
+
]]
|
|
30
33
|
Test: (self: Handle, destination: string) -> (boolean, string?),
|
|
34
|
+
--[[
|
|
35
|
+
Queues sample reports without triggering real failures or mentions.
|
|
36
|
+
]]
|
|
31
37
|
Preview: (self: Handle, destination: string, kind: PreviewKind?) -> (boolean, string?),
|
|
38
|
+
--[[
|
|
39
|
+
Waits for queued reports to drain, up to the timeout in seconds.
|
|
40
|
+
]]
|
|
32
41
|
Flush: (self: Handle, timeout: number?) -> boolean,
|
|
42
|
+
--[[
|
|
43
|
+
Returns delivery, queue and monitoring statistics.
|
|
44
|
+
]]
|
|
33
45
|
GetStats: (self: Handle) -> Stats,
|
|
46
|
+
--[[
|
|
47
|
+
Stops monitoring and discards queued reports; safe to call twice.
|
|
48
|
+
]]
|
|
34
49
|
Stop: (self: Handle) -> (),
|
|
35
50
|
}
|
|
36
51
|
export type LogEntry = {
|
|
@@ -166,6 +181,9 @@ end
|
|
|
166
181
|
local Handle = {}
|
|
167
182
|
Handle.__index = Handle
|
|
168
183
|
|
|
184
|
+
--[[
|
|
185
|
+
Starts Discord webhook reporting for this Scribe module.
|
|
186
|
+
]]
|
|
169
187
|
function ScribeTelemetry.Start(Scribe: ScribeModule, options: Options): Handle
|
|
170
188
|
for _, name in { "AddLogSink", "GetStatus", "GetMetrics", "GetPercentiles" } do
|
|
171
189
|
if type(Scribe) ~= "table" or type((Scribe :: any)[name]) ~= "function" then
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rbxts/scribe-telemetry",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"description": "Optional telemetry addon for Scribe",
|
|
5
5
|
"main": "init.luau",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"homepage": "https://scribe.ericplane.dev/",
|
|
13
13
|
"author": "ericplane",
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@rbxts/scribe": "^2.
|
|
15
|
+
"@rbxts/scribe": "^2.6.1"
|
|
16
16
|
},
|
|
17
17
|
"publishConfig": {
|
|
18
18
|
"access": "public"
|