Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metrics: implement batch observer #429

Merged
merged 3 commits into from
Jan 18, 2021
Merged

metrics: implement batch observer #429

merged 3 commits into from
Jan 18, 2021

Commits on Jan 17, 2021

  1. metrics: implement batch observer

    This patch adds an implementation of the metrics batch observer. The API
    is not identical to the example in [the
    spec](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/metrics/api.md#batch-observer)
    as it is inconvenient to register metrics after they are moved into the
    observer callback in rust. Instead the `Meter::batch_observer` method
    accepts a closure in which instruments can be registered before being
    moved into the callback.
    
    ```rust
    meter.batch_observer(|batch| {
        let inst = batch.u64_sum_observer("example").init();
    
        move |result| {
            result.observe(&[KeyValue::new("a", "1")], inst.observation(42)]);
        }
    });
    ```
    jtescher committed Jan 17, 2021
    Configuration menu
    Copy the full SHA
    4c206d4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8a12e7d View commit details
    Browse the repository at this point in the history

Commits on Jan 18, 2021

  1. Configuration menu
    Copy the full SHA
    e2c8c87 View commit details
    Browse the repository at this point in the history