Conversation
Add extended explain plan output metadata for postgres explain plan collector.
internal/component/database_observability/mysql/collector/explain_plans.go
Outdated
Show resolved
Hide resolved
internal/component/database_observability/mysql/collector/explain_plans.go
Outdated
Show resolved
Hide resolved
| Warning *string `json:"warning,omitempty"` | ||
| } | ||
|
|
||
| func ExtractExplainPlanOutputFromLogMsg(lokiEntry loki.Entry) (ExplainPlanOutput, error) { |
Contributor
There was a problem hiding this comment.
If this is used only for testing, maybe could be moved to a shared _test.go file, or we could add a comment that says it's here just for testing.
Refactor sending explain_plan_output
…omLogMsg more apparent
| } | ||
|
|
||
| return output, nil | ||
| return &planNode, nil |
Contributor
There was a problem hiding this comment.
Now that this method has been cut down a lot, perhaps we could just return parseTopLevelPlanNode(logger, qblock)?
cristiangreco
approved these changes
Dec 3, 2025
dehaansa
pushed a commit
to madhub/alloy
that referenced
this pull request
Dec 10, 2025
…ery, showing status and reason. (grafana#4969) * Expand the explain plan output struct * Add extended explain plan output metadata for mysql explain plan collector * Move explain plan output logfmt parser to shared package. Add extended explain plan output metadata for postgres explain plan collector. * Linting, as usual * Fix botched main merge Refactor sending explain_plan_output * Make the purpose of database_observability.ExtractExplainPlanOutputFromLogMsg more apparent * Linting, but it was actually catching some of my bad refactoring * Not necessary to check an error state before returning an err (or nil) * Add changelog update
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 ensures that there is always a log message emitted for each query from the explain plan collector, no matter what the outcome of that explain plan collection was.
This can be used to inform the UI when a query was skipped because it contained a reserved word, for example.
Which issue(s) this PR fixes
Resolves grafana/grafana-dbo11y-app#1735
PR Checklist