Skip to content

[AISOS-2281] Grafana issue detail classifies Task tickets as Bug#204

Merged
eshulman2 merged 1 commit into
forge-sdlc:mainfrom
danchild:forge/aisos-2281
Jul 26, 2026
Merged

[AISOS-2281] Grafana issue detail classifies Task tickets as Bug#204
eshulman2 merged 1 commit into
forge-sdlc:mainfrom
danchild:forge/aisos-2281

Conversation

@danchild

@danchild danchild commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Closes #161

Summary

This PR fixes the Grafana Forge Issue Detail dashboard's Type panel to correctly display all ticket types (Task, Epic, Bug, Feature, etc.) instead of incorrectly classifying non-Feature tickets as "Bug". The root cause was a binary conversion in the SQL query that mapped Feature→1 and everything else→0, combined with value mappings that displayed 0 as "Bug". This fix ensures operators see accurate ticket type information when reviewing traces.

Changes

Dashboard Query Fix

  • Modified devtools/grafana/dashboards/forge-issue-detail.json panel-2 (Type panel)
  • Changed SQL query from binary conversion (if(metadata['ticket_type'] = 'Feature', 1, 0)) to direct value extraction using nullIf(metadata['ticket_type'], '')
  • Removed value mappings that incorrectly mapped numeric values to Bug/Feature labels

Documentation Review

  • Reviewed all documentation files for staleness related to this change
  • No documentation updates required—existing docs describe ticket_type as a metadata field, not the internal panel implementation

Implementation Notes

  • The nullIf(field, '') pattern matches existing conventions used elsewhere in the same dashboard (e.g., line 77 for workflow_step)
  • The minimal fieldConfig with empty defaults and overrides matches the pattern used by panel-3 (Total Traces) in the same file
  • Both the query change and mapping removal are required together—applying only one would result in incorrect display

Testing

  • JSON syntax validation passed (python3 -c "import json; json.load(open(...))")
  • Existing unit tests pass: test_grafana_dashboard_json_is_valid() and test_dashboards_use_configurable_trace_fields()
  • Manual validation requires viewing Task/Epic tickets in the dashboard to confirm correct type display

Related Tickets


Generated by Forge SDLC Orchestrator

Changed the Grafana Forge Issue Detail dashboard Type panel (panel-2)
to display the actual ticket_type value from Langfuse trace metadata
instead of incorrectly converting it to a binary Bug/Feature mapping.

Changes:
- SQL query: Use nullIf(metadata['ticket_type'], '') for direct value
  extraction instead of if(..., 1, 0) binary conversion
- fieldConfig: Remove value mappings (0=Bug, 1=Feature) so the panel
  displays the raw string value (Task, Bug, Feature, Epic, etc.)

The nullIf pattern matches existing dashboard conventions. The minimal
fieldConfig pattern matches panel-3 (Total Traces) in the same file.

Closes: AISOS-2282

@ekuris-redhat ekuris-redhat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix looks correct
Old query used if(metadata['ticket_type'] = 'Feature', 1, 0) a binary that collapsed every non-Feature type to 0, then value mappings displayed 0 as "Bug"
While new query uses nullIf(metadata['ticket_type'], '') returns the actual type string, so the mappings are correctly removed

@eshulman2
eshulman2 merged commit 817d0ff into forge-sdlc:main Jul 26, 2026
6 checks passed
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.

Grafana issue detail classifies Task tickets as Bug

3 participants