mirror of
https://github.com/prometheus/statsd_exporter.git
synced 2024-06-03 05:49:25 +00:00
filter empty metric name
Signed-off-by: royeo <ljn6176@gmail.com>
This commit is contained in:
parent
ef6627b9f0
commit
3b062c01c8
|
@ -76,6 +76,11 @@ func (b *Exporter) Listen(e <-chan event.Events) {
|
|||
|
||||
// handleEvent processes a single Event according to the configured mapping.
|
||||
func (b *Exporter) handleEvent(thisEvent event.Event) {
|
||||
if thisEvent.MetricName() == "" {
|
||||
level.Error(b.Logger).Log("msg", "metric name cannot be empty")
|
||||
return
|
||||
}
|
||||
|
||||
mapping, labels, present := b.Mapper.GetMapping(thisEvent.MetricName(), thisEvent.MetricType())
|
||||
if mapping == nil {
|
||||
mapping = &mapper.MetricMapping{}
|
||||
|
|
Loading…
Reference in a new issue