review classifier: export request, verdict, check and run metrics, with a dashboard
The controller counts review requests, verdicts and per-check results and times each run; the classifier service counts retried asks. A provisioned Grafana dashboard charts them.
This commit is contained in:
parent
7680b07fcb
commit
eaf26aaadd
13 changed files with 1390 additions and 28 deletions
|
|
@ -30,7 +30,7 @@ use opentelemetry_sdk::Resource;
|
|||
use opentelemetry_sdk::metrics::{PeriodicReader, SdkMeterProvider};
|
||||
|
||||
/// Export cadence. Matches every other OTEL exporter in this tree.
|
||||
const EXPORT_INTERVAL: Duration = Duration::from_mins(1);
|
||||
pub(crate) const EXPORT_INTERVAL: Duration = Duration::from_mins(1);
|
||||
|
||||
/// One push delivery, as parsed off the webhook body — just the two fields
|
||||
/// this module needs, not a full mirror of Forgejo's push-event schema.
|
||||
|
|
@ -109,7 +109,7 @@ fn build() -> Option<Instruments> {
|
|||
}
|
||||
}
|
||||
|
||||
fn build_provider(interval: Duration) -> Result<SdkMeterProvider> {
|
||||
pub(crate) fn build_provider(interval: Duration) -> Result<SdkMeterProvider> {
|
||||
// Same http/json, endpoint-from-env-only construction as
|
||||
// `hive_jobq_metrics::build_provider` — see that module's doc comment
|
||||
// for why `with_endpoint` is deliberately never called here.
|
||||
|
|
@ -190,7 +190,7 @@ fn resource() -> Resource {
|
|||
builder.build()
|
||||
}
|
||||
|
||||
fn endpoint() -> Option<String> {
|
||||
pub(crate) fn endpoint() -> Option<String> {
|
||||
std::env::var("OTEL_EXPORTER_OTLP_ENDPOINT")
|
||||
.ok()
|
||||
.map(|s| s.trim().to_owned())
|
||||
|
|
|
|||
Loading…
Reference in a new issue