config.go 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright The OpenTelemetry Authors
  2. // SPDX-License-Identifier: Apache-2.0
  3. package kafkametricsreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkametricsreceiver"
  4. import (
  5. "go.opentelemetry.io/collector/receiver/scraperhelper"
  6. "github.com/open-telemetry/opentelemetry-collector-contrib/internal/kafka"
  7. "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkametricsreceiver/internal/metadata"
  8. )
  9. // Config represents user settings for kafkametrics receiver
  10. type Config struct {
  11. scraperhelper.ScraperControllerSettings `mapstructure:",squash"`
  12. // The list of kafka brokers (default localhost:9092)
  13. Brokers []string `mapstructure:"brokers"`
  14. // ResolveCanonicalBootstrapServersOnly makes Sarama do a DNS lookup for
  15. // each of the provided brokers. It will then do a PTR lookup for each
  16. // returned IP, and that set of names becomes the broker list. This can be
  17. // required in SASL environments.
  18. ResolveCanonicalBootstrapServersOnly bool `mapstructure:"resolve_canonical_bootstrap_servers_only"`
  19. // ProtocolVersion Kafka protocol version
  20. ProtocolVersion string `mapstructure:"protocol_version"`
  21. // TopicMatch topics to collect metrics on
  22. TopicMatch string `mapstructure:"topic_match"`
  23. // GroupMatch consumer groups to collect on
  24. GroupMatch string `mapstructure:"group_match"`
  25. // Authentication data
  26. Authentication kafka.Authentication `mapstructure:"auth"`
  27. // Scrapers defines which metric data points to be captured from kafka
  28. Scrapers []string `mapstructure:"scrapers"`
  29. // ClientID is the id associated with the consumer that reads from topics in kafka.
  30. ClientID string `mapstructure:"client_id"`
  31. // MetricsBuilderConfig allows customizing scraped metrics/attributes representation.
  32. metadata.MetricsBuilderConfig `mapstructure:",squash"`
  33. }