Skip to content

export MathExpression type - #7377

Merged
ie-pham merged 1 commit into
grafana:mainfrom
ie-pham:traceql-lbac-rebuild-expr-keys
Jun 4, 2026
Merged

export MathExpression type#7377
ie-pham merged 1 commit into
grafana:mainfrom
ie-pham:traceql-lbac-rebuild-expr-keys

Conversation

@ie-pham

@ie-pham ie-pham commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

What this PR does:

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • Changelog entry added under .chloggen/ (run make chlog-new, or make chlog-new FILENAME=<name> to override the default branch-name file; see .chloggen/README.md)

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 exports the metrics math expression AST node in pkg/traceql so it can be referenced as a public type, and updates internal callers accordingly.

Changes:

  • Rename mathExpression to MathExpression and export RewriteKeys.
  • Update AST rewriting call sites to use RewriteKeys.
  • Add (*RootExpr).Expression() accessor returning *MathExpression.

Reviewed changes

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

File Description
pkg/traceql/lenient_parser.go Updates key-rewrite call to the exported RewriteKeys method.
pkg/traceql/ast.go Switches RootExpr.expression to *MathExpression and adds an exported Expression() accessor.
pkg/traceql/ast_rewriter.go Updates expression key rewrite call to RewriteKeys.
pkg/traceql/ast_metrics_math.go Exports MathExpression type and RewriteKeys method; updates internal references accordingly.
@ie-pham
ie-pham merged commit 06e0386 into grafana:main Jun 4, 2026
31 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants