├── doc └── dashboard.png ├── renovate.json ├── CONTRIBUTING.md ├── charts └── kafka-config-metrics │ ├── templates │ ├── configmap.yaml │ ├── config │ │ ├── customconfig.toml.tpl │ │ └── kcm.yaml.tpl │ ├── serviceaccount.yaml │ ├── service.yaml │ ├── _helpers.tpl │ └── deployment.yaml │ ├── Chart.yaml │ ├── .helmignore │ └── values.yaml ├── .gitignore ├── Dockerfile ├── log.go ├── Makefile ├── .goreleaser.yaml ├── .github └── workflows │ ├── gh-release.yml │ ├── helm-release.yml │ ├── binary-release.yml │ └── release.yml ├── kcm.yaml ├── pkg ├── config │ ├── types.go │ └── config.go ├── metrics │ └── collector.go └── kafka │ └── client.go ├── go.mod ├── main.go ├── README.md ├── LICENSE ├── LICENSE.md └── go.sum /doc/dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EladLeev/kafka-config-metrics/HEAD/doc/dashboard.png -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:base" 5 | ], 6 | "postUpdateOptions": [ 7 | "gomodTidy" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | * This project is trying to stand in the Prometheus community [best practices](https://prometheus.io/docs/instrumenting/writing_exporters/). 3 | * Squash your commits. 4 | * _"If you like it, then you shoulda put a TEST on it."_ - Beyoncé -------------------------------------------------------------------------------- /charts/kafka-config-metrics/templates/configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: {{ include "kafka-config-metrics.fullname" . }}-cm 5 | labels: 6 | {{- include "kafka-config-metrics.labels" . | nindent 4 }} 7 | data: 8 | kcm.yaml: | 9 | {{- include "config/kcm.yaml.tpl" . | nindent 4 }} -------------------------------------------------------------------------------- /charts/kafka-config-metrics/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: kafka-config-metrics 3 | description: Kafka Configs Metrics Exporter for Prometheus 4 | version: 1.0.3 5 | appVersion: v2.1.0 6 | maintainers: 7 | - name: Elad Leev 8 | url: https://leevs.dev/ 9 | keywords: 10 | - kafka 11 | - prometheus 12 | - kafka-config 13 | - observability -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, built with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | # Dependency directories (remove the comment below to include it) 15 | # vendor/ 16 | 17 | .idea/ 18 | dist -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:alpine AS builder 2 | ADD . /kafka-config-metrics 3 | WORKDIR /kafka-config-metrics 4 | RUN apk add git 5 | RUN go build -o kcm-exporter . && cp kcm-exporter /kcm-exporter 6 | 7 | FROM golang:alpine 8 | COPY --from=builder /kcm-exporter /usr/bin/kcm-exporter 9 | RUN mkdir /opt/kcm 10 | COPY kcm.yaml /opt/kcm/kcm.toml 11 | LABEL maintainer="eladleev@gmail.com" 12 | 13 | EXPOSE 9899 14 | CMD ["/usr/bin/kcm-exporter"] -------------------------------------------------------------------------------- /charts/kafka-config-metrics/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /log.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/sirupsen/logrus" 5 | 6 | "github.com/EladLeev/kafka-config-metrics/pkg/config" 7 | ) 8 | 9 | func initLogger(cfg config.LogConfig) { 10 | if cfg.Level == "debug" { 11 | logrus.SetLevel(logrus.DebugLevel) 12 | logrus.SetReportCaller(true) 13 | } 14 | 15 | if cfg.Format == "json" { 16 | logrus.SetFormatter(&logrus.JSONFormatter{}) 17 | } else { 18 | logrus.SetFormatter(&logrus.TextFormatter{ 19 | FullTimestamp: true, 20 | }) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | SHELL := /bin/bash 2 | export GOBIN := $(CWD)/.bin 3 | NAME=kafka-config-metrics 4 | 5 | build: 6 | GOARCH=amd64 GOOS=darwin go build -o ${NAME}-darwin main.go 7 | GOARCH=amd64 GOOS=linux go build -o ${NAME}-linux main.go 8 | 9 | clean: 10 | go clean 11 | rm ${NAME}-darwin 12 | rm ${NAME}-linux 13 | 14 | test: 15 | go test -v ./... 16 | 17 | test_coverage: 18 | go test -v ./... -coverprofile=coverage.out 19 | 20 | dep: 21 | go mod download 22 | 23 | tidy: 24 | go mod tidy 25 | 26 | vet: 27 | go vet 28 | -------------------------------------------------------------------------------- /charts/kafka-config-metrics/templates/config/customconfig.toml.tpl: -------------------------------------------------------------------------------- 1 | {{ define "config/customconfig.toml.tpl" }} 2 | # Helm Generated Config 3 | 4 | [global] 5 | port = ":{{ .Values.service.port }}" 6 | 7 | [log] 8 | level = "{{ .Values.kcmConfig.log_level }}" 9 | 10 | [kafka] 11 | default_refresh_rate = {{ .Values.kcmConfig.default_refresh_rate }} 12 | min_kafka_version = "{{ .Values.kcmConfig.min_kafka_version }}" 13 | admin_timeout = {{ .Values.kcmConfig.admin_timeout }} 14 | 15 | [clusters] 16 | {{- range $k, $v := .Values.kcmConfig.clusters }} 17 | [clusters.{{ $k }}] 18 | brokers = ["{{ $v.brokers }}"] 19 | topicfilter="{{ $v.topicfilter }}" 20 | {{ end }} 21 | {{ end }} -------------------------------------------------------------------------------- /charts/kafka-config-metrics/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.serviceAccount.create -}} 2 | {{- $commonLabels := .Values.commonLabels | default dict -}} 3 | {{- $serviceAccountLabels := .Values.serviceAccount.labels | default dict -}} 4 | apiVersion: v1 5 | kind: ServiceAccount 6 | metadata: 7 | name: {{ include "kafka-config-metrics.serviceAccountName" . }} 8 | labels: 9 | {{- include "kafka-config-metrics.labels" . | nindent 4 }} 10 | {{- if or $commonLabels $serviceAccountLabels }} 11 | {{- toYaml (merge $commonLabels $serviceAccountLabels) | nindent 4 | trimSuffix "\n" }} 12 | {{- end }} 13 | {{- with .Values.serviceAccount.annotations }} 14 | annotations: 15 | {{- toYaml . | nindent 4 }} 16 | {{- end }} 17 | {{- end }} -------------------------------------------------------------------------------- /.goreleaser.yaml: -------------------------------------------------------------------------------- 1 | before: 2 | hooks: 3 | - go mod tidy 4 | builds: 5 | - env: 6 | - CGO_ENABLED=0 7 | goos: 8 | - linux 9 | - windows 10 | - darwin 11 | archives: 12 | - format: tar.gz 13 | name_template: >- 14 | {{ .ProjectName }}_ 15 | {{- title .Os }}_ 16 | {{- if eq .Arch "amd64" }}x86_64 17 | {{- else if eq .Arch "386" }}i386 18 | {{- else }}{{ .Arch }}{{ end }} 19 | {{- if .Arm }}v{{ .Arm }}{{ end }} 20 | format_overrides: 21 | - goos: windows 22 | format: zip 23 | checksum: 24 | name_template: 'checksums.txt' 25 | snapshot: 26 | name_template: "{{ incpatch .Version }}-next" 27 | changelog: 28 | sort: asc 29 | filters: 30 | exclude: 31 | - '^docs:' 32 | - '^test:' -------------------------------------------------------------------------------- /charts/kafka-config-metrics/templates/service.yaml: -------------------------------------------------------------------------------- 1 | {{- $commonLabels := .Values.commonLabels | default dict -}} 2 | {{- $serviceLabels := .Values.service.labels | default dict -}} 3 | apiVersion: v1 4 | kind: Service 5 | metadata: 6 | name: {{ include "kafka-config-metrics.fullname" . }} 7 | labels: 8 | {{- include "kafka-config-metrics.labels" . | nindent 4 }} 9 | {{- if or $commonLabels $serviceLabels }} 10 | {{- toYaml (merge $commonLabels $serviceLabels) | nindent 4 | trimSuffix "\n" }} 11 | {{- end }} 12 | spec: 13 | type: {{ .Values.service.type }} 14 | ports: 15 | - port: {{ .Values.service.port }} 16 | targetPort: http 17 | protocol: TCP 18 | name: http 19 | selector: 20 | {{- include "kafka-config-metrics.selectorLabels" . | nindent 4 }} -------------------------------------------------------------------------------- /.github/workflows/gh-release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | push: 5 | tags: 6 | - 'v[0-9]+.[0-9]+.[0-9]+' 7 | 8 | jobs: 9 | goreleaser: 10 | runs-on: ubuntu-latest 11 | permissions: 12 | contents: write 13 | steps: 14 | - 15 | name: Checkout 16 | uses: actions/checkout@v5 17 | with: 18 | fetch-depth: 0 19 | - 20 | name: Set up Go 21 | uses: actions/setup-go@v6 22 | with: 23 | go-version: ">=1.23.0" 24 | - 25 | name: Run GoReleaser 26 | uses: goreleaser/goreleaser-action@v6 27 | with: 28 | distribution: goreleaser 29 | version: latest 30 | args: release --clean 31 | env: 32 | GITHUB_TOKEN: ${{ github.token }} 33 | -------------------------------------------------------------------------------- /kcm.yaml: -------------------------------------------------------------------------------- 1 | # Sample Config File 2 | global: 3 | port: ":9899" 4 | timeout: 3 5 | 6 | log: 7 | level: "info" 8 | # format: "json" 9 | 10 | kafka: 11 | defaultRefreshRate: 60 12 | # As the `describeConfigs` operation is supported by brokers with version 0.11.0.0 or higher: 13 | # https://kafka.apache.org/23/javadoc/index.html?org/apache/kafka/clients/admin/AdminClient.html 14 | minKafkaVersion: "0.11.0.0" 15 | adminTimeout: 30 # default: 5 16 | 17 | clusters: 18 | prod_cluster: 19 | brokers: 20 | - "localhost:9092" 21 | tls: 22 | enabled: true 23 | caCert: "/path/to/ca.pem" 24 | clientCert: "/path/to/client-cert.pem" 25 | clientKey: "/path/to/client-key.pem" 26 | sasl: 27 | enabled: true 28 | usernameEnv: "KAFKA_PROD_USERNAME" 29 | passwordEnv: "KAFKA_PROD_PASSWORD" 30 | mechanism: "PLAIN" 31 | 32 | secure_cluster: 33 | brokers: 34 | - "kafka-secure:9093" 35 | topicFilter: "^(internal-|system-).*$" 36 | tls: 37 | enabled: true 38 | caCert: "/path/to/ca.pem" 39 | sasl: 40 | enabled: true 41 | usernameEnv: "KAFKA_SECURE_USERNAME" 42 | passwordEnv: "KAFKA_SECURE_PASSWORD" 43 | mechanism: "SCRAM-SHA-512" -------------------------------------------------------------------------------- /.github/workflows/helm-release.yml: -------------------------------------------------------------------------------- 1 | name: Release KCM Helm Chart 2 | on: 3 | push: 4 | paths: 5 | - 'charts/**' 6 | 7 | jobs: 8 | helm-check: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@master 12 | - name: helm-check 13 | uses: igabaydulin/helm-check-action@0.2.1 14 | env: 15 | CHART_LOCATION: ./charts/kafka-config-metrics 16 | CHART_VALUES: ./charts/kafka-config-metrics/values.yaml 17 | release: 18 | needs: helm-check 19 | if: github.ref == 'refs/heads/master' 20 | permissions: 21 | contents: write 22 | runs-on: ubuntu-latest 23 | steps: 24 | - name: Checkout 25 | uses: actions/checkout@v5 26 | with: 27 | fetch-depth: 0 28 | 29 | - name: Configure Git 30 | run: | 31 | git config user.name "$GITHUB_ACTOR" 32 | git config user.email "$GITHUB_ACTOR@users.noreply.github.com" 33 | 34 | - name: Install Helm 35 | uses: azure/setup-helm@v4 36 | 37 | - name: Run chart-releaser 38 | uses: helm/chart-releaser-action@v1.7.0 39 | with: 40 | charts_dir: charts 41 | env: 42 | CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" 43 | -------------------------------------------------------------------------------- /.github/workflows/binary-release.yml: -------------------------------------------------------------------------------- 1 | name: Upload Binary 2 | 3 | on: 4 | release: 5 | types: [created] 6 | 7 | jobs: 8 | build-and-upload: 9 | runs-on: ubuntu-latest 10 | strategy: 11 | matrix: 12 | goos: [linux, darwin, windows] 13 | goarch: [amd64, arm64] 14 | exclude: 15 | - goos: windows 16 | goarch: arm64 17 | 18 | steps: 19 | - name: Checkout code 20 | uses: actions/checkout@v5 21 | 22 | - name: Set up Go 23 | uses: actions/setup-go@v6 24 | with: 25 | go-version: '1.24.x' 26 | cache: true 27 | 28 | - name: Build binary 29 | id: build 30 | run: | 31 | VERSION=${GITHUB_REF#refs/tags/} 32 | if [[ "${{ matrix.goos }}" == "windows" ]]; then 33 | BINARY_NAME=kcm_${VERSION}_${{ matrix.goos }}_${{ matrix.goarch }}.exe 34 | else 35 | BINARY_NAME=kcm_${VERSION}_${{ matrix.goos }}_${{ matrix.goarch }} 36 | fi 37 | 38 | # Build the binary 39 | GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -ldflags="-X 'main.Version=$VERSION'" -o $BINARY_NAME . 40 | 41 | # Create checksum 42 | sha256sum $BINARY_NAME > $BINARY_NAME.sha256 43 | 44 | - name: Release 45 | uses: softprops/action-gh-release@v2 46 | with: 47 | files: | 48 | kcm_* 49 | tag_name: ${{ github.ref_name }} 50 | token: ${{ secrets.GITHUB_TOKEN }} 51 | generate_release_notes: true 52 | -------------------------------------------------------------------------------- /charts/kafka-config-metrics/templates/config/kcm.yaml.tpl: -------------------------------------------------------------------------------- 1 | {{- define "config/kcm.yaml.tpl" }} 2 | global: 3 | port: ":{{ .Values.service.port }}" 4 | timeout: {{ .Values.kcmConfig.global.timeout }} 5 | 6 | log: 7 | format: "{{ .Values.kcmConfig.log.format }}" 8 | level: "{{ .Values.kcmConfig.log.level }}" 9 | 10 | kafka: 11 | defaultRefreshRate: {{ .Values.kcmConfig.kafka.defaultRefreshRate }} 12 | minKafkaVersion: "{{ .Values.kcmConfig.kafka.minKafkaVersion }}" 13 | adminTimeout: {{ .Values.kcmConfig.kafka.adminTimeout }} 14 | 15 | clusters: 16 | {{- range $name, $cluster := .Values.kcmConfig.clusters }} 17 | {{ $name }}: 18 | brokers: 19 | {{- range $broker := $cluster.brokers }} 20 | - {{ $broker | quote }} 21 | {{- end }} 22 | topicFilter: {{ $cluster.topicFilter | quote }} 23 | {{- if $cluster.tls }} 24 | tls: 25 | enabled: {{ $cluster.tls.enabled }} 26 | {{- if $cluster.tls.caCert }} 27 | caCert: {{ $cluster.tls.caCert | quote }} 28 | {{- end }} 29 | {{- if $cluster.tls.clientCert }} 30 | clientCert: {{ $cluster.tls.clientCert | quote }} 31 | {{- end }} 32 | {{- if $cluster.tls.clientKey }} 33 | clientKey: {{ $cluster.tls.clientKey | quote }} 34 | {{- end }} 35 | {{- end }} 36 | {{- if $cluster.sasl }} 37 | sasl: 38 | enabled: {{ $cluster.sasl.enabled }} 39 | usernameEnv: {{ $cluster.sasl.usernameEnv | quote }} 40 | passwordEnv: {{ $cluster.sasl.passwordEnv | quote }} 41 | mechanism: {{ $cluster.sasl.mechanism | quote }} 42 | {{- end }} 43 | {{- end }} 44 | {{- end }} -------------------------------------------------------------------------------- /pkg/config/types.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import "time" 4 | 5 | // Config represents the application configuration 6 | type Config struct { 7 | Global GlobalConfig `yaml:"global"` 8 | Log LogConfig `yaml:"log"` 9 | Kafka KafkaConfig `yaml:"kafka"` 10 | Clusters map[string]ClusterConfig `yaml:"clusters"` 11 | } 12 | 13 | type GlobalConfig struct { 14 | Port string `yaml:"port"` 15 | Timeout time.Duration `yaml:"timeout"` 16 | } 17 | 18 | type LogConfig struct { 19 | Format string `yaml:"format"` 20 | Level string `yaml:"level"` 21 | } 22 | 23 | type KafkaConfig struct { 24 | DefaultRefreshRate time.Duration `yaml:"defaultRefreshRate"` 25 | MinKafkaVersion string `yaml:"minKafkaVersion"` 26 | AdminTimeout time.Duration `yaml:"adminTimeout"` 27 | } 28 | 29 | type TLSConfig struct { 30 | Enabled bool `yaml:"enabled"` 31 | CACert string `yaml:"caCert"` 32 | ClientCert string `yaml:"clientCert"` 33 | ClientKey string `yaml:"clientKey"` 34 | } 35 | 36 | type SASLConfig struct { 37 | Enabled bool `yaml:"enabled"` 38 | UsernameEnv string `yaml:"usernameEnv"` 39 | PasswordEnv string `yaml:"passwordEnv"` 40 | Mechanism string `yaml:"mechanism"` 41 | } 42 | 43 | type RuntimeSASLConfig struct { 44 | Enabled bool 45 | Username string 46 | Password string 47 | Mechanism string 48 | } 49 | 50 | type ClusterConfig struct { 51 | Brokers []string `yaml:"brokers"` 52 | TopicFilter string `yaml:"topicFilter"` 53 | TLS TLSConfig `yaml:"tls"` 54 | SASL SASLConfig `yaml:"sasl"` 55 | credentials *SASLCredentials 56 | } 57 | 58 | type SASLCredentials struct { 59 | Enabled bool 60 | Username string 61 | Password string 62 | Mechanism string 63 | } 64 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release KCM 2 | on: 3 | push: 4 | branches: 5 | - master 6 | pull_request: 7 | branches: 8 | - master 9 | 10 | env: 11 | REGISTRY: ghcr.io 12 | IMAGE_NAME: ${{ github.repository }} 13 | 14 | jobs: 15 | gosec: 16 | runs-on: ubuntu-latest 17 | env: 18 | GO111MODULE: on 19 | steps: 20 | - name: Checkout Source 21 | uses: actions/checkout@v5 22 | - name: Run Gosec Security Scanner 23 | uses: securego/gosec@master 24 | with: 25 | args: ./... 26 | test: 27 | needs: gosec 28 | strategy: 29 | matrix: 30 | go-version: [1.23.x] 31 | platform: [ubuntu-latest] 32 | runs-on: ${{ matrix.platform }} 33 | steps: 34 | - name: Install Go 35 | uses: actions/setup-go@v6 36 | with: 37 | go-version: ${{ matrix.go-version }} 38 | cache: false 39 | - name: Checkout code 40 | uses: actions/checkout@v5 41 | - name: Test 42 | run: go test ./... 43 | release: 44 | needs: [gosec, test] 45 | runs-on: ubuntu-latest 46 | if: github.ref == 'refs/heads/master' 47 | steps: 48 | - name: "Build:checkout" 49 | uses: actions/checkout@v5 50 | - name: Log in to ghcr.io 51 | uses: docker/login-action@v3 52 | with: 53 | registry: ${{ env.REGISTRY }} 54 | username: ${{ github.actor }} 55 | password: ${{ secrets.GITHUB_TOKEN }} 56 | - name: Extract metadata 57 | id: meta 58 | uses: docker/metadata-action@v5 59 | with: 60 | images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} 61 | - name: Build and push Docker image 62 | uses: docker/build-push-action@v6 63 | with: 64 | context: . 65 | push: true 66 | tags: ${{ steps.meta.outputs.tags }} 67 | labels: ${{ steps.meta.outputs.labels }} 68 | -------------------------------------------------------------------------------- /charts/kafka-config-metrics/values.yaml: -------------------------------------------------------------------------------- 1 | # Default values for kafka-config-metrics 2 | replicaCount: 1 3 | 4 | image: 5 | repository: ghcr.io/eladleev/kafka-config-metrics 6 | pullPolicy: IfNotPresent 7 | tag: "" 8 | 9 | imagePullSecrets: [] 10 | nameOverride: "" 11 | fullnameOverride: "" 12 | 13 | serviceAccount: 14 | create: true 15 | annotations: {} 16 | name: "" 17 | labels: {} 18 | 19 | podAnnotations: {} 20 | podLabels: {} 21 | deploymentLabels: {} 22 | commonLabels: {} 23 | 24 | podSecurityContext: {} 25 | # fsGroup: 2000 26 | 27 | securityContext: {} 28 | # capabilities: 29 | # drop: 30 | # - ALL 31 | # readOnlyRootFilesystem: true 32 | # runAsNonRoot: true 33 | # runAsUser: 1000 34 | 35 | service: 36 | type: ClusterIP 37 | port: 9899 38 | labels: {} 39 | 40 | # Add autoscaling configuration 41 | autoscaling: 42 | enabled: false 43 | minReplicas: 1 44 | maxReplicas: 3 45 | targetCPUUtilizationPercentage: 80 46 | targetMemoryUtilizationPercentage: 80 47 | 48 | resources: 49 | limits: 50 | cpu: 200m 51 | memory: 256Mi 52 | requests: 53 | cpu: 100m 54 | memory: 128Mi 55 | 56 | nodeSelector: {} 57 | 58 | tolerations: [] 59 | 60 | affinity: {} 61 | 62 | # Application specific configuration 63 | kcmConfig: 64 | global: 65 | timeout: 3 66 | 67 | log: 68 | format: "text" 69 | level: "info" 70 | 71 | kafka: 72 | defaultRefreshRate: 60 73 | minKafkaVersion: "2.8.0" 74 | adminTimeout: 5 75 | 76 | clusters: 77 | example-cluster: 78 | brokers: 79 | - "kafka-broker-1:9092" 80 | - "kafka-broker-2:9092" 81 | topicFilter: "" 82 | tls: 83 | enabled: false 84 | # caCert: "/path/to/ca.crt" 85 | # clientCert: "/path/to/client.crt" 86 | # clientKey: "/path/to/client.key" 87 | sasl: 88 | enabled: false 89 | usernameEnv: "KAFKA_USERNAME" 90 | passwordEnv: "KAFKA_PASSWORD" 91 | mechanism: "PLAIN" -------------------------------------------------------------------------------- /pkg/config/config.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "time" 7 | 8 | "github.com/spf13/viper" 9 | ) 10 | 11 | func (c *ClusterConfig) GetCredentials() *SASLCredentials { 12 | return c.credentials 13 | } 14 | 15 | func (c *ClusterConfig) LoadSASLCredentials(clusterName string) error { 16 | if !c.SASL.Enabled { 17 | return nil 18 | } 19 | 20 | username := os.Getenv(c.SASL.UsernameEnv) 21 | if username == "" { 22 | return fmt.Errorf("environment variable %s for cluster %s SASL username not set", 23 | c.SASL.UsernameEnv, clusterName) 24 | } 25 | 26 | password := os.Getenv(c.SASL.PasswordEnv) 27 | if password == "" { 28 | return fmt.Errorf("environment variable %s for cluster %s SASL password not set", 29 | c.SASL.PasswordEnv, clusterName) 30 | } 31 | 32 | c.credentials = &SASLCredentials{ 33 | Enabled: true, 34 | Username: username, 35 | Password: password, 36 | Mechanism: c.SASL.Mechanism, 37 | } 38 | 39 | return nil 40 | } 41 | 42 | // LoadConfig loads and validates the configuration 43 | func LoadConfig(path string) (*Config, error) { 44 | v := viper.New() 45 | v.SetConfigFile(path) 46 | 47 | if err := v.ReadInConfig(); err != nil { 48 | return nil, fmt.Errorf("failed to read config file: %w", err) 49 | } 50 | 51 | var config Config 52 | if err := v.Unmarshal(&config); err != nil { 53 | return nil, fmt.Errorf("failed to unmarshal config: %w", err) 54 | } 55 | 56 | // Load credentials for each cluster 57 | for name, cluster := range config.Clusters { 58 | if err := cluster.LoadSASLCredentials(name); err != nil { 59 | return nil, err 60 | } 61 | config.Clusters[name] = cluster 62 | } 63 | 64 | // Convert seconds to duration 65 | config.Global.Timeout *= time.Second 66 | config.Kafka.AdminTimeout *= time.Second 67 | config.Kafka.DefaultRefreshRate *= time.Second 68 | 69 | // Set defaults 70 | if config.Global.Port == "" { 71 | config.Global.Port = ":9899" 72 | } 73 | if config.Global.Timeout == 0 { 74 | config.Global.Timeout = 3 * time.Second 75 | } 76 | if config.Kafka.AdminTimeout == 0 { 77 | config.Kafka.AdminTimeout = 5 * time.Second 78 | } 79 | if config.Kafka.DefaultRefreshRate == 0 { 80 | config.Kafka.DefaultRefreshRate = 60 * time.Second 81 | } 82 | 83 | return &config, nil 84 | } 85 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/EladLeev/kafka-config-metrics 2 | 3 | go 1.23.0 4 | 5 | toolchain go1.24.2 6 | 7 | require ( 8 | github.com/IBM/sarama v1.45.1 9 | github.com/prometheus/client_golang v1.23.2 10 | github.com/sirupsen/logrus v1.9.3 11 | github.com/spf13/viper v1.21.0 12 | ) 13 | 14 | require ( 15 | github.com/beorn7/perks v1.0.1 // indirect 16 | github.com/cespare/xxhash/v2 v2.3.0 // indirect 17 | github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect 18 | github.com/eapache/go-resiliency v1.7.0 // indirect 19 | github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect 20 | github.com/eapache/queue v1.1.0 // indirect 21 | github.com/fsnotify/fsnotify v1.9.0 // indirect 22 | github.com/go-viper/mapstructure/v2 v2.4.0 // indirect 23 | github.com/golang/snappy v1.0.0 // indirect 24 | github.com/hashicorp/errwrap v1.1.0 // indirect 25 | github.com/hashicorp/go-multierror v1.1.1 // indirect 26 | github.com/hashicorp/go-uuid v1.0.3 // indirect 27 | github.com/jcmturner/aescts/v2 v2.0.0 // indirect 28 | github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect 29 | github.com/jcmturner/gofork v1.7.6 // indirect 30 | github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect 31 | github.com/jcmturner/rpc/v2 v2.0.3 // indirect 32 | github.com/klauspost/compress v1.18.0 // indirect 33 | github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect 34 | github.com/pelletier/go-toml/v2 v2.2.4 // indirect 35 | github.com/pierrec/lz4/v4 v4.1.22 // indirect 36 | github.com/prometheus/client_model v0.6.2 // indirect 37 | github.com/prometheus/common v0.66.1 // indirect 38 | github.com/prometheus/procfs v0.16.1 // indirect 39 | github.com/rcrowley/go-metrics v0.0.0-20250401214520-65e299d6c5c9 // indirect 40 | github.com/sagikazarmark/locafero v0.11.0 // indirect 41 | github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect 42 | github.com/spf13/afero v1.15.0 // indirect 43 | github.com/spf13/cast v1.10.0 // indirect 44 | github.com/spf13/pflag v1.0.10 // indirect 45 | github.com/subosito/gotenv v1.6.0 // indirect 46 | go.yaml.in/yaml/v2 v2.4.2 // indirect 47 | go.yaml.in/yaml/v3 v3.0.4 // indirect 48 | golang.org/x/crypto v0.41.0 // indirect 49 | golang.org/x/net v0.43.0 // indirect 50 | golang.org/x/sys v0.35.0 // indirect 51 | golang.org/x/text v0.28.0 // indirect 52 | google.golang.org/protobuf v1.36.8 // indirect 53 | ) 54 | -------------------------------------------------------------------------------- /charts/kafka-config-metrics/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* 2 | Expand the name of the chart. 3 | */}} 4 | {{- define "kafka-config-metrics.name" -}} 5 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} 6 | {{- end }} 7 | 8 | {{/* 9 | Create a default fully qualified app name. 10 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 11 | If release name contains chart name it will be used as a full name. 12 | */}} 13 | {{- define "kafka-config-metrics.fullname" -}} 14 | {{- if .Values.fullnameOverride }} 15 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} 16 | {{- else }} 17 | {{- $name := default .Chart.Name .Values.nameOverride }} 18 | {{- if contains $name .Release.Name }} 19 | {{- .Release.Name | trunc 63 | trimSuffix "-" }} 20 | {{- else }} 21 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} 22 | {{- end }} 23 | {{- end }} 24 | {{- end }} 25 | 26 | {{/* 27 | Create chart name and version as used by the chart label. 28 | */}} 29 | {{- define "kafka-config-metrics.chart" -}} 30 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} 31 | {{- end }} 32 | 33 | {{/* 34 | Common labels 35 | */}} 36 | {{- define "kafka-config-metrics.labels" -}} 37 | helm.sh/chart: {{ include "kafka-config-metrics.chart" . }} 38 | {{ include "kafka-config-metrics.selectorLabels" . }} 39 | {{- if .Chart.AppVersion }} 40 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 41 | {{- end }} 42 | app.kubernetes.io/managed-by: {{ .Release.Service }} 43 | {{- end }} 44 | 45 | {{/* 46 | Selector labels 47 | */}} 48 | {{- define "kafka-config-metrics.selectorLabels" -}} 49 | app.kubernetes.io/name: {{ include "kafka-config-metrics.name" . }} 50 | app.kubernetes.io/instance: {{ .Release.Name }} 51 | {{- end }} 52 | 53 | {{/* 54 | Create the name of the service account to use 55 | */}} 56 | {{- define "kafka-config-metrics.serviceAccountName" -}} 57 | {{- if .Values.serviceAccount.create }} 58 | {{- default (include "kafka-config-metrics.fullname" .) .Values.serviceAccount.name }} 59 | {{- else }} 60 | {{- default "default" .Values.serviceAccount.name }} 61 | {{- end }} 62 | {{- end }} 63 | 64 | {{/* 65 | Validate configuration 66 | */}} 67 | {{- define "kafka-config-metrics.validateConfig" -}} 68 | {{- if not .Values.kcmConfig.kafka.minKafkaVersion }} 69 | {{- fail "kafka.minKafkaVersion is required" }} 70 | {{- end }} 71 | {{- if not .Values.kcmConfig.clusters }} 72 | {{- fail "At least one Kafka cluster must be configured" }} 73 | {{- end }} 74 | {{- end }} -------------------------------------------------------------------------------- /charts/kafka-config-metrics/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | {{- $commonLabels := .Values.commonLabels | default dict -}} 2 | {{- $deploymentLabels := .Values.deploymentLabels | default dict -}} 3 | {{- $podLabels := .Values.podLabels | default dict -}} 4 | apiVersion: apps/v1 5 | kind: Deployment 6 | metadata: 7 | name: {{ include "kafka-config-metrics.fullname" . }} 8 | labels: 9 | {{- include "kafka-config-metrics.labels" . | nindent 4 }} 10 | {{- if or $commonLabels $deploymentLabels }} 11 | {{- toYaml (merge $commonLabels $deploymentLabels) | nindent 4 | trimSuffix "\n" }} 12 | {{- end }} 13 | spec: 14 | {{- if not (hasKey .Values "autoscaling" | and .Values.autoscaling.enabled) }} 15 | replicas: {{ .Values.replicaCount }} 16 | {{- end }} 17 | selector: 18 | matchLabels: 19 | {{- include "kafka-config-metrics.selectorLabels" . | nindent 6 }} 20 | template: 21 | metadata: 22 | {{- with .Values.podAnnotations }} 23 | annotations: 24 | {{- toYaml . | nindent 8 }} 25 | {{- end }} 26 | labels: 27 | {{- include "kafka-config-metrics.selectorLabels" . | nindent 8 }} 28 | {{- if or $commonLabels $podLabels }} 29 | {{- toYaml (merge $commonLabels $podLabels) | nindent 8 | trimSuffix "\n" }} 30 | {{- end }} 31 | spec: 32 | {{- with .Values.imagePullSecrets }} 33 | imagePullSecrets: 34 | {{- toYaml . | nindent 8 }} 35 | {{- end }} 36 | serviceAccountName: {{ include "kafka-config-metrics.serviceAccountName" . }} 37 | securityContext: 38 | {{- toYaml .Values.podSecurityContext | nindent 8 }} 39 | containers: 40 | - name: {{ .Chart.Name }} 41 | securityContext: 42 | {{- toYaml .Values.securityContext | nindent 12 }} 43 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" 44 | imagePullPolicy: {{ .Values.image.pullPolicy }} 45 | command: [ "/usr/bin/kcm-exporter" ] 46 | args: [ "--config", "/opt/kcm/config/kcm.yaml" ] 47 | ports: 48 | - name: http 49 | containerPort: {{ .Values.service.port }} 50 | protocol: TCP 51 | livenessProbe: 52 | httpGet: 53 | path: /-/healthy 54 | port: http 55 | readinessProbe: 56 | httpGet: 57 | path: /-/ready 58 | port: http 59 | volumeMounts: 60 | - name: configmap 61 | mountPath: /opt/kcm/config 62 | resources: 63 | {{- toYaml .Values.resources | nindent 12 }} 64 | volumes: 65 | - name: configmap 66 | configMap: 67 | name: {{ include "kafka-config-metrics.fullname" . }}-cm 68 | {{- with .Values.nodeSelector }} 69 | nodeSelector: 70 | {{- toYaml . | nindent 8 }} 71 | {{- end }} 72 | {{- with .Values.affinity }} 73 | affinity: 74 | {{- toYaml . | nindent 8 }} 75 | {{- end }} 76 | {{- with .Values.tolerations }} 77 | tolerations: 78 | {{- toYaml . | nindent 8 }} 79 | {{- end }} -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "flag" 6 | "net/http" 7 | "os" 8 | "os/signal" 9 | "strconv" 10 | "syscall" 11 | "time" 12 | 13 | "github.com/EladLeev/kafka-config-metrics/pkg/config" 14 | "github.com/EladLeev/kafka-config-metrics/pkg/kafka" 15 | "github.com/EladLeev/kafka-config-metrics/pkg/metrics" 16 | 17 | "github.com/prometheus/client_golang/prometheus" 18 | "github.com/prometheus/client_golang/prometheus/promhttp" 19 | "github.com/sirupsen/logrus" 20 | ) 21 | 22 | func main() { 23 | configPath := flag.String("config", "/opt/kcm/kcm.yaml", "Path to configuration file") 24 | flag.Parse() 25 | 26 | // Load configuration 27 | cfg, err := config.LoadConfig(*configPath) 28 | if err != nil { 29 | logrus.Fatalf("Failed to load configuration: %v", err) 30 | } 31 | 32 | // Initialize logger 33 | initLogger(cfg.Log) 34 | 35 | // Initialize Kafka client and collector 36 | kafkaClient, err := kafka.NewClient(cfg.Kafka.MinKafkaVersion, cfg.Kafka.AdminTimeout) 37 | if err != nil { 38 | logrus.Fatalf("Failed to create Kafka client: %v", err) 39 | } 40 | 41 | collector := metrics.NewCollector() 42 | prometheus.MustRegister(collector) 43 | 44 | // Start metrics collection for each cluster 45 | for clusterName, clusterConfig := range cfg.Clusters { 46 | go func(name string, config config.ClusterConfig) { 47 | for { 48 | if err := collectMetrics(kafkaClient, collector, name, config); err != nil { 49 | logrus.Errorf("Failed to collect metrics for cluster %s: %v", name, err) 50 | } 51 | time.Sleep(cfg.Kafka.DefaultRefreshRate) 52 | } 53 | }(clusterName, clusterConfig) 54 | } 55 | 56 | // Setup HTTP server 57 | mux := http.NewServeMux() 58 | mux.Handle("/metrics", promhttp.Handler()) 59 | mux.HandleFunc("/-/healthy", healthHandler) 60 | mux.HandleFunc("/-/ready", readyHandler) 61 | 62 | server := &http.Server{ 63 | Addr: cfg.Global.Port, 64 | Handler: mux, 65 | ReadHeaderTimeout: cfg.Global.Timeout, 66 | } 67 | 68 | // Setup graceful shutdown 69 | ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM) 70 | defer stop() 71 | 72 | go func() { 73 | logrus.Infof(" \\ʕ ◔ ϖ ◔ ʔ/ ## Kafka-Config-Metrics Exporter ## \\ʕ ◔ ϖ ◔ ʔ/") 74 | logrus.Infof("Starting server on %s", cfg.Global.Port) 75 | if err := server.ListenAndServe(); err != http.ErrServerClosed { 76 | logrus.Fatalf("Failed to start server: %v", err) 77 | } 78 | }() 79 | 80 | <-ctx.Done() 81 | logrus.Info("Shutting down server...") 82 | 83 | shutdownCtx, cancel := context.WithTimeout(context.Background(), 5*time.Second) 84 | defer cancel() 85 | 86 | if err := server.Shutdown(shutdownCtx); err != nil { 87 | logrus.Errorf("Server shutdown failed: %v", err) 88 | } 89 | } 90 | 91 | func collectMetrics(client *kafka.Client, collector *metrics.Collector, clusterName string, config config.ClusterConfig) error { 92 | admin, err := client.Connect(config) 93 | if err != nil { 94 | return err 95 | } 96 | defer admin.Close() 97 | 98 | topics, err := client.GetFilteredTopics(admin, config.TopicFilter) 99 | if err != nil { 100 | return err 101 | } 102 | 103 | collector.Reset() 104 | 105 | for _, topic := range topics { 106 | topicConfig, err := client.GetTopicConfig(admin, topic) 107 | if err != nil { 108 | logrus.Errorf("Failed to get config for topic %s: %v", topic, err) 109 | continue 110 | } 111 | 112 | for _, entry := range topicConfig { 113 | if metricName := collector.GetMetricByKey(entry.Name); metricName != "" { 114 | if value, err := strconv.ParseFloat(entry.Value, 64); err == nil { 115 | collector.SetMetric(metricName, topic, clusterName, value) 116 | } 117 | } 118 | } 119 | } 120 | 121 | return nil 122 | } 123 | 124 | func healthHandler(w http.ResponseWriter, r *http.Request) { 125 | if r.Method != http.MethodGet { 126 | w.WriteHeader(http.StatusMethodNotAllowed) 127 | return 128 | } 129 | w.WriteHeader(http.StatusOK) 130 | } 131 | 132 | func readyHandler(w http.ResponseWriter, r *http.Request) { 133 | if r.Method != http.MethodGet { 134 | w.WriteHeader(http.StatusMethodNotAllowed) 135 | return 136 | } 137 | w.WriteHeader(http.StatusOK) 138 | } 139 | -------------------------------------------------------------------------------- /pkg/metrics/collector.go: -------------------------------------------------------------------------------- 1 | package metrics 2 | 3 | import ( 4 | "sync" 5 | 6 | "github.com/prometheus/client_golang/prometheus" 7 | ) 8 | 9 | // MetricDefinition represents a single metric configuration 10 | type MetricDefinition struct { 11 | Name string 12 | Help string 13 | ConfigKey string 14 | } 15 | 16 | // Collector manages all Kafka configuration metrics 17 | type Collector struct { 18 | metrics map[string]*prometheus.GaugeVec 19 | mu sync.RWMutex 20 | } 21 | 22 | var metricDefinitions = []MetricDefinition{ 23 | {Name: "min_insync_replicas", Help: "Minimum number of replicas that must acknowledge a write", ConfigKey: "min.insync.replicas"}, 24 | {Name: "segment_jitter_ms", Help: "Maximum random jitter for segment rolling", ConfigKey: "segment.jitter.ms"}, 25 | {Name: "flush_ms", Help: "Time interval for forcing fsync of data", ConfigKey: "flush.ms"}, 26 | {Name: "log_retention_ms", Help: "Maximum time to retain a log", ConfigKey: "retention.ms"}, 27 | {Name: "segment_bytes", Help: "Controls the segment file size for the log", ConfigKey: "segment.bytes"}, 28 | {Name: "flush_messages", Help: "Number of messages after which to force an fsync", ConfigKey: "flush.messages"}, 29 | {Name: "file_delete_delay_ms", Help: "Time to wait before deleting a file", ConfigKey: "file.delete.delay.ms"}, 30 | {Name: "max_compaction_lag_ms", Help: "Maximum time a message remains ineligible for compaction", ConfigKey: "max.compaction.lag.ms"}, 31 | {Name: "max_message_bytes", Help: "Maximum size of a message batch", ConfigKey: "max.message.bytes"}, 32 | {Name: "min_compaction_lag_ms", Help: "Minimum time a message remains uncompacted", ConfigKey: "min.compaction.lag.ms"}, 33 | {Name: "index_interval_bytes", Help: "Index entry addition frequency", ConfigKey: "index.interval.bytes"}, 34 | {Name: "retention_bytes", Help: "Maximum size of a partition", ConfigKey: "retention.bytes"}, 35 | {Name: "delete_retention_ms", Help: "Time to retain delete tombstone markers", ConfigKey: "delete.retention.ms"}, 36 | {Name: "segment_ms", Help: "Time after which log will be forced to roll", ConfigKey: "segment.ms"}, 37 | {Name: "message_timestamp_difference_max_ms", Help: "Maximum allowed difference between message timestamp and broker time", ConfigKey: "message.timestamp.difference.max.ms"}, 38 | {Name: "segment_index_bytes", Help: "Size of the index mapping offsets to file positions", ConfigKey: "segment.index.bytes"}, 39 | } 40 | 41 | // NewCollector creates and initializes a new Collector 42 | func NewCollector() *Collector { 43 | c := &Collector{ 44 | metrics: make(map[string]*prometheus.GaugeVec), 45 | } 46 | 47 | // Initialize all metrics 48 | for _, def := range metricDefinitions { 49 | c.metrics[def.Name] = prometheus.NewGaugeVec( 50 | prometheus.GaugeOpts{ 51 | Name: def.Name, 52 | Help: def.Help, 53 | Namespace: "kafka_topic_config", 54 | }, 55 | []string{"topic", "cluster"}, 56 | ) 57 | } 58 | 59 | return c 60 | } 61 | 62 | // SetMetric safely sets a metric value 63 | func (c *Collector) SetMetric(name, topic, cluster string, value float64) { 64 | c.mu.RLock() 65 | defer c.mu.RUnlock() 66 | 67 | if metric, exists := c.metrics[name]; exists { 68 | metric.With(prometheus.Labels{ 69 | "topic": topic, 70 | "cluster": cluster, 71 | }).Set(value) 72 | } 73 | } 74 | 75 | // Reset safely resets all metrics 76 | func (c *Collector) Reset() { 77 | c.mu.RLock() 78 | defer c.mu.RUnlock() 79 | 80 | for _, metric := range c.metrics { 81 | metric.Reset() 82 | } 83 | } 84 | 85 | // Collect implements prometheus.Collector 86 | func (c *Collector) Collect(ch chan<- prometheus.Metric) { 87 | c.mu.RLock() 88 | defer c.mu.RUnlock() 89 | 90 | for _, metric := range c.metrics { 91 | metric.Collect(ch) 92 | } 93 | } 94 | 95 | // Describe implements prometheus.Collector 96 | func (c *Collector) Describe(ch chan<- *prometheus.Desc) { 97 | c.mu.RLock() 98 | defer c.mu.RUnlock() 99 | 100 | for _, metric := range c.metrics { 101 | metric.Describe(ch) 102 | } 103 | } 104 | 105 | // GetMetricByKey returns the metric name for a given Kafka config key 106 | func (c *Collector) GetMetricByKey(configKey string) string { 107 | 108 | for _, def := range metricDefinitions { 109 | if def.ConfigKey == configKey { 110 | return def.Name 111 | } 112 | } 113 | return "" 114 | } 115 | -------------------------------------------------------------------------------- /pkg/kafka/client.go: -------------------------------------------------------------------------------- 1 | package kafka 2 | 3 | import ( 4 | "crypto/tls" 5 | "crypto/x509" 6 | "fmt" 7 | "os" 8 | "regexp" 9 | "time" 10 | 11 | "github.com/IBM/sarama" 12 | 13 | "github.com/EladLeev/kafka-config-metrics/pkg/config" 14 | ) 15 | 16 | // Client manages Kafka cluster connections and operations 17 | type Client struct { 18 | version sarama.KafkaVersion 19 | adminTimeout time.Duration 20 | } 21 | 22 | // NewClient creates a new Kafka client 23 | func NewClient(kafkaVersion string, adminTimeout time.Duration) (*Client, error) { 24 | version, err := sarama.ParseKafkaVersion(kafkaVersion) 25 | if err != nil { 26 | return nil, fmt.Errorf("invalid Kafka version: %w", err) 27 | } 28 | 29 | return &Client{ 30 | version: version, 31 | adminTimeout: adminTimeout, 32 | }, nil 33 | } 34 | 35 | func (c *Client) createTLSConfig(tlsCfg config.TLSConfig) (*tls.Config, error) { 36 | if !tlsCfg.Enabled { 37 | return nil, nil 38 | } 39 | 40 | tlsConfig := &tls.Config{ 41 | MinVersion: tls.VersionTLS12, 42 | } 43 | 44 | // Load CA cert if provided 45 | if tlsCfg.CACert != "" { 46 | caCert, err := os.ReadFile(tlsCfg.CACert) 47 | if err != nil { 48 | return nil, fmt.Errorf("failed to read CA certificate: %w", err) 49 | } 50 | 51 | caCertPool := x509.NewCertPool() 52 | if !caCertPool.AppendCertsFromPEM(caCert) { 53 | return nil, fmt.Errorf("failed to parse CA certificate") 54 | } 55 | tlsConfig.RootCAs = caCertPool 56 | } 57 | 58 | // Load client cert/key if provided 59 | if tlsCfg.ClientCert != "" && tlsCfg.ClientKey != "" { 60 | cert, err := tls.LoadX509KeyPair(tlsCfg.ClientCert, tlsCfg.ClientKey) 61 | if err != nil { 62 | return nil, fmt.Errorf("failed to load client certificate/key: %w", err) 63 | } 64 | tlsConfig.Certificates = []tls.Certificate{cert} 65 | } 66 | 67 | return tlsConfig, nil 68 | } 69 | 70 | // Connect establishes a connection to a Kafka cluster 71 | func (c *Client) Connect(clusterConfig config.ClusterConfig) (sarama.ClusterAdmin, error) { 72 | connectConfig := sarama.NewConfig() 73 | connectConfig.Version = c.version 74 | connectConfig.Admin.Timeout = c.adminTimeout 75 | 76 | // Configure TLS if enabled 77 | if clusterConfig.TLS.Enabled { 78 | tlsConfig, err := c.createTLSConfig(clusterConfig.TLS) 79 | if err != nil { 80 | return nil, fmt.Errorf("failed to configure TLS: %w", err) 81 | } 82 | connectConfig.Net.TLS.Enable = true 83 | connectConfig.Net.TLS.Config = tlsConfig 84 | } 85 | 86 | // Configure SASL if enabled 87 | if creds := clusterConfig.GetCredentials(); creds != nil && creds.Enabled { 88 | connectConfig.Net.SASL.Enable = true 89 | connectConfig.Net.SASL.User = creds.Username 90 | connectConfig.Net.SASL.Password = creds.Password 91 | 92 | switch creds.Mechanism { 93 | case "PLAIN": 94 | connectConfig.Net.SASL.Mechanism = sarama.SASLTypePlaintext 95 | case "SCRAM-SHA-256": 96 | connectConfig.Net.SASL.Mechanism = sarama.SASLTypeSCRAMSHA256 97 | case "SCRAM-SHA-512": 98 | connectConfig.Net.SASL.Mechanism = sarama.SASLTypeSCRAMSHA512 99 | default: 100 | return nil, fmt.Errorf("unsupported SASL mechanism: %s", creds.Mechanism) 101 | } 102 | } 103 | 104 | admin, err := sarama.NewClusterAdmin(clusterConfig.Brokers, connectConfig) 105 | if err != nil { 106 | return nil, fmt.Errorf("failed to connect to cluster: %w", err) 107 | } 108 | return admin, nil 109 | } 110 | 111 | // GetFilteredTopics returns topics matching the filter 112 | func (c *Client) GetFilteredTopics(admin sarama.ClusterAdmin, filterPattern string) ([]string, error) { 113 | topics, err := admin.ListTopics() 114 | if err != nil { 115 | return nil, fmt.Errorf("failed to list topics: %w", err) 116 | } 117 | 118 | if filterPattern == "" { 119 | result := make([]string, 0, len(topics)) 120 | for topic := range topics { 121 | result = append(result, topic) 122 | } 123 | return result, nil 124 | } 125 | 126 | re, err := regexp.Compile(filterPattern) 127 | if err != nil { 128 | return nil, fmt.Errorf("invalid topic filter pattern: %w", err) 129 | } 130 | 131 | var filtered []string 132 | for topic := range topics { 133 | if !re.MatchString(topic) { 134 | filtered = append(filtered, topic) 135 | } 136 | } 137 | return filtered, nil 138 | } 139 | 140 | // GetTopicConfig retrieves configuration for a specific topic 141 | func (c *Client) GetTopicConfig(admin sarama.ClusterAdmin, topic string) ([]sarama.ConfigEntry, error) { 142 | resource := sarama.ConfigResource{ 143 | Type: sarama.TopicResource, 144 | Name: topic, 145 | } 146 | 147 | config, err := admin.DescribeConfig(resource) 148 | if err != nil { 149 | return nil, fmt.Errorf("failed to describe config for topic %s: %w", topic, err) 150 | } 151 | return config, nil 152 | } 153 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Kafka Configs Metrics Exporter 2 | 3 | ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/EladLeev/kafka-config-metrics/release.yml?branch=master) 4 | [![Go Report Card](https://goreportcard.com/badge/github.com/EladLeev/kafka-config-metrics)](https://goreportcard.com/report/github.com/EladLeev/kafka-config-metrics) 5 | [![Renovate](https://img.shields.io/badge/renovate-enabled-%231A1F6C?logo=renovatebot)](https://renovatebot.com) 6 | 7 | "Kafka Configs Metrics Exporter" for Prometheus allows you to export some of the Kafka configuration as metrics. 8 | 9 | ## Motivation 10 | 11 | Unlike some other systems, Kafka doesn't expose its configurations as metrics. 12 | There are few useful configuration parameters that might be beneficial to collect in order to improve the visibility and alerting over Kafka. 13 | 14 | A good example might be `log.retention.ms` parameter per topic, which can be integrated into Kafka's dashboards to extend its visibility, or to integrate it into an alerting query to create smarter alerts or automations based on topic retention. 15 | 16 | Therefore, I decided to create a Prometheus exporter to collect those metrics. 17 | 18 | Read more on [Confluent Blog](https://www.confluent.io/blog/kafka-lag-monitoring-and-metrics-at-appsflyer/) 19 | 20 | Table of Contents 21 | ----------------- 22 | 23 | - [Kafka Configs Metrics Exporter](#kafka-configs-metrics-exporter) 24 | - [Motivation](#motivation) 25 | - [Table of Contents](#table-of-contents) 26 | - [Build from source](#build-from-source) 27 | - [Prerequisites](#prerequisites) 28 | - [Building Steps](#building-steps) 29 | - [Using Docker Image](#using-docker-image) 30 | - [Helm](#helm) 31 | - [Configuration](#configuration) 32 | - [Clusters](#clusters) 33 | - [Authentication](#authentication) 34 | - [Prometheus Configuration](#prometheus-configuration) 35 | - [Endpoints](#endpoints) 36 | - [Dashboard Example](#dashboard-example) 37 | - [Contributing](#contributing) 38 | - [License](#license) 39 | 40 | ## Build from source 41 | 42 | ### Prerequisites 43 | 44 | - Install Go version 1.20+ 45 | 46 | ### Building Steps 47 | 48 | 1. Clone this repository 49 | 50 | ```bash 51 | git clone https://github.com/EladLeev/kafka-config-metrics 52 | cd kafka-config-metrics 53 | ``` 54 | 55 | 2. Build the exporter binary 56 | 57 | ```bash 58 | go build -o kcm-exporter . 59 | ``` 60 | 61 | 3. Copy and edit the [config file](https://github.com/EladLeev/kafka-config-metrics/blob/master/kcm.yaml) from this repository and point it into your Kafka clusters. 62 | _Use topic filtering as needed._ 63 | 64 | 4. Deploy the binary and run the exporter 65 | 66 | ```bash 67 | cp ~/my_kcm.yaml /opt/kcm/kcm.yaml 68 | ./kcm-exporter 69 | ``` 70 | 71 | The exporter will use `/opt/kcm/kcm.yaml` as default. 72 | 73 | ## Using Docker Image 74 | 75 | 1. Clone this repository 76 | 77 | ```bash 78 | git clone https://github.com/EladLeev/kafka-config-metrics 79 | cd kafka-config-metrics 80 | ``` 81 | 82 | 2. Build the Docker image 83 | 84 | ```bash 85 | docker build . -t kcm-exporter 86 | ``` 87 | 88 | 3. Run it with your custom configuration file 89 | 90 | ```bash 91 | docker run -p 9899:9899 -v ~/my_kcm.yaml:/opt/kcm/kcm.yaml kcm-exporter:latest 92 | ``` 93 | 94 | ## Helm 95 | 96 | Helm chart is available under the `/charts` dir. 97 | 98 | To install the chart: 99 | 100 | ```bash 101 | helm install kafka-config-metrics ./charts/kafka-config-metrics -f values.yaml 102 | ``` 103 | 104 | ## Configuration 105 | 106 | This project tried to stand in the Prometheus community [best practices](https://prometheus.io/docs/instrumenting/writing_exporters/) - 107 | "You should aim for an exporter that requires no custom configuration by the user beyond telling it where the application is". 108 | 109 | In fact, you don't really need to change anything beyond the `clusters` configuration. 110 | 111 | Example configuration: 112 | 113 | ```yaml 114 | global: 115 | port: ":9899" # Which port to bind 116 | timeout: 3 # HTTP server timeout in seconds 117 | 118 | log: 119 | format: "text" # Log format: text or json 120 | level: "info" # Log level: info, debug, trace 121 | 122 | kafka: 123 | defaultRefreshRate: 60 # Refresh rate in seconds 124 | minKafkaVersion: "2.8.0" # Minimum Kafka version 125 | adminTimeout: 5 # Admin client timeout in seconds 126 | 127 | clusters: 128 | prod: 129 | brokers: 130 | - "kafka01-prod:9092" 131 | topicFilter: "" # Optional regex filter 132 | tls: 133 | enabled: false 134 | # caCert: "/path/to/ca.crt" 135 | # clientCert: "/path/to/client.crt" 136 | # clientKey: "/path/to/client.key" 137 | sasl: 138 | enabled: false 139 | usernameEnv: "KAFKA_USERNAME" 140 | passwordEnv: "KAFKA_PASSWORD" 141 | mechanism: "PLAIN" # PLAIN, SCRAM-SHA-256, or SCRAM-SHA-512 142 | 143 | test: 144 | brokers: 145 | - "kafka02-test:9092" 146 | - "kafka03-test:9092" 147 | topicFilter: "^(qa-|test-).*$" 148 | ``` 149 | 150 | ### Authentication 151 | 152 | The exporter supports both TLS and SASL authentication: 153 | 154 | - TLS: Provide CA certificate and optionally client certificate/key 155 | - SASL: Supports PLAIN, SCRAM-SHA-256, and SCRAM-SHA-512 mechanisms 156 | - Credentials are loaded from environment variables 157 | 158 | ### Prometheus Configuration 159 | 160 | When setting this exporter in the Prometheus targets, bear in mind that topic configs are not subject to change that often in most use cases. 161 | Setting a higher `scrape_interval`, let's say to 10 minutes, will lead to lower requests rate to the Kafka cluster while still keeping the exporter functional. 162 | 163 | ```yaml 164 | scrape_configs: 165 | - job_name: 'kcm' 166 | scrape_interval: 600s 167 | static_configs: 168 | - targets: ['kcm-prod:9899'] 169 | ``` 170 | 171 | ### Endpoints 172 | 173 | `/metrics` - Metrics endpoint 174 | 175 | `/-/healthy` - This endpoint returns 200 and should be used to check the exporter health. 176 | 177 | `/-/ready`- This endpoint returns 200 when the exporter is ready to serve traffic. 178 | 179 | ## Dashboard Example 180 | 181 | ![Dashboard Sample](doc/dashboard.png) 182 | 183 | ## Contributing 184 | 185 | Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details of submitting a pull requests. 186 | 187 | ## License 188 | 189 | This project is licensed under the Apache License - see the [LICENSE.md](LICENSE.md) file for details. -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/IBM/sarama v1.45.1 h1:nY30XqYpqyXOXSNoe2XCgjj9jklGM1Ye94ierUb1jQ0= 2 | github.com/IBM/sarama v1.45.1/go.mod h1:qifDhA3VWSrQ1TjSMyxDl3nYL3oX2C83u+G6L79sq4w= 3 | github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= 4 | github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= 5 | github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= 6 | github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= 7 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 8 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 9 | github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= 10 | github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 11 | github.com/eapache/go-resiliency v1.7.0 h1:n3NRTnBn5N0Cbi/IeOHuQn9s2UwVUH7Ga0ZWcP+9JTA= 12 | github.com/eapache/go-resiliency v1.7.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= 13 | github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 h1:Oy0F4ALJ04o5Qqpdz8XLIpNA3WM/iSIXqxtqo7UGVws= 14 | github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3/go.mod h1:YvSRo5mw33fLEx1+DlK6L2VV43tJt5Eyel9n9XBcR+0= 15 | github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= 16 | github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= 17 | github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= 18 | github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= 19 | github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= 20 | github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= 21 | github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= 22 | github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= 23 | github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs= 24 | github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= 25 | github.com/golang/snappy v1.0.0 h1:Oy607GVXHs7RtbggtPBnr2RmDArIsAefDwvrdWvRhGs= 26 | github.com/golang/snappy v1.0.0/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 27 | github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= 28 | github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= 29 | github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= 30 | github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= 31 | github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= 32 | github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= 33 | github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= 34 | github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= 35 | github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= 36 | github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= 37 | github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= 38 | github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= 39 | github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= 40 | github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= 41 | github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo= 42 | github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM= 43 | github.com/jcmturner/gofork v1.7.6 h1:QH0l3hzAU1tfT3rZCnW5zXl+orbkNMMRGJfdJjHVETg= 44 | github.com/jcmturner/gofork v1.7.6/go.mod h1:1622LH6i/EZqLloHfE7IeZ0uEJwMSUyQ/nDd82IeqRo= 45 | github.com/jcmturner/goidentity/v6 v6.0.1 h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o= 46 | github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg= 47 | github.com/jcmturner/gokrb5/v8 v8.4.4 h1:x1Sv4HaTpepFkXbt2IkL29DXRf8sOfZXo8eRKh687T8= 48 | github.com/jcmturner/gokrb5/v8 v8.4.4/go.mod h1:1btQEpgT6k+unzCwX1KdWMEwPPkkgBtP+F6aCACiMrs= 49 | github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY= 50 | github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= 51 | github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= 52 | github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= 53 | github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= 54 | github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= 55 | github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= 56 | github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= 57 | github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= 58 | github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= 59 | github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= 60 | github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= 61 | github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= 62 | github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= 63 | github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU= 64 | github.com/pierrec/lz4/v4 v4.1.22/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= 65 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 66 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 67 | github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o= 68 | github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg= 69 | github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= 70 | github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= 71 | github.com/prometheus/common v0.66.1 h1:h5E0h5/Y8niHc5DlaLlWLArTQI7tMrsfQjHV+d9ZoGs= 72 | github.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA= 73 | github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg= 74 | github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is= 75 | github.com/rcrowley/go-metrics v0.0.0-20250401214520-65e299d6c5c9 h1:bsUq1dX0N8AOIL7EB/X911+m4EHsnWEHeJ0c+3TTBrg= 76 | github.com/rcrowley/go-metrics v0.0.0-20250401214520-65e299d6c5c9/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= 77 | github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= 78 | github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= 79 | github.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc= 80 | github.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik= 81 | github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= 82 | github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= 83 | github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw= 84 | github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U= 85 | github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I= 86 | github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg= 87 | github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY= 88 | github.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo= 89 | github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= 90 | github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= 91 | github.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU= 92 | github.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY= 93 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 94 | github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= 95 | github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= 96 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= 97 | github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 98 | github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 99 | github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= 100 | github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= 101 | github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= 102 | github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= 103 | github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= 104 | github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= 105 | github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= 106 | go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= 107 | go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= 108 | go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI= 109 | go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU= 110 | go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= 111 | go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= 112 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 113 | golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= 114 | golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= 115 | golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= 116 | golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc= 117 | golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= 118 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 119 | golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 120 | golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= 121 | golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= 122 | golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= 123 | golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= 124 | golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= 125 | golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= 126 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 127 | golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 128 | golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= 129 | golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= 130 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 131 | golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 132 | golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 133 | golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 134 | golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 135 | golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 136 | golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 137 | golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= 138 | golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= 139 | golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= 140 | golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= 141 | golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= 142 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 143 | golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 144 | golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= 145 | golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= 146 | golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= 147 | golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= 148 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 149 | golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 150 | golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= 151 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 152 | google.golang.org/protobuf v1.36.8 h1:xHScyCOEuuwZEc6UtSOvPbAT4zRh0xcNRYekJwfqyMc= 153 | google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU= 154 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 155 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= 156 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= 157 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 158 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 159 | gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= 160 | gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 161 | --------------------------------------------------------------------------------