Skip to content

Releases: awslabs/metrique

metrique-v0.1.25

20 Apr 18:35
fb853a1

Choose a tag to compare

Added

  • pending_sink in metrique-util (feature: pending-sink): deferred sink attachment with bounded buffering. (#275)

    • Emit metrics immediately during startup while the real sink initializes asynchronously.
    • Entries buffer in a lock-free ring buffer; oldest dropped when full.
    • resolver.resolve(real_sink) drains the buffer and switches to direct forwarding.
    use metrique_util::pending_sink;
    
    // Create a pending sink that buffers up to 1024 entries.
    let (sink, resolver) = pending_sink::new(1024);
    
    // Attach immediately so metrics start buffering during startup.
    let _handle = ServiceMetrics::attach((sink, ()));
    
    // Later, once the real sink is ready (after async init, credential
    // exchange, etc.):
    resolver.resolve(real_sink);
    // Buffered entries drain into the real sink; future appends go direct.

Other

  • Fix audit (#276)
  • reframe terminology to lead with "wide events" (#273)
  • use workspace dependencies for inter-crate deps (#271)

metrique-v0.1.24

13 Apr 21:05
be05ec9

Choose a tag to compare

Added

  • Tokio runtime metrics integration via metrique-util (feature: tokio-metrics-bridge). Spawns a background reporter that periodically appends RuntimeMetrics snapshots (worker utilization, park counts, queue depths, poll durations, etc.) to the attached sink. The reporter is automatically aborted when the attach handle drops. (#256)

    use metrique_util::{AttachGlobalEntrySinkTokioMetricsExt, TokioRuntimeMetricsConfig};
    
    let _handle = ServiceMetrics::attach_to_stream(
        Emf::all_validations("MyApp".to_string(), vec![vec![]])
            .output_to(std::io::stderr()),
    );
    
    let config = TokioRuntimeMetricsConfig::default()
        .with_interval(Duration::from_secs(30))
        .with_name_style(MetricNameStyle::KebabCase);
    ServiceMetrics::subscribe_tokio_runtime_metrics(config);
  • Vec<V: Value> and [V: Value] now implement Value, so vector fields emit as native JSON arrays in EMF and comma-joined strings in other formats. Elements that write nothing (e.g. None in Vec<Option<String>>) are skipped automatically. (#266)

    #[metrics(rename_all = "PascalCase")]
    struct RequestMetrics {
        plugins: Vec<String>,
        request_count: u32,
    }
    // EMF output: {"Plugins": ["auth", "cache"], "RequestCount": 5}
    // Default:   Plugins=auth,cache
  • OwnedCounterGuard: an owned variant of CounterGuard that holds an Arc<Counter> instead of a reference, allowing it to be moved across async boundaries or stored in structs without lifetime constraints. Returned by Counter::increment_owned. (#265)

    use std::sync::Arc;
    use metrique::Counter;
    
    let counter = Arc::new(Counter::new(0));
    let (guard, count) = counter.increment_owned(); // +1 now, -1 on drop
    // guard can be stored in a response body wrapper, moved into a spawned task, etc.
    tokio::spawn(async move {
        do_work().await;
        drop(guard); // decrements when the task completes
    });

Fixed

  • Convert broken reference-style links to inline links in README (#262)

metrique-v0.1.23

02 Apr 14:07
7d11869

Choose a tag to compare

Added

  • Graceful no-op when no sink is attached (#251)

Fixed

  • (metrics) Make metrics macro inside macro_rules more hygiene-safe and cfg-aware (#259)
  • (metrics) Derive debug through metrics macro (#257)
  • (doc) Make *.md links work on crates.io/github also (#254)

Other

  • Add RenderQueue sink (#253)

metrique-v0.1.22

18 Mar 00:08
c64ddd5

Choose a tag to compare

Fixed

  • (doc) Fix docs.rs build failure for metrique crate (#245)

metrique-v0.1.21

17 Mar 21:38
498ad4e

Choose a tag to compare

Added

  • Pure JSON output format via metrique::json::Json (#224)

    let _handle = ServiceMetrics::attach_to_stream(
        Json::new().output_to_makewriter(|| std::io::stdout().lock()),
    );
    // {"timestamp":...,"metrics":{...},"properties":{...}}
  • Counter::increment_scoped: returns a guard that decrements on drop, for tracking in-flight work (#235)

    static IN_FLIGHT: Counter = Counter::new(0);
    let _guard = IN_FLIGHT.increment_scoped(); // +1 now and for this metric, -1 on drop
  • Counter::new is now const fn, enabling static Counter declarations (#235)

  • CloseValue impl for CounterGuard and OnceLock<T> (#235)

  • metrique-util crate with State<T> (feature: state): atomically swappable shared value with snapshot-on-first-read semantics (#235)

    let shared = State::new(AppConfig::default());
    shared.store(Arc::new(new_config)); // background task swaps in new config
    let request = shared.clone();       // each request clones a handle
    let config = request.snapshot();    // first snapshot() pins the value
  • skip_validate_dimensions_exist setter on EmfBuilder (#223)

Fixed

  • EMF produced trailing commas when distribution ends with skipped observation (#222)

Other

  • Add _guide module with cookbook, concurrency, sinks, sampling, testing (#219, #232)
  • (examples) add global-state example combining State, Counter::increment_scoped, and OnceLock (#235)
  • (examples) use metrique::ServiceMetrics instead of global_entry_sink! (#241)
  • Add metrique json feature and formatter re-export (#242)

metrique-v0.1.20

05 Mar 21:32
e373a2f

Choose a tag to compare

Added

  • add LocalFormat for human-readable local development metrics (#213)

Other

  • Add example for global up/down counter (#207)

metrique-v0.1.19

18 Feb 00:36
c6803f3

Choose a tag to compare

Added

  • Add runtime-wide time source override for tokio (#206)

  • Histogram fields can now be aggregated across structs using #[aggregate(strategy = Histogram<T>)]. This enables merging latency distributions from multiple sources (e.g. fan-out shards) into a single combined distribution. (#204)

metrique-v0.1.18

14 Feb 23:14
9e88894

Choose a tag to compare

Other

  • Add Debug derive to SetEntryDimensions (#202)

metrique-v0.1.17

07 Feb 18:37
0673b08

Choose a tag to compare

Fixed

  • Fix issues with #[derive(Debug)] on metrics entries (#200)

metrique-v0.1.16

01 Feb 22:10
bd6e843

Choose a tag to compare

Added

  • impl Debug for Slot, SlotGuard, and AppendAndCloseOnDrop (#194)

  • Add set_test_sink_on_current_tokio_runtime to simplify testing with Tokio (#193)

Other