OpenTelemetry Bot d680729c09 [chore] Prepare release 0.90.0 (#29543) 1 rok pred
..
internal 91643ba261 [mdatagen] allow adding resource_attribute warnings (#27257) 1 rok pred
testdata 73372733df [receiver/mysql] expose tls config (#29269) 1 rok pred
Makefile 5d3fe8fc41 Add MySQL receiver - part 1 (#5446) 3 rokov pred
README.md 73372733df [receiver/mysql] expose tls config (#29269) 1 rok pred
client.go 73372733df [receiver/mysql] expose tls config (#29269) 1 rok pred
config.go 73372733df [receiver/mysql] expose tls config (#29269) 1 rok pred
config_test.go 73372733df [receiver/mysql] expose tls config (#29269) 1 rok pred
doc.go 5133f4ccd6 [chore] use license shortform (#22052) 1 rok pred
documentation.md e5cd1ca7bc feat(mysqlreceiver)!: removing `mysql.locked_connects` metric which is replaced by `mysql.connection.errors` (#23990) 1 rok pred
factory.go 2c5577b0d7 [chore] updating scrapers to use default method from scraperhelper (#22138) 1 rok pred
factory_test.go 4a0ea8e961 [chore] Improving life cycle tests reporting (#23145) 1 rok pred
go.mod d680729c09 [chore] Prepare release 0.90.0 (#29543) 1 rok pred
go.sum 40b485f08a Update core for v0.90.0 release (#29539) 1 rok pred
integration_test.go 73372733df [receiver/mysql] expose tls config (#29269) 1 rok pred
metadata.yaml 326d0261f9 [cmd/mdatagen] Rename aggregation to aggregation_temporality for sum metrics (#24808) 1 rok pred
scraper.go 73372733df [receiver/mysql] expose tls config (#29269) 1 rok pred
scraper_test.go cd92432fd2 [pkg/golden] internal/coreinternal/golden -> pkg/golden (#28636) 1 rok pred

README.md

MySQL Receiver

Status
Stability beta: metrics
Distributions contrib, observiq, sumo
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