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

Instrument/metric improvements #4249

Merged
merged 9 commits into from
Mar 26, 2024

Commits on Mar 22, 2024

  1. Wrap instrumentation handler call in try..catch, and log error

    - Failing handlers shouldn't cause the instrumented code to crash
    - Subsequent handlers should still be executed
    - There is no removal of broken handlers (like telemetry),
      because that would put the system in an inconsistent state if a
      handler fails intermittently.
    chrzaszcz committed Mar 22, 2024
    Configuration menu
    Copy the full SHA
    4024654 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    abfbc7b View commit details
    Browse the repository at this point in the history
  3. Add optional start/0 and stop/0 callbacks to mongoose_instrument

    The goal is to allow automatic initialisation/cleanup.
    chrzaszcz committed Mar 22, 2024
    Configuration menu
    Copy the full SHA
    8898e88 View commit details
    Browse the repository at this point in the history

Commits on Mar 25, 2024

  1. Use the start and stop callbacks in mongoose_instrument_event_table

    This way start and stop operations are more organised,
    and the functionality is tested.
    chrzaszcz committed Mar 25, 2024
    Configuration menu
    Copy the full SHA
    cfa2732 View commit details
    Browse the repository at this point in the history
  2. Export more types from mongoose_instrument

    - The goal is to use them in the handler modules.
    - label_key and label_value are a bit repetitive, but this way the specs
      are as strict as possible. If the list grows longer, we could make
      the type more generic instead of enumerating all values.
    chrzaszcz committed Mar 25, 2024
    Configuration menu
    Copy the full SHA
    206b3fb View commit details
    Browse the repository at this point in the history
  3. Improve mongoose_instrument_exometer

    1. Support the 'all_hosts_are_global' option
    2. Move prefix management from mongoose_metrics to eliminate
       the dependency on legacy code.
    3. Reset already existing metrics on setup.
       The goal is to have fresh repeatable metric state if you restart
       mongoose_instrument in tests.
       There is no metric removal, because it doesn't seem to be needed.
    chrzaszcz committed Mar 25, 2024
    Configuration menu
    Copy the full SHA
    f724934 View commit details
    Browse the repository at this point in the history
  4. Test 'all_metrics_are_global' for exometer

    More initialisation is needed because of host-type prefix handling.
    chrzaszcz committed Mar 25, 2024
    Configuration menu
    Copy the full SHA
    d60d8bc View commit details
    Browse the repository at this point in the history
  5. Improve mongoose_instrument_prometheus

    1. Add type specs.
    2. Use strings as metric names to avoid calling 'list_to_atom'.
       This doesn't seem to have a big performance penalty.
    3. Reset already existing metrics on startup, just like for exometer.
    4. Initialise counters with zero - previous initial value was 'undefined',
       resulting in a delay in initial rate metric calculation in Prometheus.
    chrzaszcz committed Mar 25, 2024
    Configuration menu
    Copy the full SHA
    96d8a21 View commit details
    Browse the repository at this point in the history
  6. Update Prometheus metric tests

    Metric name is now a string, not an atom.
    chrzaszcz committed Mar 25, 2024
    Configuration menu
    Copy the full SHA
    b768315 View commit details
    Browse the repository at this point in the history