From 7bf6b0358340548a917cbca473f1e71fc5dde231 Mon Sep 17 00:00:00 2001 From: Jan Michael Auer Date: Wed, 4 Aug 2021 10:00:35 +0200 Subject: [PATCH] ref: Remove metrics for internal project ids (#1054) --- relay-config/src/config.rs | 11 +---------- relay-server/src/actors/store.rs | 13 ------------- relay-server/src/endpoints/common.rs | 18 ++---------------- relay-server/src/metrics.rs | 9 --------- 4 files changed, 3 insertions(+), 48 deletions(-) diff --git a/relay-config/src/config.rs b/relay-config/src/config.rs index 60d37ec294..5037dc309f 100644 --- a/relay-config/src/config.rs +++ b/relay-config/src/config.rs @@ -12,7 +12,7 @@ use failure::{Backtrace, Context, Fail}; use serde::{de::DeserializeOwned, Deserialize, Deserializer, Serialize, Serializer}; use relay_auth::{generate_key_pair, generate_relay_id, PublicKey, RelayId, SecretKey}; -use relay_common::{ProjectId, Uuid}; +use relay_common::Uuid; use relay_metrics::AggregatorConfig; use relay_redis::RedisConfig; @@ -771,9 +771,6 @@ pub struct Processing { /// Maximum rate limit to report to clients. #[serde(default = "default_max_rate_limit")] pub max_rate_limit: Option, - /// Projects for which to emit extra (high-noise) metrics. - #[serde(default)] - pub _internal_projects: Vec, } impl Default for Processing { @@ -791,7 +788,6 @@ impl Default for Processing { attachment_chunk_size: default_chunk_size(), projectconfig_cache_prefix: default_projectconfig_cache_prefix(), max_rate_limit: default_max_rate_limit(), - _internal_projects: Vec::new(), } } } @@ -1507,11 +1503,6 @@ impl Config { self.values.processing.enabled } - /// Set of internal project IDs for which to emit extra metrics. - pub fn processing_internal_projects(&self) -> &[ProjectId] { - &self.values.processing._internal_projects - } - /// The path to the GeoIp database required for event processing. pub fn geoip_path(&self) -> Option<&Path> { self.values.processing.geoip_path.as_deref() diff --git a/relay-server/src/actors/store.rs b/relay-server/src/actors/store.rs index 64675cc49e..d830621949 100644 --- a/relay-server/src/actors/store.rs +++ b/relay-server/src/actors/store.rs @@ -659,19 +659,6 @@ impl Handler for StoreForwarder { attachments, }); - #[cfg(feature = "processing")] - if self - .config - .processing_internal_projects() - .contains(&scoping.project_id) - { - metric!( - counter(RelayCounters::InternalCapturedEventStoreActor) += 1, - event_item_type = &event_item.ty().to_string(), - project = &scoping.project_id.value().to_string(), - ); - } - self.produce(topic, event_message)?; metric!( counter(RelayCounters::ProcessingMessageProduced) += 1, diff --git a/relay-server/src/endpoints/common.rs b/relay-server/src/endpoints/common.rs index 3a1c7e07ed..b4ed653558 100644 --- a/relay-server/src/endpoints/common.rs +++ b/relay-server/src/endpoints/common.rs @@ -11,7 +11,7 @@ use failure::Fail; use futures::prelude::*; use serde::Deserialize; -use relay_common::{clone, metric, tryf, DataCategory, ProjectId}; +use relay_common::{clone, metric, tryf}; use relay_config::Config; use relay_general::protocol::{EventId, EventType}; use relay_log::LogError; @@ -28,9 +28,7 @@ use crate::envelope::{AttachmentType, Envelope, EnvelopeError, ItemType, Items}; use crate::extractors::RequestMeta; use crate::metrics::RelayCounters; use crate::service::{ServiceApp, ServiceState}; -use crate::utils::{ - self, ApiErrorResponse, EnvelopeSummary, FormDataIter, MultipartError, SendWithOutcome, -}; +use crate::utils::{self, ApiErrorResponse, FormDataIter, MultipartError, SendWithOutcome}; #[derive(Fail, Debug)] pub enum BadStoreRequest { @@ -398,26 +396,14 @@ where let project_key = meta.public_key(); let start_time = meta.start_time(); - let project_id = meta.project_id().unwrap_or_else(|| ProjectId::new(0)); - let config = request.state().config(); let processing_enabled = config.processing_enabled(); - let is_internal = config.processing_internal_projects().contains(&project_id); let envelope_context = Rc::new(RefCell::new(EnvelopeContext::from_request(&meta))); let future = extract_envelope(&request, meta) .into_future() .and_then(clone!(envelope_context, |envelope| { - let summary = EnvelopeSummary::compute(&envelope); - - if is_internal && summary.event_category == Some(DataCategory::Transaction) { - metric!( - counter(RelayCounters::InternalCapturedEventEndpoint) += 1, - project = &project_id.to_string() - ); - } - envelope_context.borrow_mut().update(&envelope); if envelope.is_empty() { // envelope is empty, cannot send outcomes diff --git a/relay-server/src/metrics.rs b/relay-server/src/metrics.rs index 2737e9d3c9..05343a5f32 100644 --- a/relay-server/src/metrics.rs +++ b/relay-server/src/metrics.rs @@ -431,12 +431,6 @@ pub enum RelayCounters { /// be used to ingest events. Once the grace period expires, the cache is evicted and new /// requests wait for an update. EvictingStaleProjectCaches, - /// An event has been produced to Kafka for one of the configured "internal" projects. - #[cfg(feature = "processing")] - InternalCapturedEventStoreActor, - /// An event has been preliminarily accepted in the store endpoint for one of the configured - /// "internal" projects. - InternalCapturedEventEndpoint, } impl CounterMetric for RelayCounters { @@ -462,9 +456,6 @@ impl CounterMetric for RelayCounters { RelayCounters::Requests => "requests", RelayCounters::ResponsesStatusCodes => "responses.status_codes", RelayCounters::EvictingStaleProjectCaches => "project_cache.eviction", - #[cfg(feature = "processing")] - RelayCounters::InternalCapturedEventStoreActor => "internal.captured.event.store_actor", - RelayCounters::InternalCapturedEventEndpoint => "internal.captured.event.endpoint", } } }