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

Add http.active.requests and http.duration metrics #227

Merged

Conversation

attilakreiner
Copy link
Contributor

@attilakreiner attilakreiner commented May 3, 2023

Description

This change adds these metrics:

  • http.active.requests to track the number of currently active http requests (gauge)
  • http.duration to track to track the duration of http requests (histogram)

Fixes #111

@attilakreiner attilakreiner changed the title WIP Add http.active.requests and http.duration metrics May 4, 2023
@attilakreiner attilakreiner marked this pull request as ready for review May 4, 2023 14:49
@attilakreiner attilakreiner requested a review from jfallows May 4, 2023 14:49
Copy link
Contributor

@jfallows jfallows left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we need to adjust the line:

https://github.com/aklivity/zilla/blob/feature/telemetry-metrics/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/DispatchAgent.java#L1328

To use the following instead:

final MessageConsumer replyTo = supplyReplyTo(initialId).andThen(sentMetricHandler);

because these lines fill in the timestamp during writing of frames, such as END frame.

https://github.com/aklivity/zilla/blob/feature/telemetry-metrics/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/stream/Target.java#L134

so that needs to be done first, before metrics try to observe the timestamp value, otherwise it will show timestamp value 0.

@attilakreiner attilakreiner requested a review from jfallows May 9, 2023 18:03
@jfallows jfallows merged commit 2266ebb into aklivity:feature/telemetry-metrics May 9, 2023
@jfallows jfallows linked an issue May 9, 2023 that may be closed by this pull request
@attilakreiner attilakreiner deleted the metrics-http branch May 11, 2023 06:34
jfallows added a commit that referenced this pull request May 12, 2023
* Add stream metrics spec and impl projects

* Add http metrics spec and impl projects

* Add metrics modules to incubator docker image

* Metrics schema, extensibility, storage and command line support (#173)

* Create incubator projects for exporter-prometheus.spec and exporter-prometheus

* Engine support to exporters (#202)

* Fix metrics command, find layout files in the engine dir (#204)

* Prometheus Exporter (#203)

* Minimize performance overhead for metric collection (#217)

* Remove zilla load command (#223)

* Introducing Stream Direction to Optimize Metric Collection (#224)

* Add http.active.requests and http.duration metrics (#227)

---------

Co-authored-by: Attila Kreiner <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support additional http specific metrics
2 participants