Skip to content

Commit

Permalink
chore: add prometheus metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
insertish committed Jul 4, 2023
1 parent 815c3fe commit 76150db
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 21 deletions.
41 changes: 33 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/bonfire/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "revolt-bonfire"
version = "0.6.4"
version = "0.6.5"
license = "AGPL-3.0-or-later"
edition = "2021"

Expand Down
10 changes: 5 additions & 5 deletions crates/core/database/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "revolt-database"
version = "0.6.4"
version = "0.6.5"
edition = "2021"
license = "AGPL-3.0-or-later"
authors = [ "Paul Makles <me@insrt.uk>" ]
Expand All @@ -22,10 +22,10 @@ default = [ "mongodb", "async-std-runtime" ]

[dependencies]
# Core
revolt-result = { version = "0.6.4", path = "../result" }
revolt-models = { version = "0.6.4", path = "../models" }
revolt-presence = { version = "0.6.4", path = "../presence" }
revolt-permissions = { version = "0.6.4", path = "../permissions", features = [ "serde", "bson" ] }
revolt-result = { version = "0.6.5", path = "../result" }
revolt-models = { version = "0.6.5", path = "../models" }
revolt-presence = { version = "0.6.5", path = "../presence" }
revolt-permissions = { version = "0.6.5", path = "../permissions", features = [ "serde", "bson" ] }

# Utility
log = "0.4"
Expand Down
4 changes: 2 additions & 2 deletions crates/core/models/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "revolt-models"
version = "0.6.4"
version = "0.6.5"
edition = "2021"
license = "AGPL-3.0-or-later"
authors = [ "Paul Makles <me@insrt.uk>" ]
Expand All @@ -18,7 +18,7 @@ default = [ "serde", "partials" ]

[dependencies]
# Core
revolt-permissions = { version = "0.6.4", path = "../permissions" }
revolt-permissions = { version = "0.6.5", path = "../permissions" }

# Serialisation
revolt_optional_struct = { version = "0.2.0", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/core/permissions/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "revolt-permissions"
version = "0.6.4"
version = "0.6.5"
edition = "2021"
license = "AGPL-3.0-or-later"
authors = [ "Paul Makles <me@insrt.uk>" ]
Expand Down
2 changes: 1 addition & 1 deletion crates/core/presence/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "revolt-presence"
version = "0.6.4"
version = "0.6.5"
edition = "2021"
license = "AGPL-3.0-or-later"
authors = [ "Paul Makles <me@insrt.uk>" ]
Expand Down
2 changes: 1 addition & 1 deletion crates/core/result/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "revolt-result"
version = "0.6.4"
version = "0.6.5"
edition = "2021"
license = "AGPL-3.0-or-later"
authors = [ "Paul Makles <me@insrt.uk>" ]
Expand Down
3 changes: 2 additions & 1 deletion crates/delta/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "revolt-delta"
version = "0.6.4"
version = "0.6.5"
license = "AGPL-3.0-or-later"
authors = ["Paul Makles <paulmakles@gmail.com>"]
edition = "2018"
Expand Down Expand Up @@ -47,6 +47,7 @@ lettre = "0.10.0-alpha.4"
rocket = { version = "0.5.0-rc.2", default-features = false, features = ["json"] }
rocket_empty = { version = "0.1.1", features = ["schema"] }
rocket_authifier = { version = "1.0.7" }
rocket_prometheus = "0.10.0-rc.3"

# spec generation
schemars = "0.8.8"
Expand Down
5 changes: 5 additions & 0 deletions crates/delta/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ extern crate serde_json;
pub mod routes;
pub mod util;

use rocket_prometheus::PrometheusMetrics;
use std::net::Ipv4Addr;

use async_std::channel::unbounded;
Expand Down Expand Up @@ -65,7 +66,11 @@ async fn rocket() -> _ {

// Configure Rocket
let rocket = rocket::build();
let prometheus = PrometheusMetrics::new();

routes::mount(rocket)
.attach(prometheus.clone())
.mount("/metrics", prometheus)
.mount("/", revolt_quark::web::cors::catch_all_options_routes())
.mount("/", revolt_quark::web::ratelimiter::routes())
.mount("/swagger/", revolt_quark::web::swagger::routes())
Expand Down
2 changes: 1 addition & 1 deletion crates/quark/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "revolt-quark"
version = "0.6.4"
version = "0.6.5"
edition = "2021"
license = "AGPL-3.0-or-later"

Expand Down

0 comments on commit 76150db

Please sign in to comment.