docs: Validate database_observability.mysql topic and consolidate examples - #6797
docs: Validate database_observability.mysql topic and consolidate examples#6797clayton-cornell wants to merge 11 commits into
Conversation
|
✅ No broken links found. Previously reported broken links in this PR have been fixed. ( |
|
💻 Deploy preview available (docs: Validate database_observability.mysql topic and consolidate examples): |
There was a problem hiding this comment.
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 thedatabase_observability.mysqlreference 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. Addtargets = prometheus.exporter.mysql.example.targetsto thedatabase_observability.mysqlcomponent so the exporter is actually used.
database_observability.mysql "example" {
data_source_name = "<MYSQL_DSN>"
forward_to = [loki.relabel.example.receiver]
There was a problem hiding this comment.
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.mysqlcomponent (step 2) but the exported targets are never wired intodatabase_observability.mysql, so theprometheus.scrapeconfiguration won’t actually scrape exporter metrics as described. Setdatabase_observability.mysql.targetstoprometheus.exporter.mysql.<LABEL>.targets(as done in the integration-test config) sodatabase_observability.mysql.<LABEL>.targetsincludes 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-mysqlis an invalid Alloy identifier (hyphens aren’t allowed in component labels), and this topic later shows references likeloki.relabel.<LABEL>.receiverwhich 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-mysqlis an invalid Alloy identifier (hyphens aren’t allowed in component labels), but the example uses references likeloki.relabel.<LABEL>.receiverwhich 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. Addtargets = prometheus.exporter.mysql.example.targetsto thedatabase_observability.mysqlblock 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"]
There was a problem hiding this comment.
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
targetsfield 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. |
| 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. |
There was a problem hiding this comment.
| 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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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/). |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
Cleanup on the database_observability.mysql topic
discovery.relabel.orders_db.targetsis invalid, must bediscovery.relabel.orders_db.output