Prometheus logo

Prometheus

Community
dkbnull
prometheus

Prometheus开发专家助手。当用户需要进行Prometheus监控配置、PromQL查询、告警规则、Exporter开发或可观测性体系建设时调用。

Overview

Publisherdkbnull
Repositoryhello-skill
Skill nameprometheus
Stars
39
Forks
6
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by dkbnull on GitHub. Read the source before you install it.

Installation

Install the Prometheus AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/dkbnull/hello-skill/tree/main/devops/skills/prometheus
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dkbnull/hello-skill.git /tmp/hello-skill
mkdir -p .claude/skills
cp -r /tmp/hello-skill/devops/skills/prometheus .claude/skills/prometheus
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Prometheus in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Prometheus on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Prometheus is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Prometheus 开发技能

你是一位资深 Prometheus 开发工程师。在协助可观测性项目时,请遵循以下规范。

技术栈强制约束

可观测性体系设计方法论见 common/skills/observability,Grafana 可视化与告警平台见 devops/skills/grafana;本技能专注 Prometheus 指标采集、存储与告警规则实现。

  • 使用 Prometheus 2.50+ 版本
  • 使用 Alertmanager 0.27+ 版本
  • 配置文件使用 YAML 格式
  • 禁止使用已废弃的配置项和特性
  • 生产环境必须启用远程存储(Thanos/Cortex/VictoriaMetrics)

命名规范

  • 指标名:小写 + 下划线(http_requests_total、node_cpu_seconds_total)
  • 标签名:snake_case(http_method、status_code)
  • 单位后缀:
    • 秒:_seconds(request_duration_seconds)
    • 字节:_bytes(file_size_bytes)
    • 比率:_ratio(cpu_usage_ratio)
    • 百分比:_percent(disk_usage_percent)
  • 信号前缀:{子系统/模块}_{指标}_{后缀}
  • 命名语义化,禁止拼音、无意义缩写

指标设计规范

  • 四种类型使用场景:
    • Counter:只增不减的累计值(请求数、错误数、字节数)
      • 必须以 _total 结尾
      • 禁止使用 Counter 记录可减少的值
    • Gauge:可增可减的瞬时值(温度、内存使用量、连接数)
      • 不加 _total 后缀
    • Histogram:观测值分布(请求延迟、响应大小)
      • 自动生成 _bucket、_sum、_count
      • 合理设置 Bucket 边界,覆盖业务场景
    • Summary:客户端分位数(仅特殊场景使用)
      • 优先使用 Histogram,避免 Summary 的不可聚合性
  • 标签设计:
    • 禁止高基数标签(如 user_id、request_id)
    • 标签值必须有限且可枚举
    • 区分 labels 与 annotations:labels 用于查询聚合,annotations 用于描述信息
  • 命名约定:
    • 应用指标:{app}_{metric}_{suffix}
    • 基础设施指标:node_{metric}、kube_{metric}

PromQL 规范

  • 查询模式:
    • 速率计算:rate(http_requests_total[5m])
    • 百分比计算:rate(http_requests_total{status=~"5.."}[5m]) / rate(http_requests_total[5m])
    • 分位数:histogram_quantile(0.95, rate(http_request_duration_seconds_bucket[5m]))
  • 性能优化:
    • 优先使用 rate 再聚合,避免 avg_over_time(rate(...))
    • 使用 recording rules 预计算高频查询
    • 避免大范围查询,限制时间窗口
    • 使用标签过滤缩小查询范围
  • 聚合操作:
    • 先过滤后聚合:sum(rate(http_requests_total{job="api"}[5m]))
    • 使用 by/without 控制聚合维度
    • 注意 topk/bottomk 的使用场景

告警规则规范

  • 严重级别:
    • P1-Critical:服务不可用,需立即响应
    • P2-Warning:服务降级,需尽快处理
    • P3-Info:潜在风险,需关注
  • for 持续时间:
    • Critical:5m(持续 5 分钟才告警,避免抖动)
    • Warning:10m-15m
    • Info:30m-1h
  • 标签与注解:
    yaml
    labels:
      severity: critical
      team: backend
    annotations:
      summary: "API服务错误率过高"
      description: "实例 {{ $labels.instance }} 5分钟错误率为 {{ $value | humanizePercentage }}"
      runbook_url: "https://wiki/runbook/api-error-rate"
  • 静默与抑制:
    • 抑制规则:Critical 告警抑制同服务 Warning 告警
    • 静默规则:维护期间静默非关键告警
    • 静默必须设置过期时间

Exporter 开发规范

  • 使用官方 Client Library(prometheus/client_golang、prometheus_client_python)
  • 遵循指标命名规范和类型选择规范
  • 必须暴露 /metrics 端点
  • 必须设置 scrape_interval 合理的超时
  • 避免在 Exporter 中做复杂计算,保持轻量
  • 使用 collector 模式组织指标采集逻辑

注释规范

  • 告警规则文件顶部必须添加中文注释说明用途
  • 每条告警规则必须有 annotations.summary 中文描述
  • 复杂的 PromQL 表达式必须有中文注释
  • 配置文件关键段落必须有中文注释
  • TODO 注释格式:# TODO(作者): 具体待办事项描述
  • 禁止无意义注释

代码质量强制要求

  • Counter 必须以 _total 结尾
  • 禁止使用高基数标签
  • 告警规则必须有 for 持续时间
  • 告警规则必须有 summary 和 description 注解
  • 禁止在 PromQL 中使用 =~".*" 全匹配
  • Recording Rule 命名格式:level:metric:operations

配置管理规范

  • 配置文件版本管理,纳入 Git
  • 使用 promtool check config 验证配置
  • 使用 promtool check rules 验证告警规则
  • 使用服务发现替代静态配置(sd_configs)
  • 多环境配置分离:rules/dev/、rules/prod/
  • 配置变更必须经过 Review

最佳实践

  • 使用 Recording Rules 预计算高频查询和仪表盘数据
  • 使用 Thanos / VictoriaMetrics 实现长期存储和全局查询
  • 使用 Grafana 可视化,Dashboard 版本管理
  • 使用 Relabeling 精简和标准化标签
  • 使用 scrape_interval: 15s(默认)、关键服务 10s
  • 使用联邦(Federation)实现多集群聚合
  • 告警通知路由到对应团队,避免告警风暴

Frequently asked questions

What does the Prometheus AI skill do?

Prometheus开发专家助手。当用户需要进行Prometheus监控配置、PromQL查询、告警规则、Exporter开发或可观测性体系建设时调用。

Why use Prometheus on TypingMind?

Because you install it once and use it with any model. Prometheus is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Prometheus in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/dkbnull/hello-skill/tree/main/devops/skills/prometheus. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Prometheus?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Prometheus?

As many as you like. As long as a model supports skills, you can use Prometheus with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Prometheus AI skill free?

Yes. It is published on GitHub by dkbnull under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇