Agent skill

Gram Telemetry Query Dimensions

by speakeasy-api in speakeasy-api/gram

How to add a new attribute value (dimension) that the generic org-scoped telemetry.query analytics endpoint can group by and filter on.

AGPL-3.0Auto-check passedDatabases

Install Gram Telemetry Query Dimensions

skills CLI
$ npx skills add speakeasy-api/gram --skill gram-telemetry-query-dimensions -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install speakeasy-api/gram gram-telemetry-query-dimensions --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/speakeasy-api/gram.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/gram-telemetry-query-dimensions .claude/skills/gram-telemetry-query-dimensions && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
gram-telemetry-query-dimensions
GitHub stars
272
Token cost
~2.4k tokens
SKILL.md length
940 words
Files
1
Skills in repo
39
Repo updated
First seen
Licence
AGPL-3.0

At a glance

How to add a new attribute value (dimension) that the generic org-scoped telemetry.query analytics endpoint can group by and filter on.

  • Works in 5 steps: ClickHouse schema + migration → Goa design allowlist → Repo registry → …
  • Tasks that involve Data warehousing
  • SKILL.md covers What this covers, The four layers (keep them in…, Pick the dimension kind and Step-by-step, plus 1 more section
  • Calls mise

What it does

Gram Telemetry Query Dimensions is an agent skill from speakeasy-api/gram. How to add a new attribute value (dimension) that the generic org-scoped telemetry.query analytics endpoint can group by and filter on. Activate whenever the task is to expose a new breakdown/filter axis (e.g. department, jobtitle, model, provider, a new WorkOS directory attribute or request attribute) in telemetry.query, or mentions the attributemetricssummaries materialized view, queryDimensions, or attributeDimensionRegistry.

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Databases, covering Data warehousing. It works with WorkOS and ClickHouse. The repository describes itself as: Securely scale AI usage across your organization. A single stack to Connect, Secure, Observe and Distribute agents, MCPs, and Skills within your company. The licence is AGPL-3.0.

When your agent uses it

  • Tasks that involve Data warehousing

Example prompts

  • “/gram-telemetry-query-dimensions”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. ClickHouse schema + migration
  2. Goa design allowlist
  3. Repo registry
  4. Regenerate + verify
  5. Tests

What it can do on your machine

Read from SKILL.md and the folder at commit ad78247. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • mise

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Gram Telemetry Query Dimensions loads about 2.4k tokens when it runs. Until then it costs about 117 tokens; SKILL.md has 940 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~117
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from speakeasy-api/gram at commit ad78247, republished under its AGPL-3.0 licence (© speakeasy-api). 940 words, ~2,382 tokens.

Download SKILL.mdSave it as .claude/skills/gram-telemetry-query-dimensions/SKILL.md (or your agent's skills folder).
name
gram-telemetry-query-dimensions
description
How to add a new attribute value (dimension) that the generic org-scoped telemetry.query analytics endpoint can group by and filter on. Activate whenever the task is to expose a new breakdown/filter axis (e.g. department, job_title, model, provider, a new WorkOS directory attribute or request attribute) in telemetry.query, or mentions the attribute_metrics_summaries materialized view, queryDimensions, or attributeDimensionRegistry.

What this covers

telemetry.query (POST /rpc/telemetry.query) is a generic, org-scoped analytics endpoint. It groups pre-aggregated usage metrics by an allowlisted dimension and filters on those same dimensions. This skill explains how to add a new dimension (a new attribute value to group/filter by).

Dimensions vs. measures. A dimension is a breakdown/filter axis (department_name, model, role). A measure is a number being aggregated (total_cost, total_tokens). This skill is about dimensions only. Adding a new measure is a different (parallel) path through the same files — queryMeasures, attributeMeasureSelects, AttributeMetricsMeasures, QueryMeasures.

Everything is backed by one ClickHouse AggregatingMergeTree, attribute_metrics_summaries, fed by attribute_metrics_summaries_mv. Each dimension is one column on that table. The query layer never sees raw JSON paths or SQL from clients — dimensions are a closed allowlist validated at three layers that must stay in sync.

Activate the clickhouse skill (schema/MV work) and golang skill (repo/service edits) alongside this one.

The four layers (keep them in sync)

A dimension key like department_name must appear in all four places. Adding a new one means touching each:

LayerFileWhat to add
1. ClickHouse schemaserver/clickhouse/schema.sqla column on attribute_metrics_summaries, the matching SELECT + GROUP BY in attribute_metrics_summaries_mv, and the column in the table's ORDER BY sorting key
2. Goa design allowlistserver/design/telemetry/design.gothe public key string in queryDimensions
3. Repo registryserver/internal/telemetry/repo/attribute_metrics.goan attributeDimensionRegistry entry mapping the public key → column + kind
4. Generated code(run gen tasks)regenerate Goa server + SDK

dimension_values (the per-group distinct-value lists on each QueryRow) is automatic — it iterates attributeDimensionRegistry, so a new dimension shows up there with no extra code.

Pick the dimension kind

The repo classifies every dimension as one of three attributeDimensionKinds. This drives how it is grouped and filtered:

  • attributeDimScalar — one string value per row (e.g. department_name, model). Group: plain column. Filter: IN.
  • attributeDimArray — Array(String), multiple values per user/row (e.g. roles, groups). Group: arrayJoin() (attributes spend to each element). Filter: hasAny(). Stored intact in the sorting key (one array per row) so it does not multiply row count.
  • attributeDimProject — the gram_project_id UUID key column; grouped via toString().

Most new identity/request attributes are scalar. Use array only when the attribute is genuinely list-valued per user.

Cardinality. The MV stays cheap because every scalar dimension is functionally determined by the user (one department, one job title per user), so adding one does not multiply rows. Do not add a high-cardinality, per-event scalar (e.g. a raw request id) as a dimension — it would explode the aggregate.

Step-by-step

1. ClickHouse schema + migration

Edit server/clickhouse/schema.sql. For a scalar dimension foo derived from a log attribute attributes.user.attributes.foo:

  1. Add the column to the attribute_metrics_summaries table:
    sql
    foo String,
  2. Add the derived SELECT to attribute_metrics_summaries_mv and the column to its GROUP BY:
    sql
    -- in the SELECT list
    toString(attributes.user.attributes.foo) AS foo,
    -- ...and in GROUP BY
    GROUP BY gram_project_id, time_bucket, department_name, ..., foo;
    (Array dimensions use CAST(attributes.user.foo AS Array(String)) AS foo. If a materialized column already exists on telemetry_logs — e.g. user_email, hook_source — reference it directly instead of re-deriving from JSON.)
  3. Add the column to the table's ORDER BY sorting key (scalar columns slot in with the other identity dimensions; array columns go at the end alongside roles, groups). The sorting key keeps cardinality bounded.

Then generate the migration (this is a ClickHouse migration, governed by the same expand/contract rules as Postgres — see the migration rules in CLAUDE.md):

sh
mise clickhouse:diff add-foo-attribute-dimension

Atlas diffs schema.sql and emits the migration into server/clickhouse/migrations/ (and the golang-migrate copy), then auto-runs clickhouse:gen-materialized-cols. Never hand-edit the generated migration or atlas.sum.

MV recreation + backfill. Changing the MV's SELECT/GROUP BY and the table sorting key makes Atlas drop and recreate the MV. The MV only transforms rows ingested after it exists — historic rows are not re-aggregated, so the new column reads empty ('') for old buckets. That is acceptable (data ages out at the 30-day TTL); call it out in the PR. Run migrations against local DBs only.

Show full SKILL.md (322 more words)Show less
2. Goa design allowlist

In server/design/telemetry/design.go, add the public key to queryDimensions:

go
var queryDimensions = []any{
    "department_name",
    // ...
    "foo", // <-- new
}

This single slice feeds the Enum(...) on both QueryPayload.group_by and QueryFilter.dimension, so the new key becomes a valid group-by and filter value automatically. (The public key need not equal the column name — email maps to user_email.)

3. Repo registry

In server/internal/telemetry/repo/attribute_metrics.go, add the mapping to attributeDimensionRegistry (public key → safe column expression + kind):

go
var attributeDimensionRegistry = map[string]attributeDimension{
    // ...
    "foo": {column: "foo", kind: attributeDimScalar},
}

This is the only place a key maps to a real column, and it is what keeps client input from ever reaching SQL as a raw path. The registry powers grouping, filtering, and the dimension_values map — so once it's here, the new dimension's distinct values automatically appear in every group's dimension_values.

Keep queryDimensions (design) and attributeDimensionRegistry (repo) in sync. A key in the Enum without a registry entry returns unknown group_by/filter dimension at runtime; a registry entry not in the Enum is unreachable.

4. Regenerate + verify
sh
mise gen:goa-server   # regenerate Goa types/openapi from the design
mise gen:sdk          # regenerate the TypeScript SDK from the OpenAPI spec

Then:

sh
mise build:server
mise lint:server
aube run -F dashboard type-check
5. Tests
  • Unit (query_internal_test.go): buildQueryResult is dimension-agnostic; add coverage only if you changed rollup behavior.
  • Integration (query_test.go, requires ClickHouse): insertAttributeUsageLog writes a telemetry row. Add your attribute to the inserted JSON, then assert the new dimension groups/filters and appears in dimension_values. Group-by assertions wait on require.Eventually because the MV is eventually consistent.
sh
mise run test:server ./internal/telemetry/ -run TestQuery -count=1

Gotchas

  • Sorting-key drift. The migration's ORDER BY must match schema.sql exactly, or Atlas will want to rebuild the table. Let clickhouse:diff generate it; don't hand-write.
  • Empty values are filtered. dimension_values drops '', so unset attributes show as an empty list. Grouping by a dimension where the attribute is unset surfaces under the '' group (and array dimensions map an empty array to a single '' element so role-less spend isn't dropped).
  • Don't add measures here. If the request is really "expose a new number to aggregate," that's the measures path, not a dimension.
  • Aggregate read combinators. Measure columns are *If aggregate states and must be read with the matching *IfMerge combinators (see attributeMeasureSelects). Dimensions are plain columns and need none of this.

© speakeasy-api, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/gram-telemetry-query-dimensions of speakeasy-api/gram.

Open the folder on GitHubat commit ad78247

Compare with similar skills

Gram Telemetry Query Dimensions next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Gram Telemetry Query Dimensions compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Gram Telemetry Query Dimensions this skillspeakeasy-api/gram272—~2.4kAutomated safety check: PassAGPL-3.0
Keeper Stress AnalysisClickHouse/ClickHouse50k—~4.7kAutomated safety check: PassApache-2.0
Perf ComparisonClickHouse/ClickHouse50k—~3.9kAutomated safety check: NotesApache-2.0
Patch Release CheckClickHouse/ClickHouse50k—~4kAutomated safety check: NotesApache-2.0
Clickhouse Architecture Advisorvemetric/vemetric3942 repos~791Automated safety check: PassApache-2.0
Decompress BinaryClickHouse/ClickHouse50k—~1.1kAutomated safety check: PassApache-2.0

Similar skills

  • Keeper Stress Analysis

    ClickHouse/ClickHouse

    Analyze ClickHouse Keeper stress-test results from play.clickhouse.com / keeperstresstests data warehouse.

    50k GitHub stars~4.7k tokensUpdated today
    DatabasesAuto-check passed
  • Perf Comparison

    ClickHouse/ClickHouse

    Evaluate ClickHouse performance test results from existing CI/dashboard data or local perf.py runs.

    50k GitHub stars~3.9k tokensUpdated today
    DatabasesAuto-check: notes
  • Patch Release Check

    ClickHouse/ClickHouse

    Check whether ClickHouse's supported versions (last 3 majors + latest LTS) have recent stable patch releases, diagnose why the scheduled AutoReleases pipeline failed, and identify which releases…

    50k GitHub stars~4k tokensUpdated today
    DatabasesAuto-check: notes
  • MUST USE when designing ClickHouse architectures, selecting between ingestion or modeling patterns, or translating best practices into workload-specific system designs.

    394 GitHub starsUsed in 2 repos~791 tokens
    DatabasesAuto-check passed
  • Decompress Binary

    ClickHouse/ClickHouse

    Extract the inner ELF from a ClickHouse self-extracting clickhouse binary, including when its architecture differs from the host (e.g.

    50k GitHub stars~1.1k tokensUpdated today
    DatabasesAuto-check passed
  • Good PRs

    ClickHouse/ClickHouse

    Show a report of open ClickHouse PRs whose only non-green CI check is "CH Inc sync" (or that are fully green) — i.e.

    50k GitHub stars~1.8k tokensUpdated today
    DatabasesAuto-check passed

More from speakeasy-api/gram

All 39 skills in this repo
  • Gram Playwright CLI

    speakeasy-api/gram

    A skill your agent uses when automating the Gram dashboard in a browser, capturing screenshots, inspecting pages.

    272 GitHub stars~3.4k tokensUpdated today
    Auto-check passed
  • Transactional Email

    speakeasy-api/gram

    A skill your agent uses when adding, changing, restyling, reviewing, validating, or previewing a Gram/Speakeasy transactional email, in Go or in LMX/MJML — a template<name.go, a TemplateKey…

    272 GitHub stars~4.7k tokensUpdated today
    Auto-check passed
  • Admin Shadcn

    speakeasy-api/gram

    A skill your agent uses when adding, changing, or styling UI in client/admin (the Gram admin dashboard) that touches shadcn/ui — a button, dialog, table, sidebar, badge, select, tabs, tooltip, card…

    272 GitHub stars~1k tokensUpdated today
    Auto-check passed
  • A skill your agent uses when adding, editing, reviewing, testing, or locating a reviewed skill distributed with the Platform MCP plugin; triggers include "Platform MCP skill", "platformmcpskills"…

    272 GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Clickhouse

    speakeasy-api/gram

    A skill your agent uses when changing or reviewing Gram ClickHouse schemas, migrations, queries, inserts, access principals, bootstrap SQL, Cloud compatibility, partial migration failures, or…

    272 GitHub stars~3.2k tokensUpdated today
    Auto-check passed
  • Feature Flag

    speakeasy-api/gram

    A skill your agent uses when gating a feature behind a flag, dogfooding or gradually rolling out a change, choosing between productfeatures and PostHog feature flags, adding or checking a product…

    272 GitHub stars~2.6k tokensUpdated today
    Auto-check passed

Categories

Questions about Gram Telemetry Query Dimensions

What does Gram Telemetry Query Dimensions do?

How to add a new attribute value (dimension) that the generic org-scoped telemetry.query analytics endpoint can group by and filter on. Gram Telemetry Query Dimensions is an agent skill from speakeasy-api/gram.query analytics endpoint can group by and filter on.

When should I use Gram Telemetry Query Dimensions?

Gram Telemetry Query Dimensions fits situations like: tasks that involve Data warehousing.

How do I install Gram Telemetry Query Dimensions in Claude Code?

Run `npx skills add speakeasy-api/gram --skill gram-telemetry-query-dimensions -a claude-code`. Or copy the skill folder (.agents/skills/gram-telemetry-query-dimensions in speakeasy-api/gram) into .claude/skills/gram-telemetry-query-dimensions in your project. Claude Code loads it when a task matches its description.

How do I install Gram Telemetry Query Dimensions in Codex?

Run `npx skills add speakeasy-api/gram --skill gram-telemetry-query-dimensions -a codex`. Or copy the skill folder (.agents/skills/gram-telemetry-query-dimensions in speakeasy-api/gram) into .agents/skills/gram-telemetry-query-dimensions in your project. Codex loads it when a task matches its description.

Can I use Gram Telemetry Query Dimensions in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add speakeasy-api/gram --skill gram-telemetry-query-dimensions -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/gram-telemetry-query-dimensions, .gemini/skills/gram-telemetry-query-dimensions, .github/skills/gram-telemetry-query-dimensions and .opencode/skills/gram-telemetry-query-dimensions in your project.

What does Gram Telemetry Query Dimensions need to run?

Going by SKILL.md and its folder, Gram Telemetry Query Dimensions needs the command-line tools its instructions call (mise).

Does Gram Telemetry Query Dimensions access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Gram Telemetry Query Dimensions safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Gram Telemetry Query Dimensions use?

Gram Telemetry Query Dimensions is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Gram Telemetry Query Dimensions use?

About 2.4k tokens (SKILL.md is roughly 9.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Gram Telemetry Query Dimensions?

Skills that share tags, products or a category with Gram Telemetry Query Dimensions: Keeper Stress Analysis (ClickHouse/ClickHouse, 50k stars), Perf Comparison (ClickHouse/ClickHouse, 50k stars), Patch Release Check (ClickHouse/ClickHouse, 50k stars) and Clickhouse Architecture Advisor (vemetric/vemetric, 394 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Gram Telemetry Query Dimensions?

speakeasy-api (a GitHub organization) maintains it in speakeasy-api/gram, which has 272 GitHub stars. The repository holds 39 skills in this directory. The repository was last updated on October 8, 2026.

Source: speakeasy-api/gram on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.