elastic / elastic/observability-migration-platform
[Datadog] distribution widgets: query under request_type:histogram not extracted (panel falsely "no queries found in widget")
- Dominant language
- Python
- Stars
- 6
- Forks
- 8
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 23
Description
## Summary
Datadog `distribution` widgets whose query lives under a `request_type: "histogram"` request are migrated as a `requires_manual` placeholder with the reason **"no queries found in widget"**, even though the widget contains a valid metric query. The query is never collected, so the reason is factually wrong and the query information is lost.
## Affected dashboard(s)
- `rabbitmq` (`rabbitmq/assets/dashboards/rabbitmq_dashboard.json`) — panel **"Distribution of Message Size"**.
- Class of bug: any Datadog `distribution` widget.
## Environment
- Migration tool: `obs-migrate` (files mode, `--field-profile otel`, `--data-view metrics-*`).
- Target: local Kibana **9.5.0** (build 105158, snapshot) / Elasticsearch **9.5.0-SNAPSHOT**.
## Reproduction
1. Migrate the RabbitMQ OpenMetrics dashboard in files mode and upload to the local Kibana instance.
2. Inspect `migration_report.json` for "Distribution of Message Size", or open the panel in Kibana.
## Expected
The widget contains a valid metric query, so it should translate (XY/distribution) or, if `distribution` is genuinely unsupported, degrade with an honest reason (e.g. "distribution widget type not supported").
## Actual
Panel degrades to a `requires_manual` markdown placeholder with `reasons=["no queries found in widget"]` and `source_queries=[]`.
Source widget:
```json
{
"title": "Distribution of Message Size",
"type": "distribution",
"requests": [
{ "request_type": "histogram",
"query": { "data_source": "metrics", "name": "query1", "aggregator": "avg",
"query": "avg:data_streams.payload_size{type:rabbitmq,topic:*}" } }
]
}
```
## Evidence
The Kibana placeholder shows only "Original widget type: distribution / Migration status: requires_manual" with no query, unlike sibling placeholders that echo their query.
## Suspected root cause
The widget→query normalizer does not read `requests[].query` for `request_type: "histogram"` (distribution) widgets, leaving `widget.queries` empty. `planner.py` then takes the "widget has no queries" branch and emits `reasons=["no queries found in widget"]`.
Contributor guide
Research direction
Start with the widget-to-query normalizer and planner.py, using the RabbitMQ dashboard at rabbitmq/assets/dashboards/rabbitmq_dashboard.json as the reproduction input. Run the files-mode migration with the stated field profile and data view, then verify that the distribution widget's query appears in migration_report.json and that unsupported widgets receive an accurate reason.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100