1use std::sync::LazyLock;
2
3use opentelemetry::{InstrumentationScope, metrics::Meter};
4use opentelemetry_semantic_conventions as semcov;
5
6static SCOPE: LazyLock<InstrumentationScope> = LazyLock::new(|| {
7 InstrumentationScope::builder(env!("CARGO_PKG_NAME"))
8 .with_version(env!("CARGO_PKG_VERSION"))
9 .with_schema_url(semcov::SCHEMA_URL)
10 .build()
11});
12
13pub static METER: LazyLock<Meter> =
14 LazyLock::new(|| opentelemetry::global::meter_with_scope(SCOPE.clone()));
15
16pub const K_ENTITY: &str = "entity";
18
19pub const V_ENTITY_USERS: &str = "users";
21pub const V_ENTITY_DEVICES: &str = "devices";
23pub const V_ENTITY_THREEPIDS: &str = "threepids";
25pub const V_ENTITY_EXTERNAL_IDS: &str = "external_ids";
27pub const V_ENTITY_NONREFRESHABLE_ACCESS_TOKENS: &str = "nonrefreshable_access_tokens";
30pub const V_ENTITY_REFRESHABLE_TOKEN_PAIRS: &str = "refreshable_token_pairs";