|
3 | 3 |
|
4 | 4 | use std::sync::Arc; |
5 | 5 |
|
6 | | -use crate::{error::IndexerServiceError, tap::AgoraQuery}; |
| 6 | +use crate::{error::IndexerServiceError, metrics::{FAILED_RECEIPT, HANDLER_FAILURE, HANDLER_HISTOGRAM}, tap::AgoraQuery}; |
7 | 7 | use axum::{ |
8 | 8 | extract::{Path, State}, |
9 | 9 | http::HeaderMap, |
10 | 10 | response::IntoResponse, |
11 | 11 | }; |
12 | 12 | use axum_extra::TypedHeader; |
13 | | -use lazy_static::lazy_static; |
14 | | -use prometheus::{register_counter_vec, register_histogram_vec, CounterVec, HistogramVec}; |
15 | 13 | use reqwest::StatusCode; |
16 | 14 | use serde_json::value::RawValue; |
17 | 15 | use tap_core::receipt::Context; |
18 | 16 | use thegraph_core::DeploymentId; |
19 | 17 | use tracing::trace; |
20 | 18 |
|
21 | | -use crate::service::{ |
22 | | - AttestationOutput, IndexerServiceResponse, IndexerServiceState, TapReceipt, |
23 | | -}; |
24 | | - |
25 | | -lazy_static! { |
26 | | - /// Register indexer error metrics in Prometheus registry |
27 | | - pub static ref HANDLER_HISTOGRAM: HistogramVec = register_histogram_vec!( |
28 | | - "indexer_query_handler_seconds", |
29 | | - "Histogram for default indexer query handler", |
30 | | - &["deployment", "allocation", "sender"] |
31 | | - ).unwrap(); |
32 | | - |
33 | | - pub static ref HANDLER_FAILURE: CounterVec = register_counter_vec!( |
34 | | - "indexer_query_handler_failed_total", |
35 | | - "Failed queries to handler", |
36 | | - &["deployment"] |
37 | | - ).unwrap(); |
38 | | - |
39 | | - pub static ref FAILED_RECEIPT: CounterVec = register_counter_vec!( |
40 | | - "indexer_receipt_failed_total", |
41 | | - "Failed receipt checks", |
42 | | - &["deployment", "allocation", "sender"] |
43 | | - ).unwrap(); |
44 | | - |
45 | | -} |
| 19 | +use crate::service::{AttestationOutput, IndexerServiceResponse, IndexerServiceState, TapReceipt}; |
46 | 20 |
|
47 | 21 | pub async fn request_handler( |
48 | 22 | Path(manifest_id): Path<DeploymentId>, |
|
0 commit comments