Skip to content

Fix parameter filtering in the batch telemetry sample dashboard - #21

Open
Kenny Saelen (kennysaelen) wants to merge 3 commits into
mainfrom
kesaelen-batch-job-occurrence-additions
Open

Kenny Saelen (kennysaelen) wants to merge 3 commits into
mainfrom
kesaelen-batch-job-occurrence-additions

Conversation

@kennysaelen

@kennysaelen Kenny Saelen (kennysaelen) commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

The Environment Id, Batch Job Id and Activity Id parameters on the batch dashboard did not filter correctly. Most of the issues were field-name casing mismatches between the tile queries and the values the parameter lookup queries actually return, which caused tiles to silently return no rows when a parameter was selected.

Fixed

  • Environment Id matched nothing and blanked all 13 tiles. Tiles filtered on customDimensionsParsed.EnvironmentId, but the emitted field is environmentId (lowercase e) — the casing the parameter's own lookup query already reads.
  • The Batch Infolog Errors query failed outright on cvustomDimensionsParsed.EnvironmentId, an undefined identifier — an error rather than an empty result.
  • The Batch server #tasks execution spread pie blanked on job selection, reading customDimensionsParsed.batchJobId where the emitted field is BatchJobId.
  • Environment Id ignored multi-select. Declared selectionType: array, but filtered with scalar == _environmentId; correct for one selection, wrong for several. Now in (_environmentId).
  • The Activity Id parameter did nothing — declared but referenced by no tile. Now applied to Batch execution history, which already exposed an ActivityId column.
  • The Activity Id value list came from pageViews, client/UI telemetry with no batch activity ids, so the picker offered values that could never match. Now sourced from batch customEvents.
  • The Environment Id value list ignored the dashboard time range, being hardcoded to ago(7d) .. now(). With a wider time range, environments present only in the older window were missing from the picker even though the tiles filtered on them correctly. All 16 queries now share the dashboard time range.

Changed

  • Batch Job Id now supports multi-select (scalararray). No query changes were required — the filtering tiles already used in (_batchJobId).
  • The Activity Id value list now includes BatchJobStart and BatchJobFinished, so activity ids appearing only on job-level events are selectable.

Added

  • Dashboards/AzureDataExplorer/CHANGELOG.md, seeded with the above.

Result

All three parameters are now consistent: array selection with includeAllOption, in (...) membership filters guarded by isempty(), and lookup queries bound to the dashboard time range.

Note: the ADX query editor may report a semantic error on _startTime / _endTime in a parameter lookup query until that query has been run once from within the parameter editor. The variables do resolve correctly at runtime.

Note for reviewers

With Batch Job Id multi-select enabled, Batch server #tasks execution spread and Batch execution history aggregate across all selected jobs.

Verified by importing the dashboard into Azure Data Explorer.

The Environment Id, Batch Job Id and Activity Id parameters did not filter
correctly. Most issues were field-name casing mismatches between the tile
queries and the values the parameter lookup queries return, so tiles silently
returned no rows when a parameter was selected.

Fixed:
- Environment Id matched nothing and blanked all 13 tiles: tiles filtered on
  customDimensionsParsed.EnvironmentId but the emitted field is environmentId.
- Batch Infolog Errors query failed outright on cvustomDimensionsParsed typo.
- Batch server #tasks execution spread blanked on job selection, reading
  customDimensionsParsed.batchJobId where the emitted field is BatchJobId.
- Environment Id ignored multi-select: declared as array but filtered with
  scalar equality. Now uses in (_environmentId).
- Activity Id parameter had no effect - declared but referenced by no tile.
  Now applied to the Batch execution history tile.
- Activity Id value list came from pageViews, which carries no batch activity
  ids. Now sourced from batch customEvents.
- Environment Id value list was hardcoded to ago(7d) .. now(), hiding
  environments outside a 7-day window. Now bound to the dashboard time range.

Changed:
- Batch Job Id now supports multi-select; filters already used in ().
- Activity Id value list includes BatchJobStart and BatchJobFinished.

Added:
- Dashboards/AzureDataExplorer/CHANGELOG.md

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Parameter lookup queries cannot reference the Time range parameter variables
_startTime / _endTime - those resolve only in tile queries - so a lookup using
them fails to compile with a semantic error.

- Batch Job Id lookup referenced them and was already broken before this branch.
- Environment Id lookup was moved onto them earlier in this branch, mistaking
  the original ago(7d) window for an oversight rather than a deliberate
  workaround. Reverted.
- Activity Id lookup, rewritten earlier in this branch, had the same problem.

All three lookups now use a fixed ago(7d) .. now() window. Changelog corrected
accordingly.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Reverts the previous commit. The semantic error on _startTime / _endTime in the
parameter lookup queries was the ADX query editor validating before the query
had been run once from within the parameter editor - not a real scope
limitation. The variables resolve correctly at runtime, confirmed by import
testing.

All three lookups (Activity Id, Batch Job Id, Environment Id) are back on
_startTime .. _endTime, so all 16 queries share the dashboard time range.
Changelog restored and annotated with the editor caveat.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant