-
Notifications
You must be signed in to change notification settings - Fork 44
Feat: record origin of client requests in metrics #2411
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
Feat: record origin of client requests in metrics #2411
Conversation
7ab0eab
to
ffb9193
Compare
649300e
to
39e045a
Compare
647e477
to
7e27ff9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 55 out of 55 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
mithril-aggregator/src/http_server/routes/artifact_routes/cardano_database.rs:32
- The 'with_origin_tag' middleware is passed 'dependency_manager' here instead of 'router_state' as used in similar routes; please verify this is intentional.
.and(middlewares::with_origin_tag(dependency_manager))
e190665
to
025b74b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 55 out of 55 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
mithril-aggregator/src/http_server/routes/artifact_routes/cardano_database.rs:32
- Consider using 'router_state' consistently for the 'with_origin_tag' middleware. Verify if passing 'dependency_manager' here is intentional compared to other endpoints that use 'router_state'.
.and(middlewares::with_origin_tag(dependency_manager))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
mithril-aggregator/src/http_server/routes/artifact_routes/cardano_database.rs
Outdated
Show resolved
Hide resolved
Co-authored-by: Clément TURMEL <turmelclem@users.noreply.github.com>
…tead of the deleted parameter. Co-authored-by: Clément TURMEL <turmelclem@users.noreply.github.com>
Co-authored-by: Clément TURMEL <turmelclem@users.noreply.github.com>
…on for the aggregator node and how to specify an origin tag with the mithril-client library and mithril-client CLI Co-authored-by: Clément TURMEL <turmelclem@users.noreply.github.com>
…rate in a dedicated function the computation of the HTTP headers from the HTTP headers in the options and with the optional origin tag. Co-authored-by: Clément TURMEL <turmelclem@users.noreply.github.com> Co-authored-by: DJO <Alenar@users.noreply.github.com>
eec0720
to
5b9480b
Compare
…tabase, stores and `MetricEventMessage`
…n in client options
5b9480b
to
e2b6281
Compare
ef9c8e4
to
088d255
Compare
088d255
to
8c3404b
Compare
…f multiple usage of `origin_tag`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…rigin_tag` This fixes the unwanted behavior where calling `with_options` after `with_origin_tag` would erase the `origin_tag` value. Co-authored-by: DJO <Alenar@users.noreply.github.com>
name = "client-cardano-database-v2" -version = "0.0.3" +version = "0.0.4" * client-cardano-database from `0.1.28` to `0.1.29` * client-cardano-stake-distribution from `0.1.10` to `0.1.11` * client-cardano-transaction from `0.1.20` to `0.1.21` * client-mithril-stake-distribution from `0.2.8` to `0.2.9` * mithril-metric from `0.1.9` to `0.1.10` * mithril-aggregator from `0.7.29` to `0.7.30` * mithril-client-cli from `0.11.12` to `0.11.13` * mithril-client-wasm from `0.8.6` to `0.8.7` * mithril-client from `0.11.18` to `0.11.19` * mithril-common from `0.5.20` to `0.5.21` * mithril-aggregator-fake from `0.4.4` to `0.4.5` * mithril-end-to-end from `0.4.77` to `0.4.78` * [js] client-wasm-nodejs from `0.3.6` to `0.3.7` * [js] client-wasm-web from `0.3.6` to `0.3.7` * [js] client-wasm-ci-test from `0.3.6` to `0.3.7` * [js] mithril-client-wasm from `0.8.6` to `0.8.7` * [js] mithril-explorer from `0.7.32` to `0.7.33`
Content
This PR includes support for a new HTTP header in the aggregator REST API which allows recording the origin of requests.
The aggregator can set a list of authorized origin tags in its configuration. The default list contains
EXPLORER
,BENCHMARK
,CI
andNA
which can be extended with additional tags.The clients have also been updated to be able to provide the origin tag parameter.
Rust example using the
mithril-client
crate:Javascript example using the
mithril-client-wasm
library:Client CLI command example:
Issue(s)
Closes #2382