github.com/cilium/cilium@v1.16.2/pkg/hubble/metrics/kafka/plugin.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright Authors of Hubble
     3  
     4  package kafka
     5  
     6  import (
     7  	"github.com/cilium/cilium/pkg/hubble/metrics/api"
     8  )
     9  
    10  type kafkaPlugin struct{}
    11  
    12  func (p *kafkaPlugin) NewHandler() api.Handler {
    13  	return &kafkaHandler{}
    14  }
    15  
    16  func (p *kafkaPlugin) HelpText() string {
    17  	return `kafka - Kafka metrics
    18  Metrics related to the Kafka protocol
    19  
    20  Metrics:
    21    kafka_requests_total           - Count of Kafka requests by topic and ApiKey.
    22    kafka_request_duration_seconds - Histogram of Kafka request duration by topic and ApiKey.
    23  
    24  Options:` +
    25  		api.ContextOptionsHelp
    26  }
    27  
    28  func init() {
    29  	api.DefaultRegistry().Register("kafka", &kafkaPlugin{})
    30  }