Token导航 LogoToken导航

Agent Skill · 开发

nestjs-lgtm-metrics(Nestjs LGTM 指标)

nestjs-lgtm-metrics 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

nestjs-lgtm-metrics 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为调用外部服务;许可证信息还不明确,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 21,446。

总安装 188周安装 8GitHub Stars 公开资料未说明下载 66核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:nestjs-lgtm-metrics(Nestjs LGTM 指标)
来源仓库:https://github.com/cmglezpdev/custom-skills
仓库路径:skills/nestjs-lgtm-metrics
安装命令:
npx skills add https://github.com/cmglezpdev/custom-skills --skill nestjs-lgtm-metrics
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/cmglezpdev/custom-skills --skill nestjs-lgtm-metrics

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

nestjs-lgtm-metrics 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更或协作事项进行整理。

通过 npx skills add 命令从指定仓库安装,需结合原始 README 核验具体用法。安装前建议确认权限范围、维护状态及是否会触发联网、命令执行或文件读写操作。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/nestjs-lgtm-metrics

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/cmglezpdev/custom-skills --skill nestjs-lgtm-m…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要调用外部服务,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

nestjs-lgtm-metrics 怎么安装?

在终端执行 npx skills add https://github.com/cmglezpdev/custom-skills --skill nestjs-lgtm-metrics。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

nestjs-lgtm-metrics 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

nestjs-lgtm-metrics 需要什么权限?

权限级别是调用外部服务。该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

nestjs-lgtm-metrics 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

nestjs-lgtm-metrics 用的人多吗?

公开数据是累计安装 188 次,近一周安装 8 次,下载 66 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

nestjs-lgtm-metrics 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
nestjs-lgtm-metrics

Nestjs LGTM 指标 · 本页

188—调用外部服务未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

NestJS Application Metrics via OpenTelemetry

What This Skill Covers

This skill adds application-level metrics to a NestJS app using the OpenTelemetry SDK, pushing them through an OTel Collector into Prometheus. It is organized in progressive stages, from foundational to advanced.

Scope boundary: This skill covers metrics only. Not logging, not tracing. Infrastructure metrics (container resources, host stats, database server stats, Redis server stats) come from their respective exporters and community Grafana dashboards. This skill covers what those exporters cannot see: request-level behavior, business events, runtime internals, and domain-specific KPIs as observed from inside your application.

Prerequisites

  • NestJS application
  • OpenTelemetry Collector running and reachable from the app
  • Prometheus configured as an export target from the Collector
  • Grafana connected to Prometheus as a data source

Architecture

NestJS App (OTel SDK) ──OTLP/gRPC──▶ OTel Collector ──remote_write──▶ Prometheus ──▶ Grafana

The app never exposes a /metrics endpoint. It pushes metrics to the Collector via OTLP. The Collector handles export to Prometheus (via prometheusremotewrite exporter or a Prometheus scrape on the Collector itself).

Read references/otel-setup.md before writing any application metric code. It covers the SDK bootstrap, Collector pipeline config, and how to verify the pipeline is working end to end.

Implementation Stages

Each stage builds on the previous. Read the corresponding reference file for full implementation code.


Stage 1: Foundation (Day 1, any app)

Read: references/stage-1-foundation.md

Non-negotiable. Every NestJS app in production needs these from the start.

What you get:

  1. HTTP RED metrics (Rate, Errors, Duration) via a global interceptor

- http_request_duration_seconds histogram, labeled by method, route, status_code - http_requests_total counter, labeled by method, route, status_code - http_requests_in_flight up/down counter

  1. Node.js runtime metrics (what V8/libuv expose that no infra exporter can see)

- nodejs_eventloop_lag_seconds histogram (not just mean. percentiles matter) - nodejs_active_handles_total observable gauge - nodejs_active_requests_total observable gauge - GC duration, heap size, external memory via @opentelemetry/host-metrics

  1. Health and readiness probe metrics

- app_health_check_duration_seconds histogram by check_name - app_health_check_status gauge (1=healthy, 0=unhealthy) by check_name

Why these first: HTTP RED gives you the ability to detect problems. Runtime metrics tell you whether the Node.js process itself is degraded. Health checks close the loop with your orchestrator. Together they answer: "Is the app working? How fast? For whom is it failing?"

Histogram bucket strategy: Use explicit bucket boundaries initially: [0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10]. Tune after you have real traffic data. Do not over-bucket. More buckets = more time series = more Prometheus storage cost.


Stage 2: Application Intelligence (Week 1-2, pre-launch)

Read: references/stage-2-app-intelligence.md

These metrics expose application behavior that sits between raw HTTP and business logic.

What you get:

  1. Database query metrics from the app's perspective

- app_db_query_duration_seconds histogram by operation (select, insert, update, delete), entity - app_db_query_errors_total counter by operation, error_type - app_db_connection_pool_wait_seconds histogram - Why this matters: postgres-exporter sees server-side query time. Your app sees ORM overhead + pool wait + serialization + network. The gap between these two is where bugs hide.

  1. Redis operation metrics from the app's perspective

- app_redis_operation_duration_seconds histogram by operation (get, set, del, etc.), key_prefix - app_redis_operation_errors_total counter - app_cache_hit_total / app_cache_miss_total counters by cache_name - Why this matters: redis-exporter sees keyspace_hits/misses globally. Your app knows WHICH cache strategy worked and which didn't.

  1. External API call metrics

- app_external_api_duration_seconds histogram by service, endpoint, status_code - app_external_api_errors_total counter by service, error_type - app_circuit_breaker_state gauge (0=closed, 0.5=half-open, 1=open) by service

  1. Authentication and authorization metrics

- app_auth_attempts_total counter by method (password, oauth, api_key), result (success, failure, locked) - app_auth_token_operations_total counter by operation (issue, refresh, revoke, expire) - app_authorization_denied_total counter by resource, action

  1. Background job / queue metrics (Bull, BullMQ, or similar)

- app_job_duration_seconds histogram by queue, job_type - app_job_completed_total counter by queue, job_type, status (completed, failed, stalled) - app_job_queue_depth gauge by queue - app_job_attempts_total counter by queue, job_type (tracks retry behavior)


Stage 3: Business Metrics (Launch, real users)

Read: references/stage-3-business-metrics.md

Once users arrive, technical metrics aren't enough. You need to observe the business through the same system.

What you get:

  1. User lifecycle events

- app_user_signups_total counter by source, plan - app_user_logins_total counter by method - app_user_actions_total counter by action_type (generic, high-cardinality-safe pattern)

  1. Transaction / conversion metrics

- app_transactions_total counter by type, status - app_transaction_value_total counter (sum of monetary values) by currency - app_conversion_funnel_step_total counter by funnel, step

  1. Feature usage metrics

- app_feature_usage_total counter by feature_name, variant (useful for A/B tests) - app_feature_errors_total counter by feature_name

  1. SLI metrics for SLO tracking

- app_sli_request_availability counter (successful requests / total requests, partitioned) - app_sli_request_latency histogram (tighter buckets around your SLO threshold)

Cardinality warning: Business metrics are where cardinality explosions happen. Never use user_id, session_id, or any unbounded value as an attribute. Use bucketed categories. Read the cardinality section in references/stage-3-business-metrics.md.


Stage 4: Advanced Patterns (Scaled app, mature team)

Read: references/stage-4-advanced.md

For apps serving real traffic at scale, handling complex flows, or needing tight operational control.

What you get:

  1. WebSocket / real-time connection metrics

- app_ws_connections_active gauge by namespace - app_ws_messages_total counter by namespace, direction (in/out), event_type - app_ws_connection_duration_seconds histogram

  1. Rate limiter observability

- app_rate_limit_hits_total counter by limiter, route - app_rate_limit_remaining gauge by limiter (sampled, not per-request)

  1. Multi-tenant metrics

- app_tenant_requests_total counter by tenant_tier (not tenant_id. cardinality.) - app_tenant_resource_usage gauge by tenant_tier, resource_type

  1. Graceful shutdown and lifecycle

- app_shutdown_duration_seconds histogram - app_startup_duration_seconds gauge

  1. Deployment version tracking

- app_info gauge with version, commit_sha, environment attributes for canary analysis


Grafana Dashboard Templates

Import-ready Grafana dashboard JSON files, one per stage. Each uses ${DS_PROMETHEUS} as the data source variable, so Grafana will prompt you to select your Prometheus data source on import.

How to import: Grafana → Dashboards → New → Import → Upload JSON file → Select your Prometheus data source.

TemplatePanelsDescription
templates/stage-1-service-overview.json14Golden signals (stat), request rate by route, error rate, latency percentiles, P99 by route, event loop lag, heap memory, active handles, health check status and duration.
templates/stage-2-dependency-health.json15DB query P95 by operation, pool wait time, DB errors, cache hit ratio by strategy, Redis op latency, Redis errors, external API P95, circuit breaker state, API errors, auth failure rate, token ops, authz denials, queue depth, job duration, job failure rate.
templates/stage-3-business-metrics.json14Signups/revenue/success rate big numbers, signups by source, logins by method, revenue rate, transaction failure rate, funnel step totals, feature usage by variant, feature errors, 30-day SLO availability, SLI latency percentiles, error budget burn rate.
templates/stage-4-operational.json10Running versions table, startup/shutdown duration, active WS connections, WS message throughput, WS connection duration, rate limit rejections by route, remaining tokens, request volume by tenant tier, resource usage by tier.

Each dashboard is standalone. Combine panels across dashboards as your needs evolve. All dashboards include $job and $instance template variables for filtering. Stage 3 additionally includes $funnel and $sli selectors.


Grafana Dashboard Strategy

Read references/grafana-dashboards.md for dashboard panel definitions and provisioning.

Dashboard hierarchy:

  1. Service Overview (Stage 1): RED metrics, runtime health, up/down status. One dashboard per service.
  2. Dependency Health (Stage 2): DB latency, Redis hit rates, external API status. Shows how your app EXPERIENCES its dependencies.
  3. Business Dashboard (Stage 3): Conversion funnels, feature adoption, revenue metrics. Non-engineers should be able to read this.
  4. Operational Dashboard (Stage 4): Rate limits, circuit breakers, tenant resource usage, deployment comparison.

Alert hierarchy (pair with dashboards):

  • Stage 1: Error rate spike, latency P99 breach, event loop lag > 100ms
  • Stage 2: DB query latency drift, cache hit rate drop, external API circuit open
  • Stage 3: Conversion rate drop, signup anomaly
  • Stage 4: Rate limiter saturation, tenant quota breach

Infrastructure Exporters and Community Dashboards

Read: references/infra-exporters.md

Your app metrics (Stages 1-4) show how the application experiences its dependencies. Infrastructure exporters show how those services perform internally. You need both. The gap between them is where most production issues hide.

This reference covers exporter setup (docker-compose), Prometheus scrape config, and community Grafana dashboard IDs for: PostgreSQL, Redis, RabbitMQ, MongoDB, Qdrant, Elasticsearch, Nginx, MinIO, plus node-exporter and cAdvisor for host/container metrics.

Each entry includes the key metrics the exporter provides and, critically, what it does NOT tell you (which your app-level metrics fill).


Common Mistakes to Avoid

  1. High-cardinality attributes: Never use userId, requestId, IP, or full URL path as a metric attribute. Use route patterns. If you need per-user data, that's a log or trace, not a metric.
  2. Metric name collisions: Prefix everything with app_. Infra exporters use node_, pg_, redis_, container_.
  3. Too many buckets: Every unique attribute combination x every bucket = one time series. 10 routes x 5 methods x 11 buckets = 550 series just for HTTP duration. That's fine. 500 routes x 11 buckets = not fine.
  4. Forgetting the MeterProvider: If your OTel SDK setup doesn't register a MeterProvider, all meter.create* calls silently return no-op instruments. Nothing fails, nothing records. Verify by checking the Collector's own metrics or the Prometheus targets page.
  5. Measuring inside try/catch only: Always record duration and count in a finally block so errors are measured too.
  6. Ignoring pool wait time: The time your request spends waiting for a DB connection from the pool is invisible to both your query timer and the postgres-exporter. Instrument it separately.

File Reference

FileWhen to read
references/otel-setup.mdBefore starting. OTel SDK bootstrap and Collector config.
references/stage-1-foundation.mdImplementing foundation metrics. Full code.
references/stage-2-app-intelligence.mdAdding dependency and internal behavior metrics.
references/stage-3-business-metrics.mdAdding business event tracking and SLIs.
references/stage-4-advanced.mdWebSockets, rate limiters, multi-tenancy, lifecycle.
references/infra-exporters.mdExporter setup for Postgres, Redis, RabbitMQ, MongoDB, Qdrant, Elasticsearch, Nginx, MinIO, node-exporter, cAdvisor. Docker-compose, scrape configs, community dashboard IDs.
references/grafana-dashboards.mdApp dashboard structure, alert rules, provisioning.
templates/stage-1-service-overview.jsonImport into Grafana for HTTP RED, runtime, health check panels.
templates/stage-2-dependency-health.jsonImport into Grafana for DB, Redis, external API, auth, job panels.
templates/stage-3-business-metrics.jsonImport into Grafana for signups, revenue, funnels, SLO panels.
templates/stage-4-operational.jsonImport into Grafana for WebSocket, rate limiter, multi-tenant panels.

平台分布

Codex

38.56%
按下载量换算25

Claude

29.44%
按下载量换算19

Cursor

17.82%
按下载量换算12

Gemini CLI

10.06%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

调用外部服务

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills