mysqlreceiver

package module
v0.114.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 22 Imported by: 8

README

MySQL Receiver

Status
Stability beta: metrics
Distributions contrib
Issues Open issues Closed issues
Code Owners @djaglowski

This receiver queries MySQL's global status and InnoDB tables.

Some metrics will not appear if their corresponding feature is inactive.
There are also optional metrics that you must specify in your configuration to collect, listed in documentation.md

Prerequisites

This receiver supports MySQL version 8.0

Collecting most metrics requires the ability to execute SHOW GLOBAL STATUS.

Configuration

The following settings are optional:

  • endpoint: (default = localhost:3306)

  • tls: Defines the TLS configuration to use. If tls is not set, the default is to disable TLS connections.

    • insecure: (default = false) Set this to true to disable TLS connections.
    • insecure_skip_verify: (default = false) Set this to true to enable TLS but not verify the certificate.
    • server_name_override: This sets the ServerName in the TLSConfig.
  • username: (default = root)

  • password: The password to the username.

  • allow_native_passwords: (default = true)

  • database: The database name. If not specified, metrics will be collected for all databases.

  • collection_interval (default = 10s): This receiver collects metrics on an interval. This value must be a string readable by Golang's time.ParseDuration. Valid time units are ns, us (or µs), ms, s, m, h.

  • initial_delay (default = 1s): defines how long this receiver waits before starting.

  • transport: (default = tcp): Defines the network to use for connecting to the server.

  • statement_events: Additional configuration for query to build mysql.statement_events.count and mysql.statement_events.wait.time metrics:

    • digest_text_limit - maximum length of digest_text. Longer text will be truncated (default=120)
    • time_limit - maximum time from since the statements have been observed last time (default=24h)
    • limit - limit of records, which is maximum number of generated metrics (default=250)
Example Configuration
receivers:
  mysql:
    endpoint: localhost:3306
    username: otel
    password: ${env:MYSQL_PASSWORD}
    database: otel
    collection_interval: 10s
    initial_delay: 1s
    statement_events:
      digest_text_limit: 120
      time_limit: 24h
      limit: 250

The full list of settings exposed for this receiver are documented here with detailed sample configurations here.

Metrics

Details about the metrics produced by this receiver can be found in metadata.yaml

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() receiver.Factory

Types

type Config

type Config struct {
	scraperhelper.ControllerConfig `mapstructure:",squash"`
	Username                       string              `mapstructure:"username,omitempty"`
	Password                       configopaque.String `mapstructure:"password,omitempty"`
	Database                       string              `mapstructure:"database,omitempty"`
	AllowNativePasswords           bool                `mapstructure:"allow_native_passwords,omitempty"`
	confignet.AddrConfig           `mapstructure:",squash"`
	TLS                            configtls.ClientConfig        `mapstructure:"tls,omitempty"`
	MetricsBuilderConfig           metadata.MetricsBuilderConfig `mapstructure:",squash"`
	StatementEvents                StatementEventsConfig         `mapstructure:"statement_events"`
}

func (*Config) Unmarshal added in v0.90.0

func (cfg *Config) Unmarshal(componentParser *confmap.Conf) error

type IndexIoWaitsStats added in v0.61.0

type IndexIoWaitsStats struct {
	IoWaitsStats
	// contains filtered or unexported fields
}

type IoWaitsStats added in v0.61.0

type IoWaitsStats struct {
	// contains filtered or unexported fields
}

type ReplicaStatusStats added in v0.68.0

type ReplicaStatusStats struct {
	// contains filtered or unexported fields
}

type StatementEventStats added in v0.63.0

type StatementEventStats struct {
	// contains filtered or unexported fields
}

type StatementEventsConfig added in v0.63.0

type StatementEventsConfig struct {
	DigestTextLimit int           `mapstructure:"digest_text_limit"`
	Limit           int           `mapstructure:"limit"`
	TimeLimit       time.Duration `mapstructure:"time_limit"`
}

type TableIoWaitsStats added in v0.61.0

type TableIoWaitsStats struct {
	IoWaitsStats
}

type TableStats added in v0.101.0

type TableStats struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL