From fb4e2ebe54fecd60a42d2ad6c19e12b0ecaae618 Mon Sep 17 00:00:00 2001 From: Xavier Basty Date: Thu, 30 Nov 2023 23:11:18 +0100 Subject: [PATCH] fix: update prometheus metrics --- src/lib.rs | 3 +- terraform/.terraform.lock.hcl | 64 +++++++++---------- .../identity/invalid_register_cacao.libsonnet | 2 +- .../identity/invalid_unregister_jwt.libsonnet | 2 +- .../panels/app/identity/register.libsonnet | 2 +- .../panels/app/identity/resolved.libsonnet | 2 +- .../panels/app/identity/unregister.libsonnet | 2 +- .../app/invite/invalid_register_jwt.libsonnet | 2 +- .../invite/invalid_unregister_jwt.libsonnet | 2 +- .../panels/app/invite/register.libsonnet | 2 +- .../panels/app/invite/resolved.libsonnet | 2 +- .../panels/app/invite/unregister.libsonnet | 2 +- 12 files changed, 44 insertions(+), 43 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 89a67ce..7069656 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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( diff --git a/terraform/.terraform.lock.hcl b/terraform/.terraform.lock.hcl index 6533fce..ffd3403 100644 --- a/terraform/.terraform.lock.hcl +++ b/terraform/.terraform.lock.hcl @@ -24,47 +24,47 @@ provider "registry.terraform.io/alxrem/jsonnet" { } provider "registry.terraform.io/grafana/grafana" { - version = "2.3.1" + version = "2.7.0" constraints = "~> 2.0, >= 2.1.0" hashes = [ - "h1:eA88WSfhsi/mDvGRats1tsvj1uIFiYC9WuMSmIwMPBA=", - "zh:08697de4636bb5fb633cc65917ff5a058b7b7e8afa550a515be42bb0e9804120", - "zh:28aa9c1d89f97ed07980ef486af629afdda9a8235f10932cff04c38fc9126455", - "zh:4191c4b8b26ce66f6963869d76aabb003c81f345b953a36064d8893375f0ee04", - "zh:4a29602e14a16796053a5e33145d46de174c237c4b54e6b11fc4de583098d5bb", - "zh:5191ab082b770f80f3ea9aa786ea155b4aa5ce9f019eb473800409998f9eaf11", - "zh:7f2bf9028766de406f066c9eea7df6054809bf1336b1dab734a356d9654fcb78", - "zh:8f1d5b5400bb1185982dbf1cb010a7b58b628a6bbd8a2d5e2277af61bfc4fd0f", - "zh:aac32024c758d4086f340cb1d615b8f1658f3cc073bc74d3773a1e0090dc04c8", - "zh:c17a1e2673d19fa747ca57d8cfa0a134ee20bb8c740d6fedf60bfbc0fb36c3b7", - "zh:cb8bb196d4ebd570b43dccf9af9bc6930ba567f602698dba34e6409aa9ffde49", - "zh:cc3bd739fb96689c56355f728fd57aa56e6bb03c455fe3149027da75ae04b57b", - "zh:cd182d58a1ab4ed70b0fea81059e456a5a8aed4d500678adf8e9dc4ec0fc8ea0", - "zh:e3d6f66f3fbbbe17051eabf80775a03effad57a42701545b75ad8278c89f76d6", - "zh:f1d8e24656eabec49eabd0bcbcac2a5ef41826ec9271df522a9873639976fd3d", + "h1:JtEAv6ZvXvn0KWcSSHwfXSP0YAhTG8GxxSrlneznMYg=", + "zh:0733a30042ed9c30620a27527940af0406c5f5da40dad3d9babe05dd87487c4c", + "zh:5316d67a1c4732cc7817177fe45fc79b6d91164b28c33f95157adbf6b79116fc", + "zh:5583340bb558e6ea0b18f04b44a989f128f80dc0d00e3f4bd86d4665537d6f2a", + "zh:5eeebad608f1302bb28685a6398cf3e1cd885cb59c078ee25add0d5f02ca36da", + "zh:606fe1904a1e0326d2e203c18543ba3378ba8b50de960d76bf6cee8356362b1f", + "zh:64447abf224592d68c630ad80652bec2d25f5e2ba622b6bdf290fe07f08606eb", + "zh:7278fea42f571c0879639079016e8fb6bb9cf20e97d95badd1de4c1d932360e9", + "zh:765af3d815dea711ad8b8078008ca5e7185fa784820f6a9c1649a1ffc1f09632", + "zh:c402167af23ffb8aa84ff03fa525921061fba74d089445e2bd72941067aa4aa1", + "zh:e231c62e803c4679973d88a78594817f84f712852d29b5e4a985ce0826415f48", + "zh:e6e7f58509521c783248d17b9b9618940ac0ef142a1842b4a24f31a67d92b413", + "zh:e80d2caf1a34cf9cb4023fec22774db6912bd9bc5c49d0a8e1c12a27f6d1f2d6", + "zh:edd538b9afa164b05b58f374fec7ca47408e6b978288daaf3cf2cc5bfeb6ec3c", + "zh:f2fd599ab5bbf50654d0a1c63fe247aa6fc872d1eb052f80d548b837493cb2b9", ] } provider "registry.terraform.io/hashicorp/aws" { - version = "5.17.0" + version = "5.28.0" constraints = ">= 4.9.0, >= 4.50.0, >= 5.0.0, >= 5.7.0, ~> 5.7" hashes = [ - "h1:rplvK7UGP2FuzM44t2eRX+QYYPC0aUIoKdi5XayRI8M=", - "zh:0087b9dd2c9c638fd63e527e5b9b70988008e263d480a199f180efe5a4f070f0", - "zh:0fd532a4fd03ddef11f0502ff9fe4343443e1ae805cb088825a71d6d48906ec7", - "zh:16411e731100cd15f7e165f53c23be784b2c86c2fcfd34781e0642d17090d342", - "zh:251d520927e77f091e2ec6302e921d839a2430ac541c6a461aed7c08fb5eae12", - "zh:4919e69682dc2a8c32d44f6ebc038a52c9f40af9c61cb574b64e322800d6a794", - "zh:5334c60759d5f76bdc51355d1a3ebcc451d4d20f632f5c73b6e55c52b5dc9e52", - "zh:7341a2b7247572eba0d0486094a870b872967702ec0ac7af728c2df2c30af4e5", - "zh:81d1b1cb2cac6b3922a05adab69543b678f344a01debd54500263700dad7a288", - "zh:882bc8e15ef6d4020a07321ec4c056977c5c1d96934118032922561d29504d43", - "zh:8cd4871ef2b03fd916de1a6dc7eb8a81a354c421177d4334a2e3308e50215e41", - "zh:97e12fe6529b21298adf1046c5e20ac35d0569c836a6f385ff041e257e00cfd2", + "h1:xIGISViKIAzm5yJ9PZejQDDxwkVMwp1CSxINPP18Fc8=", + "zh:062171f23f3e9d09dde4bdef4e2e1be6c10ce5392e5acb2d5674ca8d18e4efe2", + "zh:081f9aa09f571a95334c13eb11f7dd9e421250e5c64b2005509638eee382ccd7", + "zh:115f73d02f240f6626e9e4b4551dab9618a713cc238e0340155b9468b16da785", + "zh:1372084815a5f2e795edc1020969401786ca9032a510e0543d1e048fd699c565", + "zh:177a2fd380bec9fcda440d028fdf13db701d054ca637cdc860b70d62d3caafcf", + "zh:18274cf43f8bb0a48da25a8f511020aa4a3052582be4e48eeff4c914c0e10a31", + "zh:2f9d8e5b5375da4528e9ae437bbf93c2be91a50f814ca61046f3b2d16aabb3cb", + "zh:565a4d9e124f118fef41bd2c82e9ae3ea7316821db8f3a03838f84af7db72efb", + "zh:62f9f297c0ce50720e2380bd36fa1f27a210cfac08e993b0dcdb85ecf6559e07", + "zh:8a185766ecd16752aff72260e55e3df28a3d7e4bf28e357fbf9c0460b7ed5b39", "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", - "zh:9f5baf5d59b9f3cf5504d1fa975f10f27da3791896a9e18ece47c258bac17634", - "zh:dffafba6731ac1db1c540bdbd6a8c878486b71de9d0ca1d23c5c00a6c3c14d80", - "zh:fa7440c3c15a42fc5731444d324ced75407d417bfe3184661ae47d40a9718dce", + "zh:9b698d94915a5077d1c10a705b8d449f719eb87f25f6d46ff165b6bb9fb12778", + "zh:ba2c2ad8f160d9f57eaefde2171cf35697e4912f15c5cafd0ef471d1f38531f9", + "zh:d78d25aeed4851907817f6b281598ed853a60ca65c6bd711c8539ca3f55a841f", + "zh:f743437743605727edcc77c02e3a60358c222311f7a3015e883601e4e4844c1e", ] } diff --git a/terraform/monitoring/panels/app/identity/invalid_register_cacao.libsonnet b/terraform/monitoring/panels/app/identity/invalid_register_cacao.libsonnet index 138d0ae..0a30074 100644 --- a/terraform/monitoring/panels/app/identity/invalid_register_cacao.libsonnet +++ b/terraform/monitoring/panels/app/identity/invalid_register_cacao.libsonnet @@ -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') } diff --git a/terraform/monitoring/panels/app/identity/invalid_unregister_jwt.libsonnet b/terraform/monitoring/panels/app/identity/invalid_unregister_jwt.libsonnet index 06315ed..fb8d9eb 100644 --- a/terraform/monitoring/panels/app/identity/invalid_unregister_jwt.libsonnet +++ b/terraform/monitoring/panels/app/identity/invalid_unregister_jwt.libsonnet @@ -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') } diff --git a/terraform/monitoring/panels/app/identity/register.libsonnet b/terraform/monitoring/panels/app/identity/register.libsonnet index 9293337..15106ab 100644 --- a/terraform/monitoring/panels/app/identity/register.libsonnet +++ b/terraform/monitoring/panels/app/identity/register.libsonnet @@ -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') } diff --git a/terraform/monitoring/panels/app/identity/resolved.libsonnet b/terraform/monitoring/panels/app/identity/resolved.libsonnet index 8b740e2..9b3a309 100644 --- a/terraform/monitoring/panels/app/identity/resolved.libsonnet +++ b/terraform/monitoring/panels/app/identity/resolved.libsonnet @@ -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') } diff --git a/terraform/monitoring/panels/app/identity/unregister.libsonnet b/terraform/monitoring/panels/app/identity/unregister.libsonnet index 96e9dc2..94bce46 100644 --- a/terraform/monitoring/panels/app/identity/unregister.libsonnet +++ b/terraform/monitoring/panels/app/identity/unregister.libsonnet @@ -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') } diff --git a/terraform/monitoring/panels/app/invite/invalid_register_jwt.libsonnet b/terraform/monitoring/panels/app/invite/invalid_register_jwt.libsonnet index 7e0cf9b..b5fedf5 100644 --- a/terraform/monitoring/panels/app/invite/invalid_register_jwt.libsonnet +++ b/terraform/monitoring/panels/app/invite/invalid_register_jwt.libsonnet @@ -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') } diff --git a/terraform/monitoring/panels/app/invite/invalid_unregister_jwt.libsonnet b/terraform/monitoring/panels/app/invite/invalid_unregister_jwt.libsonnet index 1e30790..b7a19ce 100644 --- a/terraform/monitoring/panels/app/invite/invalid_unregister_jwt.libsonnet +++ b/terraform/monitoring/panels/app/invite/invalid_unregister_jwt.libsonnet @@ -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') } diff --git a/terraform/monitoring/panels/app/invite/register.libsonnet b/terraform/monitoring/panels/app/invite/register.libsonnet index de77ee3..04eb5ae 100644 --- a/terraform/monitoring/panels/app/invite/register.libsonnet +++ b/terraform/monitoring/panels/app/invite/register.libsonnet @@ -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') } diff --git a/terraform/monitoring/panels/app/invite/resolved.libsonnet b/terraform/monitoring/panels/app/invite/resolved.libsonnet index 1975a8b..f4ab79e 100644 --- a/terraform/monitoring/panels/app/invite/resolved.libsonnet +++ b/terraform/monitoring/panels/app/invite/resolved.libsonnet @@ -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') } diff --git a/terraform/monitoring/panels/app/invite/unregister.libsonnet b/terraform/monitoring/panels/app/invite/unregister.libsonnet index 0004413..9846bfd 100644 --- a/terraform/monitoring/panels/app/invite/unregister.libsonnet +++ b/terraform/monitoring/panels/app/invite/unregister.libsonnet @@ -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') }