teksilo-telemetry-codegen 0.9.2

Proc macro that expands a YAML event manifest into typed emitters for teksilo-telemetry.
Documentation

teksilo-telemetry-codegen — compile-time codegen for Teksilo telemetry.

Consumes a YAML event manifest at build time and expands to:

  • A SCHEMA_VERSION: u32 constant.
  • For each event with enum-typed props: a dedicated enum type with an as_str() method.
  • For each event: a typed emit_<event_name>(reporter, install_id, session_id, …props…) free function that assembles an teksilo_telemetry::Event and hands it to the reporter.

Usage

// In your app's lib.rs or main.rs:
teksilo_telemetry_codegen::include_telemetry_schema!("telemetry/events.yaml");

The path is resolved relative to CARGO_MANIFEST_DIR (the crate containing the macro invocation).

YAML format

schema_version: 1
events:
  - name: intent.dispatched
    category: intent
    expires: "2027-06-01"
    bug: "https://github.com/your-org/your-app/issues/42"
    description: "Fired whenever an intent passes through dispatch."
    props:
      - name: name
        type: dev_static
      - name: source
        type: enum
        values: [shortcut, menu, handler, programmatic, accessibility]

Property types

YAML type Rust type PropValue variant
dev_static &'static str StaticStr
bounded_str &str BoundedStr
u32 u32 U32
i64 i64 I64
bool bool Bool
f64_bucket teksilo_telemetry::F64Bucket F64Bucket
enum generated enum (see above) Enum { variant: &'static str }