.NET SDK

Trefur.Observe — .NET 8+ client for Trefur Observe.

Install

dotnet add package Trefur.Observe

Init

using Trefur.Observe.Client;

using var client = TrefurObserveClient.Configure()
    .ApiKey(Environment.GetEnvironmentVariable("TREFUR_API_KEY")!)   // trf_obs_*
    .UseEndpoint("https://observe.trefur.com")                       // default
    .Build();

Recording telemetry

using Trefur.Observe.Model;

var run = new AgentRun
{
    Framework = "custom",
    AgentName = "search-bot",
    Status    = "completed",
    StartedAt = DateTime.UtcNow.ToString("o"),
};
run.Steps.Add(new AgentStep
{
    StepType  = "tool_call",
    ToolName  = "search",
    StartedAt = DateTime.UtcNow.ToString("o"),
    Status    = "completed",
});

client.Record(run);
client.Flush();

// Disposing the client (the using block) flushes buffered runs.

Environment variables

Canonical list: env-vars reference.

Source + tests live in trefur-ai/trefur-sdks under dotnet/Trefur.Observe. License: Apache 2.0.