Appearance
Telemetry & KPIs
Use the host's KPI service to record supported events and execution time. Always finish timers in the scope that starts them.
C# execution time
C# exposes TrackExecutionTime, followed by explicit Start and Stop calls. Disposal releases the registration; it does not replace Stop.
cs
using BlueCurve.Search.Telemetry.Abstractions;
namespace BlueCurve.Examples;
public static class TelemetryExample
{
public static void Run(IKeyPerformanceIndicator kpi, CancellationToken cancellationToken)
{
using var timer = kpi.TrackExecutionTime(cancellationToken);
timer.Start();
try
{
cancellationToken.ThrowIfCancellationRequested();
// Perform the work being measured here.
}
finally
{
timer.Stop();
}
}
}WASM execution time
The WASM SDK timer helpers manage the host timer through a handle.
rust
use bluecurve_search_sdk::{KeyPerformanceIndicators, Kpi};
Kpi::new().measure(KeyPerformanceIndicators::ExecutionTime, || {
// Perform the work here.
});zig
const timer = bc.Job.Kpi.trackExecutionTime(.ExecutionTime);
defer timer.stop();
// Perform the work here.kotlin
import bluecurve.sdk.KeyPerformanceIndicators
import bluecurve.sdk.Kpi
Kpi().measure(KeyPerformanceIndicators.ExecutionTime) {
// Perform the work here.
}go
timer := bluecurve.StartExecutionTimer()
defer timer.Stop()
// Perform the work here.Supported KPI identifiers
| Identifier | Numeric value |
|---|---|
PerformSearch | 1 |
SearchCompletionTime | 2 |
SearchLanguage | 3 |
AddRawDocument | 100 |
UpdateDocument | 101 |
DeleteDocument | 102 |
DeleteByQueryDocument | 103 |
PushDocument | 104 |
ExecutionTime | 200 |
LoadAssembly | 300 |
Event metadata
Pass a supported KPI identifier and structured values. For example, in Rust:
rust
use bluecurve_search_sdk::{KeyPerformanceIndicators, Kpi};
Kpi::new().track_event(
KeyPerformanceIndicators::UpdateDocument,
&[("plugin_name", "MyRustIndexer".into()), ("document_count", 1.into())],
);Keep document bodies, credentials, and sensitive source metadata out of telemetry. Record counts and operational identifiers that help diagnose the integration.
Next: Plugin packaging