Skip to content

Commit

Permalink
Merge pull request #37 from crassirostris/fix-event-exporter-metrics
Browse files Browse the repository at this point in the history
[event-exporter] Remove host from the metric labels
  • Loading branch information
Mik Vyatskov authored Sep 11, 2017
2 parents 9cd1caa + 1808c8f commit b495765
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion event-exporter/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ BINARY_NAME = event-exporter

PREFIX = gcr.io/google-containers
IMAGE_NAME = event-exporter
TAG = v0.1.6
TAG = v0.1.7

build:
${ENVVAR} godep go build -a -o ${BINARY_NAME}
Expand Down
6 changes: 3 additions & 3 deletions event-exporter/sinks/stackdriver/sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var (
Help: "Number of entries, recieved by the Stackdriver sink",
Subsystem: "stackdriver_sink",
},
[]string{"component", "host"},
[]string{"component"},
)

successfullySentEntryCount = prometheus.NewCounter(
Expand Down Expand Up @@ -83,7 +83,7 @@ func newSdSink(writer sdWriter, clock clock.Clock, config *sdSinkConfig) *sdSink
}

func (s *sdSink) OnAdd(event *api_v1.Event) {
receivedEntryCount.WithLabelValues(event.Source.Component, event.Source.Host).Inc()
receivedEntryCount.WithLabelValues(event.Source.Component).Inc()

logEntry := s.logEntryFactory.FromEvent(event)
s.logEntryChannel <- logEntry
Expand All @@ -105,7 +105,7 @@ func (s *sdSink) OnUpdate(oldEvent *api_v1.Event, newEvent *api_v1.Event) {
"\tOld event: %+v\n\tNew event: %+v", newEvent.Count-oldCount, oldEvent, newEvent)
}

receivedEntryCount.WithLabelValues(newEvent.Source.Component, newEvent.Source.Host).Inc()
receivedEntryCount.WithLabelValues(newEvent.Source.Component).Inc()

logEntry := s.logEntryFactory.FromEvent(newEvent)
s.logEntryChannel <- logEntry
Expand Down

0 comments on commit b495765

Please sign in to comment.