Skip to content

fix(mcp): resolve attribute scope and explain empty results - #1227

Merged
Makisuo merged 8 commits into
fix/mcp-metric-countersfrom
fix/mcp-attribute-scope-matching
Oct 3, 2026
Merged

Makisuo merged 8 commits into
fix/mcp-metric-countersfrom
fix/mcp-attribute-scope-matching

Merge fix/mcp-metric-counters into fix/mcp-attribute-scope-matching

6bbb4ea
Select commit
Loading
Failed to load commit list.
Maple Review Bot / Maple / review completed Oct 3, 2026 in 8m 21s

Confidence 3/5 · No issues found

🟡 Confidence 3/5 · needs attention
quality 98/100 · 1 note · tests partial · risk medium · 3/3 new units observable

Warning

This review ended early; what follows is what it established.

Resolves attribute_key to span or resource scope across query_data/search_traces, teaches traces and metrics a resource-attribute group-by, adds an environment filter and service-scoped wrappers to explore_attributes, and adds "did you mean" hints on empty results. The new pipe params are all consumed downstream. One test file, packages/query-engine/src/ch/queries/metrics.test.ts, was not read.

  • normalizeGroupBy accepts query_data's group-by spellings in create-dashboard
  • search_traces gains an environment filter and resource-attribute key resolution
  • serviceScopedAttributeKeysQuery/serviceScopedAttributeValuesQuery back explore_attributes with a service
  • Empty results return emptyHints with close matches for service, environment and attribute key

Still open from earlier reviews

What was checked
  • resource_filter_key/resource_filter_value, deployment_env and resource_attribute_filters are consumed at pipe-dispatch.ts:223, :231, :829
  • explore-attributes.ts:100,141 already forwards service_name, so the service-scoped pipe branches are reachable
  • errors_by_type consumers read deployment_envs (pipe-dispatch.ts:486), matching the find-errors hint params
Observability coverage: 3 of 3 changes observable
Change Kind Observable Evidence
query_data attribute-scope resolution outbound warehouse query yes Effect.fn span in attribute-scope.ts; queries via exploreAttributeKeys/WarehouseExecutor
emptyResultHints lookups outbound warehouse query yes Effect.withSpan("McpTool.emptyResultHints") in empty-result-hints.ts
search_traces environment filter inbound param + warehouse query yes deployment_env consumed at pipe-dispatch.ts:223 and :829
Files not reviewed (1)

The review ended before it read these diffs, so nothing above vouches for them.

  • packages/query-engine/src/ch/queries/metrics.test.ts

6bbb4ea · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.