Add event_type to http metrics
@@ -28,10 +28,9 @@ impl EventApiHandler for MatcherApiHandler {
) -> Result<ProcessedEvent, ApiError> {
let timer = SystemTime::now();
-
let labels = [
EVENT_SOURCE_LABEL_KEY.string("http"),
- //EVENT_TYPE_LABEL_KEY.string(event.event.event_type.to_owned()),
+ EVENT_TYPE_LABEL_KEY.string(event.event.event_type.to_owned()),
];
let request = self
@@ -59,6 +58,10 @@ impl EventApiHandler for MatcherApiHandler {
) -> Result<ProcessedEvent, ApiError> {
let timer = SystemTime::now();
+ let labels = [
+ EVENT_SOURCE_LABEL_KEY.string("http"),
+ EVENT_TYPE_LABEL_KEY.string(event.event.event_type.to_owned()),
+ ];
let request = self
.matcher
@@ -70,10 +73,6 @@ impl EventApiHandler for MatcherApiHandler {
})
.await?;
- let labels = [
- EVENT_SOURCE_LABEL_KEY.string("http"),
- //EVENT_TYPE_LABEL_KEY.string(event.event.event_type.to_owned()),
- ];
self.meter.events_received_counter.add(1, &labels);
self.meter.http_requests_counter.add(1, &[]);
self.meter.http_requests_duration_seconds.record(
