add_panel
Add a panel to a Sciple dashboard for visualizing metrics or logs from PromQL, CloudWatch, Elasticsearch, or plain text.
Instructions
Add a panel to a dashboard.
A panel belongs to ONE of five shapes — pick one based on what the user wants and supply only that shape's parameters:
PromQL metric promql=
CloudWatch metric cw_namespace + cw_metric_name + cw_stat (optional cw_dimensions JSON, cw_period)
ElasticSearch/OpenSearch logs panel_type='logs' (or 'log_table') + es_index + optional kql_filter + optional log_* display options
CloudWatch Logs panel_type='logs' (or 'log_table') + cw_log_group + optional cw_filter_pattern + optional log_* display options
Text panel_type='text' + text_content (optional text_background hex color)
ALWAYS pass datasource_id (the observability data source id from the
Sciple UI → Data sources) for metric + log panels — without it the
panel binds to the dashboard's default and may render empty. Text
panels never need a data source.
Recommended panel_type per shape: line / bar / stat / gauge → metric panels logs / log_table → log panels text → text panels
Args:
dashboard_id: The dashboard id to add the panel to.
title: Panel title (1-200 characters).
panel_type: One of: line, bar, stat, gauge, logs, log_table, text.
Defaults to "line".
unit: Display unit string (e.g. "none", "bytes", "percent",
"bits/s"). Defaults to "none".
legend_label: Legend label for metric queries. Ignored for log
panels (use log_columns instead) and text panels.
datasource_id: Id of the observability data source. Required for
metric + log panels.
promql: PromQL expression. Use for shape #1.
cw_namespace, cw_metric_name, cw_stat: CloudWatch metric triple
(e.g. "AWS/EC2", "CPUUtilization", "Average"). Use for shape #2.
cw_dimensions: JSON string of CloudWatch dimensions, e.g.
'[{"Name": "InstanceId", "Value": "i-0abc..."}]'.
cw_period: CloudWatch period in seconds (e.g. 60).
es_index: ElasticSearch / OpenSearch index pattern, e.g.
"production-eks-pods-logs" or "logs-". Use for shape #3.
kql_filter: Optional KQL filter for ES, e.g. 'level:error AND
service:"api"'. Use for shape #3 (paired with es_index).
cw_log_group: CloudWatch Logs log group, e.g. "/aws/lambda/my-fn".
Use for shape #4.
cw_filter_pattern: Optional CloudWatch Logs filter pattern, e.g.
"?ERROR ?WARN" or "[..., status_code=5, ...]". Use for shape
#4 (paired with cw_log_group).
log_columns: Ordered list of column names to display in the log
table, e.g. ["timestamp", "level", "message"]. Defaults to the
editor's default if omitted.
log_limit: Max rows to fetch (defaults match the UI; typical 200).
log_wrap_message: Wrap long log messages (default false).
log_expandable_rows: Allow row expansion (default true).
log_highlight_by_severity: Color rows by severity (default true).
log_live_tail: Enable live-tail mode (default false).
text_content: Markdown body for a text panel. Required when
panel_type='text'.
text_background: Optional CSS color string for the text panel
background, e.g. "#dcfce7", "rgb(220, 252, 231)".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| unit | No | none | |
| title | Yes | ||
| promql | No | ||
| cw_stat | No | ||
| es_index | No | ||
| cw_period | No | ||
| log_limit | No | ||
| kql_filter | No | ||
| panel_type | No | line | |
| log_columns | No | ||
| cw_log_group | No | ||
| cw_namespace | No | ||
| dashboard_id | Yes | ||
| legend_label | No | ||
| text_content | No | ||
| cw_dimensions | No | ||
| datasource_id | No | ||
| log_live_tail | No | ||
| cw_metric_name | No | ||
| text_background | No | ||
| log_wrap_message | No | ||
| cw_filter_pattern | No | ||
| log_expandable_rows | No | ||
| log_highlight_by_severity | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |