ic
ic copied to clipboard
chore: migrating metrics proxy into the monorepo
This PR ports the external metrics proxy to the IC repo. NOTE: it doesn't yet include it in the host and guest OS and just adds the code here. The OSs still use the external repository.
There were a lot of things to consider when doing this port:
-
axum-otel-metrics- no longer supports exporting metrics via prometheus crate because it has a security vulnerability and is no longer maintained. (It was replaced byaxum-prometheuswhich gives some but not all metrics we used to have) NOTE: this are just internal metrics coming from the metrics proxy not the ones that are actually proxied over, so the functionality remains the same but some metrics from the proxy itself (i.e. cache_hits) are no longer there. Not sure how important is this since we have no alerts or dashboards configured with these metrics. -
rustls- some types got renamed with the upgrade since the old version was pretty stale, certs and key loading is a bit different now. - custom implementation for deserializing
LabelFilterAction- the proxy in the external repo usesserde_yaml0.8 and we use the latest possibleserde_yaml0.9.34+deprecated and it changes how the tagged unions (i.e. enums) need to be specified in the incoming yaml which broke the deserializing of the existing configured files currently running on the host and guest OS. The custom implementation fixes it.
One more thing: A lot of other crates have clippy errors because Cargo.lock changed quite a bit and tokio gets upgraded so those would need to be fixed somehow if we are to merge this.
To see the full diff one can do the following:
- clone the other metrics proxy
- checkout this branch on this repository
- from the root of this repository run:
diff rs/ic_os/metrics_proxy/src /path/to/metrics-proxy/src