Skip to content

Commit

Permalink
fix: update prometheus metrics (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
xav authored Dec 7, 2023
1 parent d808a3c commit b73ba03
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 43 deletions.
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ pub async fn bootstrap(

let mut state = AppState::new(config, keys_persistent_storage)?;

if state.config.telemetry_prometheus_port.is_some() {
if let Some(prometheus_port) = state.config.telemetry_prometheus_port {
info!("Telemetry is enabled on port {}", prometheus_port);
state.set_metrics(metrics::Metrics::new(Resource::new(vec![
KeyValue::new("service_name", state.build_info.crate_info.name.clone()),
KeyValue::new(
Expand Down
64 changes: 32 additions & 32 deletions terraform/.terraform.lock.hcl

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

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local app_metric = import '../app_metric.libsonnet';

{
new(ds, vars):: app_metric.new(ds, vars, 'Identity - Invalid CACAO during Registration', 'invalid_identity_register_cacao', 'Invalid CACAOs')
new(ds, vars):: app_metric.new(ds, vars, 'Identity - Invalid CACAO during Registration', 'invalid_identity_register_cacao_total', 'Invalid CACAOs')
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local app_metric = import '../app_metric.libsonnet';

{
new(ds, vars):: app_metric.new(ds, vars, 'Identity - Invalid JWT during Unregistration', 'invalid_identity_unregister_jwt', 'Invalid JWTs')
new(ds, vars):: app_metric.new(ds, vars, 'Identity - Invalid JWT during Unregistration', 'invalid_identity_unregister_jwt_total', 'Invalid JWTs')
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local app_metric = import '../app_metric.libsonnet';

{
new(ds, vars):: app_metric.new(ds, vars, 'Identity - Registrations', 'identity_register', 'Registrations')
new(ds, vars):: app_metric.new(ds, vars, 'Identity - Registrations', 'identity_register_total', 'Registrations')
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local app_metric = import '../app_metric.libsonnet';

{
new(ds, vars):: app_metric.new(ds, vars, 'Identity - Resolutions', 'identity_resolved', 'Resolutions')
new(ds, vars):: app_metric.new(ds, vars, 'Identity - Resolutions', 'identity_resolved_total', 'Resolutions')
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local app_metric = import '../app_metric.libsonnet';

{
new(ds, vars):: app_metric.new(ds, vars, 'Identity - Unregistrations', 'identity_unregister', 'Unregistrations')
new(ds, vars):: app_metric.new(ds, vars, 'Identity - Unregistrations', 'identity_unregister_total', 'Unregistrations')
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local app_metric = import '../app_metric.libsonnet';

{
new(ds, vars):: app_metric.new(ds, vars, 'Invite - Invalid JWT during Registration', 'invalid_invite_register_jwt', 'Invalid JWTs')
new(ds, vars):: app_metric.new(ds, vars, 'Invite - Invalid JWT during Registration', 'invalid_invite_register_jwt_total', 'Invalid JWTs')
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local app_metric = import '../app_metric.libsonnet';

{
new(ds, vars):: app_metric.new(ds, vars, 'Invite - Invalid JWT during Unregistration', 'invalid_invite_unregister_jwt', 'Invalid JWTs')
new(ds, vars):: app_metric.new(ds, vars, 'Invite - Invalid JWT during Unregistration', 'invalid_invite_unregister_jwt_total', 'Invalid JWTs')
}
2 changes: 1 addition & 1 deletion terraform/monitoring/panels/app/invite/register.libsonnet
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local app_metric = import '../app_metric.libsonnet';

{
new(ds, vars):: app_metric.new(ds, vars, 'Invite - Registrations', 'invite_register', 'Registrations')
new(ds, vars):: app_metric.new(ds, vars, 'Invite - Registrations', 'invite_register_total', 'Registrations')
}
2 changes: 1 addition & 1 deletion terraform/monitoring/panels/app/invite/resolved.libsonnet
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local app_metric = import '../app_metric.libsonnet';

{
new(ds, vars):: app_metric.new(ds, vars, 'Invite - Resolutions', 'invite_resolved', 'Resolutions')
new(ds, vars):: app_metric.new(ds, vars, 'Invite - Resolutions', 'invite_resolved_total', 'Resolutions')
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local app_metric = import '../app_metric.libsonnet';

{
new(ds, vars):: app_metric.new(ds, vars, 'Invite - Unregistrations', 'invite_unregister', 'Unregistrations')
new(ds, vars):: app_metric.new(ds, vars, 'Invite - Unregistrations', 'invite_unregister_total', 'Unregistrations')
}

0 comments on commit b73ba03

Please sign in to comment.