Token导航 LogoToken导航TokenDH.com
待分类敏感数据github未标认证来源可访问许可证需确认审计异常

configuring-log-export配置日志导出

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

356

周安装

15

GitHub Stars

9

下载量

125
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:configuring-log-export(配置日志导出)
来源仓库:https://github.com/cockroachlabs/cockroachdb-skills
仓库路径:skills/configuring-log-export
安装命令:
npx skills add https://github.com/cockroachlabs/cockroachdb-skills --skill configuring-log-export
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/cockroachlabs/cockroachdb-skills --skill configuring-log-export

简介

用于辅助前端页面、组件和样式逻辑的开发与维护。configuring-log-export 属于待分类类 Skill,可作为该场景下的辅助能力补充。

  • 适合生成或审查 React、Vue、CSS 等相关代码,并整理组件结构。
  • 需结合项目现有设计系统和路由方式使用,避免生成孤立片段。
  • 涉及页面改动时应配合本地预览和构建检查确认视觉效果。
  • 当前暂无已知稳定性问题,但需人工复核具体实现细节。

SKILL.md

Configuring Log Export

Configures log and metric export for CockroachDB Cloud clusters to deliver cluster logs, audit logs, and performance metrics to external monitoring services. Supports AWS CloudWatch, GCP Cloud Logging, and third-party integrations like Datadog.

When to Use This Skill

  • Setting up log export to AWS CloudWatch or GCP Cloud Logging
  • Configuring metric export to CloudWatch or Datadog
  • Verifying that SQL audit logs are being exported to an external sink
  • Troubleshooting log export errors or missing logs
  • Estimating CloudWatch or logging service costs for CockroachDB log volume
  • Configuring log export via Terraform

Prerequisites

  • CockroachDB Cloud Advanced plan — Log export is not available on Basic or Standard plans
  • ccloud CLI authenticated with Cluster Admin role
  • Cloud provider setup:

- AWS: CloudWatch Logs group created, IAM role granting CockroachDB Cloud cross-account access - GCP: Cloud Logging API enabled, service account with Logs Writer role

  • Cluster ID: Available from ccloud cluster list

Verify access:

ccloud auth whoami
ccloud cluster info <cluster-name> -o json
# Look for "plan": "ADVANCED"

Configuration Decisions

Before proceeding, determine which export destinations apply to the user's environment. Ask which options are relevant, then follow only the corresponding sections below.

Decision 1 — Log export destination:

  • AWS CloudWatch: Use when the cluster runs on AWS and logs should go to CloudWatch Logs. Requires IAM cross-account role setup.
  • GCP Cloud Logging: Use when the cluster runs on GCP. Requires a service account with Logs Writer role.

Decision 2 — Metric export destination:

  • CloudWatch: Use when metrics should go to AWS CloudWatch. Requires IAM role with cloudwatch:PutMetricData permission.
  • Datadog: Use when metrics should go to Datadog. Requires a Datadog API key and site.
  • Skip: No metric export needed at this time.

Steps

1. Check Current Log Export Configuration

# Check if log export is currently configured
ccloud cluster info <cluster-name> -o json
# Look for "log_export_config" in the output

2. Set Up Log Export to AWS CloudWatch

Follow this section only if the user selected AWS CloudWatch in Decision 1. Skip to Step 3 if using GCP Cloud Logging.

2.1 Create a CloudWatch Log Group

# Create a log group in AWS (if it doesn't exist)
aws logs create-log-group \
  --log-group-name cockroachdb-<cluster-name> \
  --region <aws-region>

# Set retention policy (recommended)
aws logs put-retention-policy \
  --log-group-name cockroachdb-<cluster-name> \
  --retention-in-days 90 \
  --region <aws-region>

2.2 Create an IAM Role for CockroachDB Cloud

See cloud provider setup reference for the complete IAM role policy.

The IAM role must:

  • Trust the CockroachDB Cloud AWS account as an allowed principal
  • Grant logs:CreateLogStream, logs:PutLogEvents, logs:DescribeLogGroups, logs:DescribeLogStreams permissions
  • Be scoped to the specific log group

2.3 Enable Log Export

# Enable log export to CloudWatch
ccloud cluster log-export create <cluster-id> \
  --log-group-name cockroachdb-<cluster-name> \
  --auth-principal <iam-role-arn> \
  --type AWS_CLOUDWATCH \
  --region <aws-region>

3. Set Up Log Export to GCP Cloud Logging

Follow this section only if the user selected GCP Cloud Logging in Decision 1. Skip if using AWS CloudWatch.

3.1 Enable Cloud Logging API

gcloud services enable logging.googleapis.com

3.2 Grant CockroachDB Cloud Service Account Access

# Get the CockroachDB Cloud service account from ccloud cluster info
# Grant Logs Writer role
gcloud projects add-iam-policy-binding <gcp-project-id> \
  --member="serviceAccount:<cockroachdb-service-account>" \
  --role="roles/logging.logWriter"

3.3 Enable Log Export

ccloud cluster log-export create <cluster-id> \
  --auth-principal <gcp-project-id> \
  --type GCP_CLOUD_LOGGING

4. Configure Metric Export

Skip this section if the user selected Skip in Decision 2. Follow only the relevant subsection (4.1 or 4.2) based on the selected metric export destination.

Metric export sends CockroachDB performance metrics to CloudWatch or Datadog.

4.1 Metric Export to CloudWatch

ccloud cluster metric-export create cloudwatch <cluster-id> \
  --role-arn <iam-role-arn> \
  --target-region <aws-region>

The IAM role for metric export needs cloudwatch:PutMetricData permission.

4.2 Metric Export to Datadog

ccloud cluster metric-export create datadog <cluster-id> \
  --api-key <datadog-api-key> \
  --site <datadog-site>

Datadog site values: datadoghq.com (US), datadoghq.eu (EU), us3.datadoghq.com (US3), us5.datadoghq.com (US5)

5. Verify Log and Metric Export

# Check log export status
ccloud cluster log-export list <cluster-id> -o json
# Status should be ENABLED

# Check metric export status
ccloud cluster metric-export list <cluster-id> -o json

Verify log delivery in CloudWatch:

# Check for recent log streams
aws logs describe-log-streams \
  --log-group-name cockroachdb-<cluster-name> \
  --order-by LastEventTime \
  --descending \
  --limit 5 \
  --region <aws-region>

# Tail recent log events
aws logs tail cockroachdb-<cluster-name> \
  --since 1h \
  --region <aws-region>

Verify audit logs are being exported:

Audit logs are included in the log export if SQL audit logging is enabled on the cluster. To confirm:

-- Check audit logging is enabled
SHOW CLUSTER SETTING sql.log.admin_audit.enabled;
SHOW CLUSTER SETTING sql.log.user_audit;

If audit logging is enabled but audit events are not appearing in CloudWatch, check:

  1. Log export status is ENABLED
  2. The IAM role has correct permissions
  3. Log group name matches the configured export target
  4. Allow 5-10 minutes for initial log delivery

6. Configure Log Export via Terraform

resource "cockroach_log_export_config" "main" {
  id         = cockroach_cluster.main.id
  auth_principal = "<iam-role-arn>"
  log_name       = "cockroachdb-${cockroach_cluster.main.name}"
  type           = "AWS_CLOUDWATCH"
  region         = "<aws-region>"
}

resource "cockroach_metric_export_cloudwatch_config" "main" {
  id         = cockroach_cluster.main.id
  role_arn       = "<iam-role-arn>"
  target_region  = "<aws-region>"
}

Known Terraform issue: Creating a cluster with log export and CMEK in the same terraform apply can cause a race condition. Apply the cluster first, then add log export and CMEK configurations in a subsequent apply.

Safety Considerations

Impact TypeSeverityRecommendation
Log export enablingLowNo impact on cluster operation
Log export disablingLowStops log delivery but does not affect cluster
IAM misconfigurationMediumLog export will fail silently; monitor for delivery gaps
Cost impactMediumHigh-volume clusters can generate significant CloudWatch/logging costs
Terraform race conditionMediumApply cluster creation before log/CMEK config

Cost planning:

  • CockroachDB Cloud can generate 1-10 GB of logs per day per node depending on query volume and audit settings
  • CloudWatch Logs pricing: ~$0.50/GB ingestion + $0.03/GB storage/month (varies by region)
  • Enable log retention policies to control storage costs
  • Audit logging significantly increases log volume — plan accordingly

Do not:

  • Delete the CloudWatch log group while log export is active (will cause delivery errors)
  • Revoke IAM permissions without disabling log export first
  • Enable cluster-wide SQL audit logging without considering the log volume increase

Rollback

# Disable log export
ccloud cluster log-export delete <cluster-id>

# Disable metric export
ccloud cluster metric-export delete cloudwatch <cluster-id>
ccloud cluster metric-export delete datadog <cluster-id>

Log export can be re-enabled at any time with the same or different configuration. Historical logs are not re-sent — only new logs are exported after re-enabling.

References

Skill references:

Related skills:

Official CockroachDB Documentation:

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

32.78%
按下载量换算41

Claude

31.27%
按下载量换算39

Cursor

17.71%
按下载量换算22

Gemini CLI

8.24%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills