database_observability: add cloud provider labels to all metrics#4942
Merged
matthewnolf merged 1 commit intomainfrom Dec 10, 2025
Merged
database_observability: add cloud provider labels to all metrics#4942matthewnolf merged 1 commit intomainfrom
matthewnolf merged 1 commit intomainfrom
Conversation
fridgepoet
approved these changes
Nov 28, 2025
Contributor
fridgepoet
left a comment
There was a problem hiding this comment.
does this need a changelog entry as well?
Contributor
|
Will this remove the need for the |
| } else { | ||
| cloudProvider, err := populateCloudProviderFromDSN(string(c.args.DataSourceName)) | ||
| if err != nil { | ||
| c.reportError("failed to collect cloud provider information from config", err) |
Contributor
There was a problem hiding this comment.
Can we differentiate the error message across the two cases?
| cloudProvider.AWS = &database_observability.AWSCloudProviderInfo{ | ||
| ARN: arn.ARN{ | ||
| Resource: fmt.Sprintf("db:%s", matches[1]), | ||
| Region: matches[3], |
Contributor
There was a problem hiding this comment.
Think we should check matches before accessing it (here and later for Azure)
| } else { | ||
| cloudProvider, err := populateCloudProviderFromDSN(string(c.args.DataSourceName)) | ||
| if err != nil { | ||
| c.reportError("failed to collect cloud provider information from config", err) |
Contributor
There was a problem hiding this comment.
nit: error message is repeated here as well
Suggested change
| c.reportError("failed to collect cloud provider information from config", err) | |
| c.reportError("failed to collect cloud provider information from DSN", err) |
cristiangreco
approved these changes
Dec 9, 2025
Contributor
Author
No, we will still use the |
4 tasks
503c518 to
8471f76
Compare
dehaansa
pushed a commit
to iamrajiv/alloy
that referenced
this pull request
Dec 10, 2025
dehaansa
pushed a commit
to madhub/alloy
that referenced
this pull request
Dec 10, 2025
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description
This change adds cloud provider information as labels to all metrics exported by the
database_observabilitycomponents. This enables more effective correlation and attribution across Grafana Cloud.Some of the implementation is duplicated across MySQL and Postgres components. The reasoning being that cloud-providers sometimes vary their naming / URI structure to include engine information. Keeping things strongly tied to the database engine helps make this determination easier.
Which issue(s) this PR fixes
Notes to the Reviewer
PR Checklist