mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-14 18:10:39 +09:00
Add plugin telemetry bridge capability
Expose telemetry.track through the plugin SDK and server host bridge, forward plugin-prefixed events into the shared telemetry client, and demonstrate the capability in the kitchen sink example.\n\nCo-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
53dbcd185e
commit
af844b778e
14 changed files with 209 additions and 1 deletions
|
|
@ -41,6 +41,7 @@ const manifest: PaperclipPluginManifestV1 = {
|
|||
"goals.update",
|
||||
"activity.log.write",
|
||||
"metrics.write",
|
||||
"telemetry.track",
|
||||
"plugin.state.read",
|
||||
"plugin.state.write",
|
||||
"events.subscribe",
|
||||
|
|
|
|||
|
|
@ -405,6 +405,16 @@ async function registerActionHandlers(ctx: PluginContext): Promise<void> {
|
|||
data: { companyId },
|
||||
});
|
||||
await ctx.metrics.write("demo.events.emitted", 1, { source: "manual" });
|
||||
await ctx.telemetry.track("demo_event", {
|
||||
source: "manual",
|
||||
has_company: Boolean(companyId),
|
||||
});
|
||||
pushRecord({
|
||||
level: "info",
|
||||
source: "telemetry",
|
||||
message: "Tracked plugin telemetry event demo_event",
|
||||
data: { companyId },
|
||||
});
|
||||
return { ok: true, message };
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue