metrics: Fix registering duplicate `subgraphs_get_entity_conn_secs`
By not registering this metric for `subgraphs`,
it wouldn't show up in the panel anyways.
@@ -651,6 +651,7 @@ impl Store {
fn get_entity_conn(&self, subgraph: &SubgraphDeploymentId) -> Result<e::Connection, Error> {
let start = Instant::now();
let conn = self.get_conn()?;
+ if *subgraph != *SUBGRAPHS_ID {
self.get_entity_conn_timers
.lock()
.unwrap()
@@ -666,7 +667,7 @@ impl Store {
.expect("failed to register get_conn_secs prometheus counter")
})
.inc_by(start.elapsed().as_secs_f64());
-
+ }
let storage = self.storage(&conn, subgraph)?;
let metadata = self.storage(&conn, &*SUBGRAPHS_ID)?;
Ok(e::Connection::new(conn, storage, metadata))
