Documentation Index
Fetch the complete documentation index at: https://cognis.vasanth.xyz/llms.txt
Use this file to discover all available pages before exploring further.
cognis-trace translates Cognis runtime events into spans, generations, and scores, then ships them to one or more exporters. Langfuse is the supported production backend; stdout and mock exporters ship for local use; OpenTelemetry support is on the roadmap.
Crate metadata
| Field | Value |
|---|---|
| Latest version | 0.3 |
| docs.rs | docs.rs/cognis-trace |
| Repo path | crates/cognis-trace |
| Default features | stdout |
Modules at a glance
| Module | What |
|---|---|
handler | TracingHandler, TracingHandlerBuilder. Implements CallbackHandler. |
exporter | TraceExporter trait. |
exporters::stdout | StdoutExporter, StdoutExporter::compact(). |
exporters::langfuse | LangfuseExporter, LangfuseConfig, LangfusePromptClient, LangfuseScorer. |
cost | PriceTable, ModelPrice. |
meta | TraceMeta::session/user/release/environment, merge_into. |
span | Span, Generation. |
parent | Parent-span tracking via parent_run_id. |
prompts | Prompt, PromptStore, PromptBody. |
scores | ScoreSink, ScoreRecord, ScoreValue. |
batch | Batcher, BatcherConfig. |
Key types
TracingHandler
CallbackHandler. Use as an Observer via cognis_core::HandlerObserver(handler).
TracingHandlerBuilder
| Method | Purpose |
|---|---|
with_exporter<E: TraceExporter + 'static>(e: E) | Append an exporter. Multiple are fine. |
with_default_pricing() | Load the dated default price table. |
with_pricing(PriceTable) | Custom price table. |
override_price(model, ModelPrice) | Single-model override. |
with_batcher_config(BatcherConfig) | Tune batching. |
build() | TracingHandler. Spawns one batcher per exporter. |
Exporters
TraceExporter:
Cost
TraceMeta
Langfuse prompt client
Scores
LangfuseScorer::new(LangfuseConfig::from_env()?)? is a built-in ScoreSink.
Feature flags
| Feature | Pulls in |
|---|---|
stdout | StdoutExporter (default). |
langfuse | reqwest, secrecy, base64, plus the Langfuse exporter / prompt client / scorer. |
all | Every exporter. |
integration_tests | Tests that hit real services (off by default). |
See also
Trace with Langfuse
User guide.
Cost tracking
Pricing.
Prompts and scores
Versioned prompts and eval scores.