Exact enum values for create-graph and preview-graph
Load this file when you're about to call create-graph or preview-graph. Use the other values exactly as written; only productType accepts any casing.
productType (required)
One of these; the graph tools accept any casing, and PascalCase is conventional:
LogsTracesErrorsSessionsMetricsPAEvents(product-analytics events: custom events withtype="track" key="<name>", page or screen views withtype="*_view" view_name="<path>")Events(legacy session_events source, filtered withevent="<name>")
expressions (required, list of objects)
Each expression MUST have both keys:
{
"aggregator": "Count",
"column": ""
}aggregator values
CountCountDistinctCountDistinctKeyMinAvgP50P90P95P99MaxSum
Do NOT use count_distinct, Count_distinct, countdistinct, or any snake_case variant. It's CountDistinct — PascalCase, no underscore.
column is always required
Even for Count where no column is needed. Pass an empty string:
{"aggregator": "Count", "column": ""}Omitting column crashes the call with an argument-validation error.
type (graph chart type)
Line chartBar chartTable
bucketBy
Default: Timestamp. Usually fine to omit or leave as default. For non-time aggregations (e.g., grouping by service across a fixed window), omit bucketBy and rely on groupBy.
get-keys argument formats
Different from create-graph — get-keys wants lowercase productType and full ISO timestamps:
productType: lowercase —logs,traces,sessions,errors,metrics,paevents,eventsstartDate/endDate: full ISO with time component —2026-03-04T00:00:00Z, not date-only2026-03-04
The graph tools take productType in any case; get-keys needs it lowercase.
Quick sanity check
Before calling create-graph, re-read your arguments:
projectKeypresent? ✓productTypeone of the values above? ✓expressionsis a list of objects each withaggregatorandcolumn? ✓aggregatoris PascalCase (no underscore)? ✓columnpresent even forCount? ✓
If any answer is no, fix it before calling. API errors are expensive round-trips.