Skip to content

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();
        }
    }
}

Download TelemetryExample.cs.

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 ​

IdentifierNumeric value
PerformSearch1
SearchCompletionTime2
SearchLanguage3
AddRawDocument100
UpdateDocument101
DeleteDocument102
DeleteByQueryDocument103
PushDocument104
ExecutionTime200
LoadAssembly300

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