betterstack

betterstack:Better Stack(原 Better Uptime + Logtail)观测平台专家指导,集成正常运行时间监控、日志管理、事件响应与状态页面,协助设置包含告警、值班安排和公共状态页面的全面监控方案。

仓库最近推送
GitHub Stars
219
Forks
38
Issues / PRs
7

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "betterstack":https://skillpi.com/zh/skills/deepskill-cc5fa2a2d2876df3981d5d12b39b1dcd4f28bb46cc1dc04a3a8f67fcc947d37a。安装前核对上游来源和版本:https://github.com/TerminalSkills/skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

betterstack:Better Stack(原 Better Uptime + Logtail)观测平台专家指导,集成正常运行时间监控、日志管理、事件响应与状态页面,协助设置包含告警、值班安排和公共状态页面的全面监控方案。

0 下载

介绍来源: third_party · TerminalSkills · 1.0.0 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: betterstack
description: Expert guidance for Better Stack (formerly Better Uptime + Logtail), the observability platform combining uptime monitoring, log management, incident response, and status pages. Helps developers set up comprehensive monitoring with alerting, on-call schedules, and public status pages.
license: Apache-2.0
compatibility: No special requirements
metadata:
  author: terminal-skills
  version: 1.0.0
  category: devops
  tags:
  - uptime
  - logging
  - incident-management
  - status-page
  - on-call

Better Stack — Uptime, Logs, and Incident Management

Overview

Better Stack (formerly Better Uptime + Logtail), the observability platform combining uptime monitoring, log management, incident response, and status pages. Helps developers set up comprehensive monitoring with alerting, on-call schedules, and public status pages.

Instructions

Uptime Monitoring

// Better Stack monitors HTTP endpoints, TCP ports, DNS, SSL, and more.
// Configure via dashboard or Terraform.

// Terraform configuration for uptime monitors
resource "betteruptime_monitor" "api" {
  url          = "https://api.example.com/health"
  monitor_type = "status"
  check_frequency = 30                    // Check every 30 seconds

  request_headers = [{
    name  = "Authorization"
    value = "Bearer ${var.health_check_token}"
  }]

  // Alert if response doesn't contain expected string
  expected_status_codes = [200]

  // Regions to check from (catch regional outages)
  regions = ["us", "eu", "asia"]

  // Escalation policy
  policy_id = betteruptime_escalation_policy.default.id
}

resource "betteruptime_monitor" "database" {
  url          = "tcp://db.example.com:5432"
  monitor_type = "tcp"
  check_frequency = 60
  policy_id = betteruptime_escalation_policy.default.id
}

resource "betteruptime_monitor" "ssl_cert" {
  url          = "https://example.com"
  monitor_type = "ssl"
  // Alert 30 days before SSL certificate expires
  ssl_expiration = 30
  policy_id = betteruptime_escalation_policy.default.id
}

Log Management (Logtail)

// Send structured logs to Better Stack
import { Logtail } from "@logtail/node";

const logtail = new Logtail(process.env.LOGTAIL_SOURCE_TOKEN!);

// Structured logging with context
logtail.info("Order processed", {
  orderId: "ord_abc123",
  userId: "usr_456",
  amount: 99.99,
  duration_ms: 245,
  region: "us-east-1",
});

logtail.error("Payment failed", {
  orderId: "ord_def789",
  error: "Card declined",
  stripe_error_code: "card_declined",
  retryable: true,
});

// Pino integration (recommended for production)
import pino from "pino";

const logger = pino(
  pino.transport({
    target: "@logtail/pino",
    options: { sourceToken: process.env.LOGTAIL_SOURCE_TOKEN },
  })
);

logger.info({ orderId: "ord_123", userId: "usr_456" }, "Order created");

On-Call and Escalation

# Escalation policy configuration (via API or dashboard)
# Step 1: Notify on-call engineer via Slack + push notification
# Step 2: After 5 min unacknowledged → call on-call engineer
# Step 3: After 10 min unacknowledged → escalate to team lead
# Step 4: After 15 min unacknowledged → page entire engineering team

# On-call schedule: weekly rotation
# Week 1: engineer-a
# Week 2: engineer-b
# Week 3: engineer-c
# Override: any engineer can take over via Slack command

Status Pages

// Better Stack provides hosted status pages with:
// - Custom domain (status.yourcompany.com)
// - Automatic incident creation from monitor alerts
// - Manual incident updates
// - Subscriber notifications (email, SMS, webhook)
// - Historical uptime (90-day, 365-day)
// - Maintenance windows

// API: Create an incident programmatically
const response = await fetch("https://uptime.betterstack.com/api/v2/incidents", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.BETTERSTACK_API_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    requester_email: "ops@example.com",
    name: "Elevated API Latency",
    summary: "API response times are elevated due to database migration. No data loss expected.",
    description: "We are performing a planned database migration. Some requests may take longer than usual.",
    status_page_ids: ["12345"],
  }),
});

Heartbeat Monitoring

// Monitor cron jobs and background tasks
// Better Stack provides heartbeat URLs — if not pinged within the expected interval, it alerts.

// In your cron job:
async function dailyReport() {
  try {
    await generateReport();
    await sendReportEmail();

    // Ping heartbeat on success
    await fetch("https://uptime.betterstack.com/api/v1/heartbeat/abc123");
  } catch (error) {
    // Don't ping heartbeat — Better Stack will alert after the expected interval
    console.error("Daily report failed:", error);
  }
}

Installation

# Node.js logging
npm install @logtail/node
npm install @logtail/pino          # Pino transport

# CLI
brew install betterstack/tap/better-uptime

# Terraform provider
terraform {
  required_providers {
    betteruptime = {
      source = "BetterStackHQ/better-uptime"
    }
  }
}

Examples

Example 1: Setting up Betterstack for a microservices project

User request:

I have a Node.js API and a React frontend running in Docker. Set up Betterstack for monitoring/deployment.

The agent creates the necessary configuration files based on patterns like # Escalation policy configuration (via API or dashboard), sets up the integration with the existing Docker setup, configures appropriate defaults for a Node.js + React stack, and provides verification commands to confirm everything is working.

Example 2: Troubleshooting log management issues

User request:

Betterstack is showing errors in our log management. Here are the logs: [error output]

The agent analyzes the error output, identifies the root cause by cross-referencing with common Betterstack issues, applies the fix (updating configuration, adjusting resource limits, or correcting syntax), and verifies the resolution with appropriate health checks.

Guidelines

  1. Monitor from multiple regions — Check from US, EU, and Asia; a single region can have false positives from network issues
  2. Heartbeats for cron jobs — Use heartbeat monitors for every scheduled task; silent failures are the worst kind
  3. Escalation policies — Always have an escalation chain; a single point of failure in alerting defeats the purpose
  4. Status page for trust — Public status pages build customer trust; auto-create incidents from monitors for transparency
  5. Structured logs — Send JSON with context (userId, orderId, etc.); Better Stack's SQL-like queries work best with structured data
  6. Alert fatigue prevention — Set appropriate thresholds; don't alert on single failures, use confirmation periods (2-3 consecutive failures)
  7. Maintenance windows — Schedule maintenance windows to suppress alerts during planned work
  8. Correlate logs with incidents — Link log sources to monitors; when an incident fires, jump directly to relevant logs

当前收录版本

1.0.0

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值92/100

亮点

  • 提供 Better Stack 监控平台的全面专家指导,涵盖正常运行时间监控、日志管理、事件响应和状态页面等 DevOps 核心功能
  • 适用于广泛开发者与运维人员,具有明确的高频刚需价值
触发精准88/100

亮点

  • description 明确描述 Skill 用途,覆盖多种使用场景(监控、日志、值班、状态页),边界清晰
结构规范95/100

亮点

  • 文档结构清晰,分模块组织,含丰富代码示例、安装指南、使用示例和最佳实践
  • frontmatter 完整,符合规范
执行可靠90/100

亮点

  • 工具来源明确(Better Stack 官方),参数示例正确,覆盖主要使用场景
证据可验 (前四项均值)91/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

文档引用的域名或地址

这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。

  • api.example.com
  • example.com
  • uptime.betterstack.com

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。