Skip to content

Add MySQL DBI integration tests#717

Draft
Klarsen04 wants to merge 1 commit into
dbi-mysqlfrom
feature/mysql-dbi-integration-tests
Draft

Add MySQL DBI integration tests#717
Klarsen04 wants to merge 1 commit into
dbi-mysqlfrom
feature/mysql-dbi-integration-tests

Conversation

@Klarsen04

Copy link
Copy Markdown

Summary

Add integration tests for MySQL Database Insights (DBI) pipeline, mirroring the existing PostgreSQL DBI tests.

Changes

  • Test runner (database_insights_mysql_test.go): Validates MySQL counter metrics, DB Load metrics (7 active session dimensions), Top SQL metrics, server-logs and raw-events log groups, process metrics for mysqld, and top_query event attributes.
  • Agent config (database_insights_mysql_config.json): Minimal config with opentelemetry.collect.database_insights.mysql targeting localhost:3306.
  • Setup script (database_insights_mysql_setup.sh): Cross-distro MySQL installation (yum/apt/zypper), performance_schema configuration, monitoring user creation, and passfile setup.
  • Test case generator: Registers the MySQL DBI test with same OS exclusions as PostgreSQL DBI.

Testing

  • Follows same patterns as the PostgreSQL DBI integration test
  • Uses sysbench (with mysqlslap fallback) for workload generation
  • Validates metrics via PromQL with resource attribute labels (db.system.name=mysql, db.instance.name=dbi-mysql-integ-test)
  • Conservative metric selection: only validates metrics that reliably appear in a 5-minute test window

@Klarsen04 Klarsen04 requested a review from a team as a code owner June 30, 2026 18:40
Implement end-to-end integration tests for MySQL database insights,
mirroring the existing PostgreSQL DBI test in test/otel_collect/database_insights.

- Setup script installs MySQL across yum/apt/zypper, enables
  performance_schema with statement/wait consumers, configures the error
  log, and creates a cw_monitor user (SELECT on performance_schema,
  PROCESS, REPLICATION CLIENT) plus a sysbench workload user
- Agent config targets localhost:3306 with a pgpass-style passfile
- Workload generation via sysbench oltp_read_write (mysqlslap fallback)
- Validates counter metrics (enabled-by-default receiver metrics only),
  the 7 DB Load metrics, and Top SQL metrics via PromQL with resource
  attribute labels (db.system.name=mysql, db.instance.name)
- Validates mysqld process metrics from the host metrics process scraper
- Validates server logs and raw events in CloudWatch Logs, including
  db.server.top_query event attributes
- Register in test case generator with ol8/ubuntu-25 exclusions and
  exclude from ARM64 itar/china partitions (same as PostgreSQL DBI tests)
@Klarsen04 Klarsen04 force-pushed the feature/mysql-dbi-integration-tests branch from 5d4cf96 to 5a1f0cc Compare June 30, 2026 18:46
@Klarsen04 Klarsen04 marked this pull request as draft July 1, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant