From 4a644780b658336f8a1312b96f566b7a4be8c6b2 Mon Sep 17 00:00:00 2001 From: githubsands Date: Wed, 20 Mar 2019 10:23:10 -0600 Subject: [PATCH] caduceus: change event_type to event --- src/caduceus/metrics.go | 2 +- src/caduceus/senderWrapper.go | 2 +- src/caduceus/senderWrapper_test.go | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/caduceus/metrics.go b/src/caduceus/metrics.go index 24568f4f..70bea8d5 100644 --- a/src/caduceus/metrics.go +++ b/src/caduceus/metrics.go @@ -80,7 +80,7 @@ func Metrics() []xmetrics.Metric { Name: IncomingEventTypeCounter, Help: "Incoming count of events by event type", Type: "counter", - LabelNames: []string{"event_type"}, + LabelNames: []string{"event"}, }, } } diff --git a/src/caduceus/senderWrapper.go b/src/caduceus/senderWrapper.go index ac4456f9..a8035114 100644 --- a/src/caduceus/senderWrapper.go +++ b/src/caduceus/senderWrapper.go @@ -168,7 +168,7 @@ func (sw *CaduceusSenderWrapper) Update(list []webhook.W) { func (sw *CaduceusSenderWrapper) Queue(msg *wrp.Message) { sw.mutex.RLock() - sw.eventType.With("event_type", msg.FindEventStringSubMatch()) + sw.eventType.With("event", msg.FindEventStringSubMatch()) for _, v := range sw.senders { v.Queue(msg) diff --git a/src/caduceus/senderWrapper_test.go b/src/caduceus/senderWrapper_test.go index e4739b1a..c29cac84 100644 --- a/src/caduceus/senderWrapper_test.go +++ b/src/caduceus/senderWrapper_test.go @@ -98,10 +98,10 @@ func getFakeFactory() *SenderWrapperFactory { On("With", []string{"url", "http://localhost:9999/foo", "reason", "invalid_config"}).Return(fakeIgnore). On("With", []string{"url", "http://localhost:8888/foo", "code", "200", "event", "unknown"}).Return(fakeIgnore). On("With", []string{"url", "http://localhost:9999/foo", "code", "200", "event", "unknown"}).Return(fakeIgnore). - On("With", []string{"event_type", "iot"}).Return(fakeIgnore). - On("With", []string{"event_type", "test/extra-stuff"}).Return(fakeIgnore). - On("With", []string{"event_type", "bob/magic/dog"}).Return(fakeIgnore). - On("With", []string{"event_type", "unknown"}).Return(fakeIgnore) + On("With", []string{"event", "iot"}).Return(fakeIgnore). + On("With", []string{"event", "test/extra-stuff"}).Return(fakeIgnore). + On("With", []string{"event", "bob/magic/dog"}).Return(fakeIgnore). + On("With", []string{"event", "unknown"}).Return(fakeIgnore) fakeRegistry := new(mockCaduceusMetricsRegistry) fakeRegistry.On("NewCounter", DropsDueToInvalidPayload).Return(fakeDDTIP)