Skip to content

docs: Validate database_observability.mysql topic and consolidate examples - #6797

Draft
clayton-cornell wants to merge 11 commits into
mainfrom
docs/cleanup-database_observability.mysql-topic
Draft

docs: Validate database_observability.mysql topic and consolidate examples#6797
clayton-cornell wants to merge 11 commits into
mainfrom
docs/cleanup-database_observability.mysql-topic

Conversation

@clayton-cornell

Copy link
Copy Markdown
Contributor

Cleanup on the database_observability.mysql topic

  1. Fix datatypes
  2. Add missing Exported fields section
  3. Strip big example
  4. Create new task topic and import stripped example
  5. Fix critical config error/mistake found in the original example, discovery.relabel.orders_db.targets is invalid, must be discovery.relabel.orders_db.output
  6. Develop/build the new task topic.

Copilot AI review requested due to automatic review settings July 30, 2026 20:21
Comment thread docs/sources/collect/mysql-database-metrics.md
Comment thread docs/sources/collect/mysql-database-metrics.md Outdated
Comment thread docs/sources/collect/mysql-database-metrics.md
Comment thread docs/sources/collect/mysql-database-metrics.md
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

✅ No broken links found. Previously reported broken links in this PR have been fixed. (93cc280)

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

💻 Deploy preview available (docs: Validate database_observability.mysql topic and consolidate examples):

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refreshes the database_observability.mysql documentation by correcting configuration/data-type details, simplifying the component reference example, and moving the full end-to-end example into a new “collect” task topic.

Changes:

  • Normalizes boolean type names (bool) and adds an “Exported fields” section to the database_observability.mysql reference docs.
  • Replaces the large in-page example with a minimal snippet and links to a new dedicated task topic.
  • Adds a new “Collect MySQL database metrics and logs” topic with a complete configuration example.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
docs/sources/reference/components/database_observability/database_observability.mysql.md Updates argument type docs, adds exported fields, and consolidates the example to point to the new collect topic.
docs/sources/collect/mysql-database-metrics.md New end-to-end task topic showing how to collect MySQL observability data and forward it to metrics/logs backends.
Comments suppressed due to low confidence (1)

docs/sources/collect/mysql-database-metrics.md:212

  • In the complete configuration, prometheus.exporter.mysql "example" is declared but never referenced. Add targets = prometheus.exporter.mysql.example.targets to the database_observability.mysql component so the exporter is actually used.
database_observability.mysql "example" {
  data_source_name = "<MYSQL_DSN>"
  forward_to       = [loki.relabel.example.receiver]

Comment thread docs/sources/collect/mysql-database-metrics.md
Comment thread docs/sources/collect/mysql-database-metrics.md Outdated
Comment thread docs/sources/collect/mysql-database-metrics.md Outdated
Copilot AI review requested due to automatic review settings July 30, 2026 20:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (4)

docs/sources/collect/mysql-database-metrics.md:58

  • The topic defines a prometheus.exporter.mysql component (step 2) but the exported targets are never wired into database_observability.mysql, so the prometheus.scrape configuration won’t actually scrape exporter metrics as described. Set database_observability.mysql.targets to prometheus.exporter.mysql.<LABEL>.targets (as done in the integration-test config) so database_observability.mysql.<LABEL>.targets includes both the db-o11y endpoint and the external exporter targets.
   database_observability.mysql "<LABEL>" {
     data_source_name = "<MYSQL_DSN>"
     forward_to       = [loki.relabel.<LABEL>.receiver]

     enable_collectors = ["query_samples", "explain_plans"]

docs/sources/collect/mysql-database-metrics.md:70

  • prod-mysql is an invalid Alloy identifier (hyphens aren’t allowed in component labels), and this topic later shows references like loki.relabel.<LABEL>.receiver which require a valid identifier label. Use an underscore example (or explicitly document identifier requirements).
   * _`<LABEL>`_: The Alloy component label, such as `prod-mysql`.

docs/sources/reference/components/database_observability/database_observability.mysql.md:228

  • prod-mysql is an invalid Alloy identifier (hyphens aren’t allowed in component labels), but the example uses references like loki.relabel.<LABEL>.receiver which require a valid identifier label. Use an underscore example (or explicitly document identifier requirements).
* _`<LABEL>`_: The Alloy component label (for example, `prod-mysql`).

docs/sources/collect/mysql-database-metrics.md:213

  • In the “Complete configuration” section, prometheus.exporter.mysql "example" is declared but not used by any scrape target wiring, so copying this config won’t scrape exporter metrics. Add targets = prometheus.exporter.mysql.example.targets to the database_observability.mysql block so its exported targets include the external exporter targets.
database_observability.mysql "example" {
  data_source_name = "<MYSQL_DSN>"
  forward_to       = [loki.relabel.example.receiver]

  enable_collectors = ["query_samples", "explain_plans"]

Copilot AI review requested due to automatic review settings July 30, 2026 20:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

docs/sources/collect/mysql-database-metrics.md:304

  • This file defines a [Prometheus] reference link that isn’t referenced anywhere in the document. Removing unused reference definitions helps keep the Markdown tidy and avoids confusion during future edits.
[Components]: ../../get-started/components/
[Prometheus]: https://prometheus.io/

docs/sources/reference/components/database_observability/database_observability.mysql.md:207

  • The exported targets field description mentions "instrumented services", which doesn’t match this component’s purpose (MySQL database metrics). Consider aligning the wording with other database_observability components to avoid confusion.
| `targets` | `list(map(string))` | The targets that can be used to collect metrics of instrumented services with Prometheus scraping. |

Comment on lines +45 to +47
The `database_observability.mysql` component connects to a MySQL database and collects performance schema data.
This data includes query details, execution plans, and lock information forwarded as logs to Loki.
The component also exports targets that can be scraped with Prometheus to collect MySQL metrics.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `database_observability.mysql` component connects to a MySQL database and collects performance schema data.
This data includes query details, execution plans, and lock information forwarded as logs to Loki.
The component also exports targets that can be scraped with Prometheus to collect MySQL metrics.
The `database_observability.mysql` component connects to a MySQL database and collects performance telemetry:
* Loki logs for query details, execution plans, and lock information.
* Prometheus metrics for <>

Nit: it'd be nice to avoid general and ambigous terms such as "data" and to be more concise and straight to the point. People probably just wonder what telemetry they can collect.

Also, logs and metrics are mentioned as sort of two different things, and it doesn't seem clear that these are the two signals that are being gathered.

In any case, it's probably best to mention this at the beginning of the page? There's already a list of bullet points there for similar things.


For more information, refer to the [`loki.relabel`][loki.relabel] documentation.

4. Add a `discovery.relabel` component to standardize labels on Prometheus targets.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's sad how we have to spend so much time describing relabelling and remote write. I agree that a user who wants to set up this component has to understand these concepts, but it feels like we're making the experience needlessly complicated. It would get especially repetitive if we have to mention this in every doc. Then a user who has to set up both MSSQL and MySQL has to read through or scroll through identical content. Is there a way to reduce this? E.g. we could just show a simple example which contains those components and include a link to a doc which explains how to do relabeling?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely. If we can identify the common "plumbing" components and document the concepts for them (vs the raw reference we have now) we'd have something to xref and it'd significantly reduce the middle content in any other task topic that used... loki.write, dicsovery.relabel and so on.

* _`<DATA_SOURCE_NAME>`_: The MySQL connection [Data Source Name] (for example, `user:pass@tcp(mysql:3306)/`).
* _`<AWS_RDS_ARN>`_: The ARN of your AWS RDS database (for example, `arn:aws:rds:us-east-1:123456789:db/prod-mysql`).

For a complete end-to-end example that demonstrates sending database observability metrics to Grafana Cloud, refer to [Collect MySQL database metrics and logs](../../../../collect/mysql-database-metrics/).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make this more prominent? Maybe to have a (sub)section for it? For some components there could be more than one such link, so maybe we can just always list them as bullet points?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, of some components, there might be 2 or 3 scenarios that cover common implementations...

There's also a growing number of Learning Journeys and Learning Paths that could be used for comprehensive example links.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYT about making the main examples section title "Examples" (always plural, never "Example"), and listing the links in bullet points right at the first paragraph, right under "Examples" and above any subsections with examples?

@ptodev ptodev self-assigned this Jul 31, 2026
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.

3 participants