create-graph

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Create graphs and dashboards

创建图表与仪表板

Prerequisites

前提条件

This skill uses the following LaunchDarkly MCP tools:
  • preview-graph
    — render a chart preview inline without saving it
  • create-graph
    — add a chart to an existing dashboard
  • create-dashboard
    — create a new empty dashboard
  • list-dashboards
    — list existing dashboards
  • get-dashboard
    — get the full config of a dashboard, including its graphs
  • get-keys
    — discover available metrics, attributes, and keys for a product type
All of these tools require a
projectKey
(e.g.
"default"
).
本Skill使用以下LaunchDarkly MCP工具:
  • preview-graph
    — 在线渲染图表预览,不保存
  • create-graph
    — 向现有仪表板添加图表
  • create-dashboard
    — 创建新的空仪表板
  • list-dashboards
    — 列出现有仪表板
  • get-dashboard
    — 获取仪表板的完整配置,包括其包含的图表
  • get-keys
    — 发现产品类型可用的指标、属性和键
所有这些工具都需要
projectKey
(例如
"default"
)。

Overview

概述

You are building observability graphs. Your tools are precise — get the enum values wrong and the API rejects the call. Always use
get-keys
before building a query to confirm the dimension names are real.
你正在构建可观测性图表。你的工具非常精准——枚举值错误会导致API拒绝调用。构建查询前务必使用
get-keys
确认维度名称是真实存在的。

Capabilities

功能

  • list-dashboards
    — list existing dashboards to check for duplicates or find a target
  • get-dashboard
    — get the full config of an existing dashboard, including its graphs
  • create-dashboard
    — create a new dashboard
  • preview-graph
    — render a chart preview inline
  • create-graph
    — add a chart to a dashboard
  • get-keys
    — discover available metrics, attributes, and keys for a product type
When the user's request is purely about visualizing data, stay on task — don't reach for unrelated tools.
  • list-dashboards
    — 列出现有仪表板,检查重复项或找到目标仪表板
  • get-dashboard
    — 获取现有仪表板的完整配置,包括其包含的图表
  • create-dashboard
    — 创建新仪表板
  • preview-graph
    — 在线渲染图表预览
  • create-graph
    — 向仪表板添加图表
  • get-keys
    — 发现产品类型可用的指标、属性和键
当用户的请求仅涉及数据可视化时,请专注于任务——不要使用无关工具。

Workflow

工作流程

  1. Identify the target dashboard. If the user already has a specific dashboard in mind (by ID or name), add graphs to it directly. Otherwise, call
    list-dashboards
    and offer to target an existing one or create a new one with
    create-dashboard
    .
  2. Discover the data shape. Call
    get-keys
    for the relevant product type before building a query. Attribute names vary across services —
    service_name
    vs
    service.name
    vs
    serviceName
    . Guessing wastes tool calls.
  3. For ambiguous requests, ask a brief clarifying question as regular text. Example: "I found several latency-related keys. Would you like P50 or P95 latency, and should I group by service name?" Keep clarifications short — one or two questions max. For minor ambiguity (chart type preference), make a reasonable default and note your assumption.
  4. Preview before committing. Call
    preview-graph
    first, show the user an inline preview, and confirm before calling
    create-graph
    . For multiple graphs, preview and confirm each one individually.
  5. Create the graph with
    create-graph
    . Use exact enum casing from
    enums.md
    .
  6. Confirm what was created — provide the dashboard URL and a one-line description of what the graph shows.
  1. 确定目标仪表板。如果用户已有特定的仪表板(通过ID或名称),直接向其中添加图表。否则,调用
    list-dashboards
    ,并提供选择现有仪表板或使用
    create-dashboard
    创建新仪表板的选项。
  2. 发现数据结构。构建查询前,为相关产品类型调用
    get-keys
    。不同服务的属性名称有所不同——例如
    service_name
    service.name
    serviceName
    。猜测会浪费工具调用次数。
  3. 对于模糊请求,提出简短的澄清问题,以普通文本形式发送。示例:“我找到了几个与延迟相关的键。你需要P50还是P95延迟,是否要按服务名称分组?” 澄清内容要简短——最多1-2个问题。对于轻微模糊的情况(如图表类型偏好),做出合理的默认选择并说明你的假设。
  4. 提交前预览。先调用
    preview-graph
    ,向用户展示在线预览,确认后再调用
    create-graph
    。对于多个图表,逐个预览并确认。
  5. 创建图表,使用
    create-graph
    。使用
    enums.md
    中的精确枚举大小写。
  6. 确认创建内容——提供仪表板URL和图表内容的一行描述。

Duplicating existing graphs

复制现有图表

When asked to duplicate or copy a graph, call
get-dashboard
to retrieve the full configuration (expressions, product type, query, groupBy, display settings), then replicate those values in
create-graph
. Do not guess from the graph title alone — titles drift from the underlying config.
当要求复制图表时,调用
get-dashboard
检索完整配置(表达式、产品类型、查询、groupBy、显示设置),然后在
create-graph
中复制这些值。不要仅根据图表标题猜测——标题可能与底层配置不一致。

Guidelines

指南

  • Be concise — don't narrate intermediate tool calls. Skip prefaces like "First, let me discover the keys" or "Now I'll build the chart." One short sentence at the start of the reply is enough if needed (e.g. "Building a chart of recent logs by level."); after that, just call the tools.
  • Prefer multiple focused graphs over one complex graph. A dashboard with 3 clean graphs beats one graph with 5 overlapping expressions.
  • Always call
    get-keys
    before building a query.
    Prevents silent empty results from wrong field names.
  • 保持简洁——不要叙述中间工具调用。跳过诸如“首先,让我发现可用的键”或“现在我将构建图表”之类的开场白。如果需要,回复开头用一句简短的话即可(例如“正在构建近期日志按级别分类的图表。”);之后直接调用工具。
  • 优先选择多个聚焦的图表,而非一个复杂图表。包含3个简洁图表的仪表板优于包含5个重叠表达式的单个图表。
  • 构建查询前务必调用
    get-keys
    。避免因字段名称错误导致的静默空结果。

Chart-type picks

图表类型选择

  • Line chart
    — time-series trends. Error rates over time, latency percentiles, request volume.
  • Bar chart
    (or histogram) — comparisons across a dimension. Errors by service, requests by endpoint.
  • Table
    — detailed breakdowns with multiple dimensions where a chart wouldn't convey the detail.
  • Line chart
    — 时间序列趋势。例如随时间变化的错误率、延迟百分位数、请求量。
  • Bar chart
    (或直方图)——跨维度的对比。例如按服务划分的错误数、按端点划分的请求数。
  • Table
    — 多维度的详细分解,图表无法传达这些细节。

Aggregators

聚合器

  • Count
    — total events (most common). Requires
    column=""
    (empty string).
  • CountDistinct
    — unique values. Users, sessions, flag keys.
  • Avg
    ,
    P50
    ,
    P90
    ,
    P95
    ,
    P99
    — latency distributions.
  • Sum
    — numeric totals (payload size, revenue).
  • Count
    — 事件总数(最常用)。需要
    column=""
    (空字符串)。
  • CountDistinct
    — 唯一值。例如用户、会话、标志键。
  • Avg
    P50
    P90
    P95
    P99
    — 延迟分布。
  • Sum
    — 数值总计(例如负载大小、收入)。

Common mistakes

常见错误

  • Using lowercase
    sessions
    for
    productType
    . It's
    Sessions
    — PascalCase. See
    enums.md
    .
  • Omitting
    column
    on a
    Count
    expression. The API requires it; pass empty string
    ""
    .
  • Using
    count_distinct
    or
    Count_distinct
    . It's
    CountDistinct
    — PascalCase, no underscore.
  • Building a query without
    get-keys
    first and getting empty results because the attribute name was wrong.
  • Using date-only format (
    2026-03-04
    ) for
    get-keys
    . Needs full ISO with time:
    2026-03-04T00:00:00Z
    .
  • productType
    写成小写的
    sessions
    。正确写法是
    Sessions
    ——帕斯卡命名法(PascalCase)。请查看
    enums.md
  • Count
    表达式中遗漏
    column
    。API要求必须包含该字段;传入空字符串
    ""
  • 使用
    count_distinct
    Count_distinct
    。正确写法是
    CountDistinct
    ——帕斯卡命名法,无下划线。
  • 未先调用
    get-keys
    就构建查询,因属性名称错误导致空结果。
  • get-keys
    使用仅日期格式(
    2026-03-04
    )。需要带时间的完整ISO格式:
    2026-03-04T00:00:00Z