Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use grafana dashboard with koperator #1068

Open
cuisongliu opened this issue Oct 15, 2023 · 2 comments
Open

How to use grafana dashboard with koperator #1068

cuisongliu opened this issue Oct 15, 2023 · 2 comments

Comments

@cuisongliu
Copy link

Problem Statement

I want to monitor kafka on grafana's dashboard. In addition to creating the corresponding serviceMonitor, how can I create the corresponding dashboard configuration? Has it been written?

Proposed Solution

How can I provide an official dashboard configuration, or do I need to write the corresponding dashboard myself?

@bartam1
Copy link
Contributor

bartam1 commented Oct 28, 2023

@bartam1
Copy link
Contributor

bartam1 commented Oct 28, 2023

monitoringConfig:
    jmxImage: "ghcr.io/banzaicloud/jmx-javaagent:0.16.1"
    pathToJar: "/jmx_prometheus_javaagent.jar"
    kafkaJMXExporterConfig: |
      lowercaseOutputName: true
      lowercaseOutputLabelNames: true
      ssl: false
      whitelistObjectNames:
      # kafka.cluster
      - kafka.cluster:type=Partition,name=UnderMinIsr,*
      - kafka.cluster:type=Partition,name=UnderReplicated,*
      # kafka.controller
      - kafka.controller:type=ControllerChannelManager,name=QueueSize,*
      - kafka.controller:type=ControllerChannelManager,name=TotalQueueSize
      - kafka.controller:type=ControllerStats,*
      - kafka.controller:type=KafkaController,*
      # kafka.log
      - kafka.log:type=Log,name=LogEndOffset,*
      - kafka.log:type=Log,name=LogStartOffset,*
      - kafka.log:type=Log,name=Size,*
      - kafka.log:type=LogManager,*
      # kafka.network
      - kafka.network:type=Processor,name=IdlePercent,*
      - kafka.network:type=RequestChannel,name=RequestQueueSize
      - kafka.network:type=RequestChannel,name=ResponseQueueSize,*
      - kafka.network:type=RequestMetrics,name=ErrorsPerSec,*
      - kafka.network:type=RequestMetrics,name=RequestsPerSec,*
      - kafka.network:type=RequestMetrics,name=LocalTimeMs,request=Produce
      - kafka.network:type=RequestMetrics,name=LocalTimeMs,request=FetchConsumer
      - kafka.network:type=RequestMetrics,name=LocalTimeMs,request=FetchFollower
      - kafka.network:type=RequestMetrics,name=RemoteTimeMs,request=Produce
      - kafka.network:type=RequestMetrics,name=RemoteTimeMs,request=FetchConsumer
      - kafka.network:type=RequestMetrics,name=RemoteTimeMs,request=FetchFollower
      - kafka.network:type=RequestMetrics,name=RequestQueueTimeMs,request=Produce
      - kafka.network:type=RequestMetrics,name=RequestQueueTimeMs,request=FetchConsumer
      - kafka.network:type=RequestMetrics,name=RequestQueueTimeMs,request=FetchFollower
      - kafka.network:type=RequestMetrics,name=ResponseQueueTimeMs,request=Produce
      - kafka.network:type=RequestMetrics,name=ResponseQueueTimeMs,request=FetchConsumer
      - kafka.network:type=RequestMetrics,name=ResponseQueueTimeMs,request=FetchFollower
      - kafka.network:type=RequestMetrics,name=ResponseSendTimeMs,request=Produce
      - kafka.network:type=RequestMetrics,name=ResponseSendTimeMs,request=FetchConsumer
      - kafka.network:type=RequestMetrics,name=ResponseSendTimeMs,request=FetchFollower
      - kafka.network:type=RequestMetrics,name=TotalTimeMs,request=Produce
      - kafka.network:type=RequestMetrics,name=TotalTimeMs,request=FetchConsumer
      - kafka.network:type=RequestMetrics,name=TotalTimeMs,request=FetchFollower
      - kafka.network:type=SocketServer,name=NetworkProcessorAvgIdlePercent
      # kafka.server
      - kafka.server:type=BrokerTopicMetrics,name=BytesInPerSec,*
      - kafka.server:type=BrokerTopicMetrics,name=BytesOutPerSec,*
      - kafka.server:type=BrokerTopicMetrics,name=FailedFetchRequestsPerSec
      - kafka.server:type=BrokerTopicMetrics,name=FailedProduceRequestsPerSec
      - kafka.server:type=BrokerTopicMetrics,name=MessagesInPerSec,*
      - kafka.server:type=BrokerTopicMetrics,name=ReassignmentBytesInPerSec
      - kafka.server:type=BrokerTopicMetrics,name=ReassignmentBytesOutPerSec
      - kafka.server:type=BrokerTopicMetrics,name=ReplicationBytesInPerSec
      - kafka.server:type=BrokerTopicMetrics,name=ReplicationBytesOutPerSec
      - kafka.server:type=BrokerTopicMetrics,name=TotalFetchRequestsPerSec,*
      - kafka.server:type=BrokerTopicMetrics,name=TotalProduceRequestsPerSec,*
      - kafka.server:type=BrokerTopicMetrics,name=FetchMessageConversionsPerSec
      - kafka.server:type=BrokerTopicMetrics,name=ProduceMessageConversionsPerSec
      - kafka.server:type=DelayedOperationPurgatory,*
      - kafka.server:type=FetcherLagMetrics,name=ConsumerLag,*
      - kafka.server:type=FetcherStats,name=BytesPerSec,*
      - kafka.server:type=KafkaRequestHandlerPool,*
      - kafka.server:type=KafkaServer,name=BrokerState
      - kafka.server:type=Fetch
      - kafka.server:type=Produce
      - kafka.server:type=Request
      - kafka.server:type=app-info,*
      - kafka.server:type=ReplicaFetcherManager,*
      - kafka.server:type=ReplicaManager,*
      - kafka.server:type=SessionExpireListener,*
      - kafka.server:type=ZooKeeperClientMetrics,name=ZooKeeperRequestLatencyMs
      - kafka.server:type=socket-server-metrics,listener=*,*
      # java
      - java.lang:type=*
      - java.nio:*
      rules:
      # kafka.cluster
      - pattern: kafka.cluster<type=(Partition), name=(UnderMinIsr|UnderReplicated), topic=([-.\w]+), partition=(\d+)><>(Value)
        name: kafka_controller_$1_$2_$5
        type: GAUGE
        labels:
          topic: $3
          partition: $4
        cache: true
      # kafka.controller
      - pattern: kafka.controller<type=(ControllerChannelManager), name=(QueueSize), broker-id=(\d+)><>(Value)
        name: kafka_controller_$1_$2_$4
        type: GAUGE
        labels:
          broker_id: $3
        cache: true
      - pattern: kafka.controller<type=(ControllerChannelManager), name=(TotalQueueSize)><>(Value)
        name: kafka_controller_$1_$2_$3
        type: GAUGE
        cache: true
      - pattern: kafka.controller<type=(ControllerStats), name=([-.\w]+)><>(Count)
        name: kafka_controller_$1_$2_$3
        type: COUNTER
        cache: true
      - pattern: kafka.controller<type=(KafkaController), name=([-.\w]+)><>(Value)
        name: kafka_controller_$1_$2_$3
        type: GAUGE
        cache: true
      # kafka.log
      - pattern: kafka.log<type=Log, name=(LogEndOffset|LogStartOffset|Size), topic=([-.\w]+), partition=(\d+)><>(Value)
        name: kafka_log_$1_$4
        type: GAUGE
        labels:
          topic: $2
          partition: $3
        cache: true
      - pattern: kafka.log<type=(LogManager), name=(LogDirectoryOffline), logDirectory="(.+)"><>(Value)
        name: kafka_log_$1_$2_$4
        labels:
          log_directory: $3
        type: GAUGE
        cache: true
      - pattern: kafka.log<type=(LogManager), name=(OfflineLogDirectoryCount)><>(Value)
        name: kafka_log_$1_$2_$3
        type: GAUGE
        cache: true
      # kafka.network
      - pattern : kafka.network<type=(Processor), name=(IdlePercent), networkProcessor=(\d+)><>(Value)
        name: kafka_network_$1_$2_$4
        labels:
          network_processor: $3
        type: GAUGE
        cache: true
      - pattern: kafka.network<type=(RequestChannel), name=(RequestQueueSize)><>(Value)
        name: kafka_network_$1_$2_$3
        type: GAUGE
        cache: true
      - pattern : kafka.network<type=(RequestChannel), name=(ResponseQueueSize), processor=(\d+)><>(Value)
        name: kafka_network_$1_$2_$4
        type: GAUGE
        labels:
          processor: $3
        cache: true
      - pattern : kafka.network<type=(RequestMetrics), name=(ErrorsPerSec), request=(\w+), error=(\w+)><>(Count)
        name: kafka_network_$1_$2_$5
        type: COUNTER
        labels:
          request: $3
          error: $4
        cache: true
      - pattern : kafka.network<type=(RequestMetrics), name=(RequestsPerSec), request=(\w+), version=(\d+)><>(Count)
        name: kafka_network_$1_$2_$5
        type: COUNTER
        labels:
          request: $3
          version: $4
        cache: true
      - pattern : kafka.network<type=(RequestMetrics), name=(\w+TimeMs), request=(\w+)><>(Count)
        name: kafka_network_$1_$2_$4
        type: COUNTER
        labels:
          request: $3
        cache: true
      - pattern : kafka.network<type=(SocketServer), name=(NetworkProcessorAvgIdlePercent)><>(Value)
        name: kafka_network_$1_$2_$3
        type: GAUGE
        cache: true
      # kafka.server
      - pattern: kafka.server<type=(BrokerTopicMetrics), name=(\w+PerSec), topic=([-.\w]+)><>(Count)
        name: kafka_server_$1_$2_$4
        type: COUNTER
        labels:
          topic: $3
        cache: true
      - pattern: kafka.server<type=(BrokerTopicMetrics), name=(\w+PerSec)><>(Count)
        name: kafka_server_$1_$2_total_$3
        type: COUNTER
        cache: true
      - pattern: kafka.server<type=(DelayedOperationPurgatory), name=(\w+), delayedOperation=(\w+)><>(Value)
        name: kafka_server_$1_$2_$4
        type: GAUGE
        labels:
          delayed_operation: $3
        cache: true
      - pattern: kafka.server<type=(FetcherLagMetrics), name=(ConsumerLag), clientId=([-.\w]+), topic=([-.\w]+), partition=(\d+)><>(Value)
        name: kafka_server_$1_$2_$6
        type: GAUGE
        labels:
          client_id: $3
          topic: $4
          partition: $5
        cache: true
      - pattern: kafka.server<type=(FetcherStats), name=(\w+PerSec), clientId=([-.\w]+), brokerHost=([-.\w]+), brokerPort=(\d+)><>(Count)
        name: kafka_server_$1_$2_$6
        type: COUNTER
        labels:
          client_id: $3
          broker_host: $4
          broker_port: $5
        cache: true
      - pattern: kafka.server<type=(KafkaRequestHandlerPool), name=(\w+)><>(Count)
        name: kafka_server_$1_$2_$3
        type: COUNTER
        cache: true
      - pattern: kafka.server<type=(KafkaRequestHandlerPool), name=(\w+)><>(OneMinuteRate)
        name: kafka_server_$1_$2_$3
        type: GAUGE
        cache: true
      - pattern: kafka.server<type=(KafkaServer), name=(\w+)><>(Value)
        name: kafka_server_$1_$2_$3
        type: GAUGE
        cache: true
      - pattern: kafka.server<type=(Fetch|Produce|Request)><>(queue-size)
        name: kafka_server_$1_$2
        type: GAUGE
        cache: true
      - pattern: kafka.server<type=(app-info), id=(\d+)><>(StartTimeMs)
        name: kafka_server_$1_$3
        type: COUNTER
        labels:
          broker_id: $2
        cache: true
      - pattern: 'kafka.server<type=(app-info), id=(\d+)><>(Version): ([-.~+\w\d]+)'
        name: kafka_server_$1_$3
        type: COUNTER
        labels:
          broker_id: $2
          version: $4
        value: 1.0
        cache: false
      - pattern: kafka.server<type=(ReplicaFetcherManager), name=(\w+), clientId=([-.\w]+)><>(Value)
        name: kafka_server_$1_$2_$4
        type: GAUGE
        labels:
          client_id: $3
        cache: true
      - pattern: kafka.server<type=(ReplicaManager), name=(\w+)><>(Value)
        name: kafka_server_$1_$2_$3
        cache: true
      - pattern: kafka.server<type=(ReplicaManager), name=(\w+)><>(Count)
        name: kafka_server_$1_$2_$3
        type: COUNTER
        cache: true
      - pattern: kafka.server<type=(SessionExpireListener), name=(\w+)><>(Value)
        name: kafka_server_$1_$2_$3
        type: GAUGE
        cache: true
      - pattern: kafka.server<type=(SessionExpireListener), name=(\w+)><>(Count)
        name: kafka_server_$1_$2_$3
        type: COUNTER
        cache: true
      - pattern: kafka.server<type=(ZooKeeperClientMetrics), name=(\w+)><>(\d+)thPercentile
        name: kafka_server_$1_$2
        type: GAUGE
        labels:
          quantile: 0.$3
        cache: true
      - pattern: kafka.server<type=(ZooKeeperClientMetrics), name=(\w+)><>(Mean|Max|StdDev)
        name: kafka_server_$1_$2_$3
        type: GAUGE
        cache: true
      - pattern: kafka.server<type=(socket-server-metrics), listener=([-.\w]+), networkProcessor=(\d+)><>([-\w]+(?:-count|-rate))
        name: kafka_server_$1_$4
        type: GAUGE
        labels:
          listener: $2
          network_processor: $3
        cache: true
      # Export all other java.{lang,nio}* beans using default format
      - pattern: java.lang.+
        cache: true
      - pattern: java.nio.+
        cache: true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants