opencode-skills-collection 4.0.68 → 4.0.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled-skills/.antigravity-install-manifest.json +266 -1
- package/bundled-skills/access-review/SKILL.md +394 -0
- package/bundled-skills/access-review/references/details.md +121 -0
- package/bundled-skills/agent-evals/SKILL.md +420 -0
- package/bundled-skills/agent-observability/SKILL.md +346 -0
- package/bundled-skills/agent-observability/references/details.md +786 -0
- package/bundled-skills/ai-agent-security/SKILL.md +393 -0
- package/bundled-skills/ai-agent-security/references/details.md +912 -0
- package/bundled-skills/ai-coding-agent-guardrails/SKILL.md +442 -0
- package/bundled-skills/ai-coding-agent-guardrails/references/details.md +753 -0
- package/bundled-skills/ai-inference-service-mesh/SKILL.md +449 -0
- package/bundled-skills/ai-pipeline-orchestration/SKILL.md +287 -0
- package/bundled-skills/ai-red-teaming/SKILL.md +409 -0
- package/bundled-skills/ai-security-hardening/SKILL.md +343 -0
- package/bundled-skills/ai-sre-incident-response/SKILL.md +336 -0
- package/bundled-skills/alerting-oncall/SKILL.md +458 -0
- package/bundled-skills/alerting-oncall/references/details.md +84 -0
- package/bundled-skills/apk-redteam-pipeline/SKILL.md +446 -0
- package/bundled-skills/argocd-gitops/SKILL.md +469 -0
- package/bundled-skills/arm-templates/SKILL.md +438 -0
- package/bundled-skills/arm-templates/references/details.md +64 -0
- package/bundled-skills/asset-inventory/SKILL.md +412 -0
- package/bundled-skills/asset-inventory/references/details.md +127 -0
- package/bundled-skills/audit-logging/SKILL.md +476 -0
- package/bundled-skills/aws-cloudtrail/SKILL.md +486 -0
- package/bundled-skills/aws-cost-optimization/SKILL.md +331 -0
- package/bundled-skills/aws-ec2/SKILL.md +426 -0
- package/bundled-skills/aws-ecs-fargate/SKILL.md +388 -0
- package/bundled-skills/aws-iam/SKILL.md +463 -0
- package/bundled-skills/aws-lambda/SKILL.md +428 -0
- package/bundled-skills/aws-rds/SKILL.md +380 -0
- package/bundled-skills/aws-s3/SKILL.md +434 -0
- package/bundled-skills/aws-secrets-manager/SKILL.md +486 -0
- package/bundled-skills/aws-vpc/SKILL.md +436 -0
- package/bundled-skills/azure-ai-document-intelligence-ts/SKILL.md +1 -1
- package/bundled-skills/azure-aks/SKILL.md +423 -0
- package/bundled-skills/azure-devops/SKILL.md +457 -0
- package/bundled-skills/azure-functions-devsec/SKILL.md +436 -0
- package/bundled-skills/azure-keyvault/SKILL.md +455 -0
- package/bundled-skills/azure-keyvault/references/details.md +83 -0
- package/bundled-skills/azure-monitor-audit/SKILL.md +379 -0
- package/bundled-skills/azure-networking/SKILL.md +448 -0
- package/bundled-skills/azure-networking/references/details.md +135 -0
- package/bundled-skills/azure-sql/SKILL.md +413 -0
- package/bundled-skills/azure-sql/references/details.md +113 -0
- package/bundled-skills/azure-vms/SKILL.md +402 -0
- package/bundled-skills/azure-vms/references/details.md +134 -0
- package/bundled-skills/backup-recovery/SKILL.md +388 -0
- package/bundled-skills/bb-methodology/SKILL.md +451 -0
- package/bundled-skills/bb-methodology/references/details.md +120 -0
- package/bundled-skills/block-storage/SKILL.md +371 -0
- package/bundled-skills/blue-green-deploy/SKILL.md +453 -0
- package/bundled-skills/blue-green-deploy/references/details.md +90 -0
- package/bundled-skills/bug-bounty/SKILL.md +447 -0
- package/bundled-skills/bug-bounty/references/details.md +1316 -0
- package/bundled-skills/bugcrowd-reporting/SKILL.md +351 -0
- package/bundled-skills/business-continuity/SKILL.md +463 -0
- package/bundled-skills/career-ops/SKILL.md +186 -0
- package/bundled-skills/cdn-setup/SKILL.md +374 -0
- package/bundled-skills/change-management/SKILL.md +438 -0
- package/bundled-skills/change-management/references/details.md +105 -0
- package/bundled-skills/circleci/SKILL.md +475 -0
- package/bundled-skills/cis-benchmarks/SKILL.md +150 -0
- package/bundled-skills/cloudflare-pages/SKILL.md +318 -0
- package/bundled-skills/cloudflare-r2/SKILL.md +353 -0
- package/bundled-skills/cloudflare-workers/SKILL.md +415 -0
- package/bundled-skills/cloudflare-zero-trust/SKILL.md +361 -0
- package/bundled-skills/cloudformation/SKILL.md +461 -0
- package/bundled-skills/constraint-driven-development/SKILL.md +335 -0
- package/bundled-skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/bundled-skills/container-hardening/SKILL.md +126 -0
- package/bundled-skills/container-registries/SKILL.md +435 -0
- package/bundled-skills/container-scanning/SKILL.md +416 -0
- package/bundled-skills/convex-backend/SKILL.md +338 -0
- package/bundled-skills/dast-scanning/SKILL.md +437 -0
- package/bundled-skills/database-backups/SKILL.md +425 -0
- package/bundled-skills/datadog/SKILL.md +487 -0
- package/bundled-skills/dependency-scanning/SKILL.md +457 -0
- package/bundled-skills/devcontainers-nix/SKILL.md +416 -0
- package/bundled-skills/disaster-recovery/SKILL.md +374 -0
- package/bundled-skills/disaster-recovery/references/details.md +219 -0
- package/bundled-skills/dns-management/SKILL.md +375 -0
- package/bundled-skills/docker-compose/SKILL.md +482 -0
- package/bundled-skills/docker-management/SKILL.md +426 -0
- package/bundled-skills/ebpf-observability/SKILL.md +436 -0
- package/bundled-skills/ebpf-observability/references/details.md +542 -0
- package/bundled-skills/elk-stack/SKILL.md +487 -0
- package/bundled-skills/enterprise-vpn-attack/SKILL.md +395 -0
- package/bundled-skills/evidence-hygiene/SKILL.md +404 -0
- package/bundled-skills/feature-flags/SKILL.md +426 -0
- package/bundled-skills/feature-flags/references/details.md +86 -0
- package/bundled-skills/fedramp-compliance/SKILL.md +453 -0
- package/bundled-skills/firebase-app-platform/SKILL.md +381 -0
- package/bundled-skills/firewall-config/SKILL.md +479 -0
- package/bundled-skills/gcp-audit-logs/SKILL.md +452 -0
- package/bundled-skills/gcp-audit-logs/references/details.md +56 -0
- package/bundled-skills/gcp-cloud-functions/SKILL.md +284 -0
- package/bundled-skills/gcp-cloud-sql/SKILL.md +277 -0
- package/bundled-skills/gcp-compute/SKILL.md +319 -0
- package/bundled-skills/gcp-gke/SKILL.md +307 -0
- package/bundled-skills/gcp-networking/SKILL.md +293 -0
- package/bundled-skills/gcp-secret-manager/SKILL.md +421 -0
- package/bundled-skills/gcp-secret-manager/references/details.md +131 -0
- package/bundled-skills/gdpr-compliance/SKILL.md +451 -0
- package/bundled-skills/gdpr-compliance/references/details.md +145 -0
- package/bundled-skills/geo-audit/SKILL.md +368 -0
- package/bundled-skills/geo-brand-mentions/SKILL.md +68 -0
- package/bundled-skills/geo-brand-mentions/references/details.md +471 -0
- package/bundled-skills/geo-citability/SKILL.md +350 -0
- package/bundled-skills/geo-compare/SKILL.md +340 -0
- package/bundled-skills/geo-content/SKILL.md +383 -0
- package/bundled-skills/geo-crawlers/SKILL.md +408 -0
- package/bundled-skills/geo-llmstxt/SKILL.md +464 -0
- package/bundled-skills/geo-platform-optimizer/SKILL.md +314 -0
- package/bundled-skills/geo-proposal/SKILL.md +378 -0
- package/bundled-skills/geo-prospect/SKILL.md +225 -0
- package/bundled-skills/geo-report/SKILL.md +436 -0
- package/bundled-skills/geo-report-pdf/SKILL.md +157 -0
- package/bundled-skills/geo-schema/SKILL.md +408 -0
- package/bundled-skills/geo-technical/SKILL.md +78 -0
- package/bundled-skills/geo-technical/references/details.md +543 -0
- package/bundled-skills/git-workflow/SKILL.md +460 -0
- package/bundled-skills/github-actions/SKILL.md +368 -0
- package/bundled-skills/gitlab-ci/SKILL.md +340 -0
- package/bundled-skills/gpu-kubernetes-operations/SKILL.md +468 -0
- package/bundled-skills/gpu-server-management/SKILL.md +236 -0
- package/bundled-skills/hashicorp-vault/SKILL.md +408 -0
- package/bundled-skills/helm-charts/SKILL.md +469 -0
- package/bundled-skills/hipaa-compliance/SKILL.md +451 -0
- package/bundled-skills/hunt-aspnet/SKILL.md +321 -0
- package/bundled-skills/hunt-ato/SKILL.md +184 -0
- package/bundled-skills/hunt-auth-bypass/SKILL.md +426 -0
- package/bundled-skills/hunt-auth-bypass/references/details.md +80 -0
- package/bundled-skills/hunt-brute-force/SKILL.md +341 -0
- package/bundled-skills/hunt-business-logic/SKILL.md +281 -0
- package/bundled-skills/hunt-cache-poison/SKILL.md +382 -0
- package/bundled-skills/hunt-captcha-bypass/SKILL.md +136 -0
- package/bundled-skills/hunt-cicd/SKILL.md +311 -0
- package/bundled-skills/hunt-clickjacking/SKILL.md +110 -0
- package/bundled-skills/hunt-cors/SKILL.md +335 -0
- package/bundled-skills/hunt-dom/SKILL.md +323 -0
- package/bundled-skills/hunt-exceptional-conditions/SKILL.md +111 -0
- package/bundled-skills/hunt-file-upload/SKILL.md +202 -0
- package/bundled-skills/hunt-fintech-graphql/SKILL.md +289 -0
- package/bundled-skills/hunt-forgot-password/SKILL.md +114 -0
- package/bundled-skills/hunt-grpc/SKILL.md +317 -0
- package/bundled-skills/hunt-host-header/SKILL.md +309 -0
- package/bundled-skills/hunt-html-injection/SKILL.md +106 -0
- package/bundled-skills/hunt-http-smuggling/SKILL.md +129 -0
- package/bundled-skills/hunt-http-smuggling/references/phase2h-smuggling-cachepoison.md +177 -0
- package/bundled-skills/hunt-idor/SKILL.md +434 -0
- package/bundled-skills/hunt-jwt-crypto/SKILL.md +221 -0
- package/bundled-skills/hunt-k8s/SKILL.md +337 -0
- package/bundled-skills/hunt-laravel/SKILL.md +255 -0
- package/bundled-skills/hunt-ldap/SKILL.md +351 -0
- package/bundled-skills/hunt-lfi/SKILL.md +311 -0
- package/bundled-skills/hunt-llm-ai/SKILL.md +289 -0
- package/bundled-skills/hunt-mfa-bypass/SKILL.md +177 -0
- package/bundled-skills/hunt-misc/SKILL.md +378 -0
- package/bundled-skills/hunt-nextjs/SKILL.md +299 -0
- package/bundled-skills/hunt-nodejs/SKILL.md +263 -0
- package/bundled-skills/hunt-nosqli/SKILL.md +210 -0
- package/bundled-skills/hunt-ntlm-info/SKILL.md +314 -0
- package/bundled-skills/hunt-oauth/SKILL.md +459 -0
- package/bundled-skills/hunt-open-redirect/SKILL.md +223 -0
- package/bundled-skills/hunt-race-condition/SKILL.md +381 -0
- package/bundled-skills/hunt-race-condition/references/details.md +159 -0
- package/bundled-skills/hunt-rag-vector/SKILL.md +212 -0
- package/bundled-skills/hunt-rce/SKILL.md +444 -0
- package/bundled-skills/hunt-rce/references/details.md +110 -0
- package/bundled-skills/hunt-saml/SKILL.md +156 -0
- package/bundled-skills/hunt-session/SKILL.md +342 -0
- package/bundled-skills/hunt-shadow-api/SKILL.md +198 -0
- package/bundled-skills/hunt-source-leak/SKILL.md +345 -0
- package/bundled-skills/hunt-spa-api/SKILL.md +163 -0
- package/bundled-skills/hunt-springboot/SKILL.md +285 -0
- package/bundled-skills/hunt-sqli/SKILL.md +466 -0
- package/bundled-skills/hunt-ssrf/SKILL.md +396 -0
- package/bundled-skills/hunt-ssrf/references/details.md +179 -0
- package/bundled-skills/hunt-ssti/SKILL.md +163 -0
- package/bundled-skills/hunt-subdomain/SKILL.md +379 -0
- package/bundled-skills/hunt-tls-network/SKILL.md +399 -0
- package/bundled-skills/hunt-xxe/SKILL.md +466 -0
- package/bundled-skills/i-have-adhd/SKILL.md +170 -0
- package/bundled-skills/identity-access-management/SKILL.md +382 -0
- package/bundled-skills/identity-access-management/references/details.md +524 -0
- package/bundled-skills/incident-management/SKILL.md +484 -0
- package/bundled-skills/incident-response/SKILL.md +448 -0
- package/bundled-skills/incident-response/references/details.md +113 -0
- package/bundled-skills/interview-me/SKILL.md +248 -0
- package/bundled-skills/iso27001-compliance/SKILL.md +460 -0
- package/bundled-skills/jenkins/SKILL.md +462 -0
- package/bundled-skills/jev-use/SKILL.md +158 -0
- package/bundled-skills/kubernetes-hardening/SKILL.md +154 -0
- package/bundled-skills/kubernetes-ops/SKILL.md +449 -0
- package/bundled-skills/kubernetes-ops/references/details.md +108 -0
- package/bundled-skills/kustomize/SKILL.md +478 -0
- package/bundled-skills/linux-administration/SKILL.md +367 -0
- package/bundled-skills/linux-hardening/SKILL.md +154 -0
- package/bundled-skills/llm-app-security/SKILL.md +389 -0
- package/bundled-skills/llm-app-security/references/details.md +674 -0
- package/bundled-skills/llm-caching/SKILL.md +334 -0
- package/bundled-skills/llm-cost-optimization/SKILL.md +311 -0
- package/bundled-skills/llm-fine-tuning/SKILL.md +329 -0
- package/bundled-skills/llm-gateway/SKILL.md +282 -0
- package/bundled-skills/llm-inference-scaling/SKILL.md +286 -0
- package/bundled-skills/llmops-platform-engineering/SKILL.md +472 -0
- package/bundled-skills/load-balancing/SKILL.md +403 -0
- package/bundled-skills/loki-logging/SKILL.md +479 -0
- package/bundled-skills/m365-entra-attack/SKILL.md +423 -0
- package/bundled-skills/mac-mini-llm-lab/SKILL.md +350 -0
- package/bundled-skills/mcp-server-security/SKILL.md +356 -0
- package/bundled-skills/mcp-server-security/references/details.md +745 -0
- package/bundled-skills/mdm-device-management/SKILL.md +404 -0
- package/bundled-skills/mdm-device-management/references/details.md +410 -0
- package/bundled-skills/meme-coin-audit/SKILL.md +402 -0
- package/bundled-skills/mid-engagement-ir-detection/SKILL.md +377 -0
- package/bundled-skills/model-registry-governance/SKILL.md +452 -0
- package/bundled-skills/model-serving-kubernetes/SKILL.md +339 -0
- package/bundled-skills/model-supply-chain-security/SKILL.md +427 -0
- package/bundled-skills/mongodb/SKILL.md +436 -0
- package/bundled-skills/multi-tenant-llm-hosting/SKILL.md +435 -0
- package/bundled-skills/multi-tenant-llm-hosting/references/details.md +211 -0
- package/bundled-skills/mysql/SKILL.md +390 -0
- package/bundled-skills/new-relic/SKILL.md +472 -0
- package/bundled-skills/nfs-storage/SKILL.md +356 -0
- package/bundled-skills/object-storage/SKILL.md +378 -0
- package/bundled-skills/offensive-osint/SKILL.md +443 -0
- package/bundled-skills/okta-attack/SKILL.md +436 -0
- package/bundled-skills/ollama-stack/SKILL.md +379 -0
- package/bundled-skills/openclaw-deployment-hardening/SKILL.md +135 -0
- package/bundled-skills/openclaw-local-mac-mini/SKILL.md +426 -0
- package/bundled-skills/openclaw-local-mac-mini/references/details.md +221 -0
- package/bundled-skills/openclaw-security-hardening/SKILL.md +135 -0
- package/bundled-skills/openshift/SKILL.md +485 -0
- package/bundled-skills/opentelemetry/SKILL.md +438 -0
- package/bundled-skills/opentelemetry/references/details.md +78 -0
- package/bundled-skills/opentofu-migration/SKILL.md +349 -0
- package/bundled-skills/osint-methodology/SKILL.md +460 -0
- package/bundled-skills/osint-methodology/references/details.md +1350 -0
- package/bundled-skills/pci-dss-compliance/SKILL.md +446 -0
- package/bundled-skills/penetration-testing/SKILL.md +152 -0
- package/bundled-skills/performance-tuning/SKILL.md +381 -0
- package/bundled-skills/planetscale/SKILL.md +297 -0
- package/bundled-skills/platform-engineering/SKILL.md +348 -0
- package/bundled-skills/platform-engineering/references/details.md +944 -0
- package/bundled-skills/podman/SKILL.md +405 -0
- package/bundled-skills/policy-as-code/SKILL.md +434 -0
- package/bundled-skills/policy-as-code/references/details.md +204 -0
- package/bundled-skills/postgresql-devsec/SKILL.md +378 -0
- package/bundled-skills/prometheus-grafana/SKILL.md +469 -0
- package/bundled-skills/prompt-injection-defense/SKILL.md +483 -0
- package/bundled-skills/rag-infrastructure/SKILL.md +269 -0
- package/bundled-skills/rag-observability-evals/SKILL.md +444 -0
- package/bundled-skills/rag-observability-evals/references/details.md +92 -0
- package/bundled-skills/recon-scope-triage/SKILL.md +128 -0
- package/bundled-skills/redis/SKILL.md +421 -0
- package/bundled-skills/redteam-report-template/SKILL.md +370 -0
- package/bundled-skills/report-writing/SKILL.md +426 -0
- package/bundled-skills/report-writing/references/details.md +187 -0
- package/bundled-skills/reverse-proxy/SKILL.md +420 -0
- package/bundled-skills/runbook-creation/SKILL.md +438 -0
- package/bundled-skills/runbook-creation/references/details.md +71 -0
- package/bundled-skills/saas-security-posture/SKILL.md +415 -0
- package/bundled-skills/sast-scanning/SKILL.md +444 -0
- package/bundled-skills/sbom-supply-chain/SKILL.md +433 -0
- package/bundled-skills/security-arsenal/SKILL.md +446 -0
- package/bundled-skills/security-arsenal/references/details.md +540 -0
- package/bundled-skills/security-automation/SKILL.md +146 -0
- package/bundled-skills/semantic-versioning/SKILL.md +434 -0
- package/bundled-skills/semantic-versioning/references/details.md +83 -0
- package/bundled-skills/service-mesh/SKILL.md +422 -0
- package/bundled-skills/soc2-compliance/SKILL.md +409 -0
- package/bundled-skills/sops-encryption/SKILL.md +124 -0
- package/bundled-skills/sre-dashboards/SKILL.md +143 -0
- package/bundled-skills/ssh-configuration/SKILL.md +324 -0
- package/bundled-skills/ssl-tls-management/SKILL.md +428 -0
- package/bundled-skills/ssl-tls-management/references/details.md +99 -0
- package/bundled-skills/startup-it-troubleshooting/SKILL.md +415 -0
- package/bundled-skills/supply-chain-attack-recon/SKILL.md +453 -0
- package/bundled-skills/supply-chain-attack-recon/references/details.md +258 -0
- package/bundled-skills/systemd-services/SKILL.md +379 -0
- package/bundled-skills/terraform-aws/SKILL.md +125 -0
- package/bundled-skills/terraform-azure/SKILL.md +415 -0
- package/bundled-skills/terraform-azure/references/details.md +231 -0
- package/bundled-skills/terraform-gcp/SKILL.md +369 -0
- package/bundled-skills/threat-modeling/SKILL.md +487 -0
- package/bundled-skills/user-management/SKILL.md +383 -0
- package/bundled-skills/using-agent-skills/SKILL.md +220 -0
- package/bundled-skills/vector-database-ops/SKILL.md +300 -0
- package/bundled-skills/vendor-management/SKILL.md +439 -0
- package/bundled-skills/vendor-management/references/details.md +109 -0
- package/bundled-skills/vercel-deployments/SKILL.md +296 -0
- package/bundled-skills/vllm-server/SKILL.md +236 -0
- package/bundled-skills/vmware-vcenter-attack/SKILL.md +412 -0
- package/bundled-skills/vpn-setup/SKILL.md +452 -0
- package/bundled-skills/vulnerability-scanning/SKILL.md +448 -0
- package/bundled-skills/waf-setup/SKILL.md +354 -0
- package/bundled-skills/waf-setup/references/details.md +211 -0
- package/bundled-skills/web2-recon/SKILL.md +440 -0
- package/bundled-skills/web2-recon/references/details.md +319 -0
- package/bundled-skills/web3-audit/SKILL.md +445 -0
- package/bundled-skills/web3-audit/references/details.md +224 -0
- package/bundled-skills/windows-hardening/SKILL.md +454 -0
- package/bundled-skills/windows-hardening/references/details.md +204 -0
- package/bundled-skills/windows-server/SKILL.md +318 -0
- package/bundled-skills/zero-trust/SKILL.md +461 -0
- package/package.json +1 -1
- package/skills_index.json +6943 -323
|
@@ -0,0 +1,469 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: prometheus-grafana
|
|
3
|
+
description: Set up metrics collection and visualization with Prometheus and Grafana.
|
|
4
|
+
category: devops
|
|
5
|
+
risk: critical
|
|
6
|
+
source: https://github.com/BagelHole/DevOps-Security-Agent-Skills
|
|
7
|
+
source_repo: BagelHole/DevOps-Security-Agent-Skills
|
|
8
|
+
source_type: community
|
|
9
|
+
date_added: '2026-09-20'
|
|
10
|
+
license: MIT
|
|
11
|
+
license_source: https://github.com/BagelHole/DevOps-Security-Agent-Skills/blob/main/LICENSE
|
|
12
|
+
compatibility: Requires the relevant platform CLIs (kubectl, helm, terraform, git,
|
|
13
|
+
CI runners) and authorized access to the target environment. Docs-only; helper scripts
|
|
14
|
+
and templates not bundled.
|
|
15
|
+
metadata:
|
|
16
|
+
author: devops-skills
|
|
17
|
+
version: '1.0'
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# Prometheus & Grafana
|
|
21
|
+
|
|
22
|
+
Collect metrics and visualize system performance with the Prometheus-Grafana stack.
|
|
23
|
+
|
|
24
|
+
## When to Use This Skill
|
|
25
|
+
|
|
26
|
+
Use this skill when:
|
|
27
|
+
- Setting up metrics collection infrastructure
|
|
28
|
+
- Creating monitoring dashboards
|
|
29
|
+
- Writing PromQL queries for analysis
|
|
30
|
+
- Configuring alerting rules
|
|
31
|
+
- Monitoring Kubernetes clusters
|
|
32
|
+
|
|
33
|
+
## Prerequisites
|
|
34
|
+
|
|
35
|
+
- Docker or Kubernetes for deployment
|
|
36
|
+
- Network access to monitored targets
|
|
37
|
+
- Basic understanding of metrics concepts
|
|
38
|
+
|
|
39
|
+
## Prometheus Setup
|
|
40
|
+
|
|
41
|
+
### Docker Deployment
|
|
42
|
+
|
|
43
|
+
```yaml
|
|
44
|
+
# docker-compose.yml
|
|
45
|
+
version: '3.8'
|
|
46
|
+
|
|
47
|
+
services:
|
|
48
|
+
prometheus:
|
|
49
|
+
image: prom/prometheus:v2.48.0
|
|
50
|
+
ports:
|
|
51
|
+
- "9090:9090"
|
|
52
|
+
volumes:
|
|
53
|
+
- ./prometheus.yml:/etc/prometheus/prometheus.yml
|
|
54
|
+
- ./rules:/etc/prometheus/rules
|
|
55
|
+
- prometheus-data:/prometheus
|
|
56
|
+
command:
|
|
57
|
+
- '--config.file=/etc/prometheus/prometheus.yml'
|
|
58
|
+
- '--storage.tsdb.path=/prometheus'
|
|
59
|
+
- '--storage.tsdb.retention.time=15d'
|
|
60
|
+
|
|
61
|
+
grafana:
|
|
62
|
+
image: grafana/grafana:10.2.0
|
|
63
|
+
ports:
|
|
64
|
+
- "3000:3000"
|
|
65
|
+
volumes:
|
|
66
|
+
- grafana-data:/var/lib/grafana
|
|
67
|
+
environment:
|
|
68
|
+
- GF_SECURITY_ADMIN_PASSWORD=admin
|
|
69
|
+
|
|
70
|
+
volumes:
|
|
71
|
+
prometheus-data:
|
|
72
|
+
grafana-data:
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Configuration
|
|
76
|
+
|
|
77
|
+
```yaml
|
|
78
|
+
# prometheus.yml
|
|
79
|
+
global:
|
|
80
|
+
scrape_interval: 15s
|
|
81
|
+
evaluation_interval: 15s
|
|
82
|
+
|
|
83
|
+
alerting:
|
|
84
|
+
alertmanagers:
|
|
85
|
+
- static_configs:
|
|
86
|
+
- targets:
|
|
87
|
+
- alertmanager:9093
|
|
88
|
+
|
|
89
|
+
rule_files:
|
|
90
|
+
- /etc/prometheus/rules/*.yml
|
|
91
|
+
|
|
92
|
+
scrape_configs:
|
|
93
|
+
- job_name: 'prometheus'
|
|
94
|
+
static_configs:
|
|
95
|
+
- targets: ['localhost:9090']
|
|
96
|
+
|
|
97
|
+
- job_name: 'node'
|
|
98
|
+
static_configs:
|
|
99
|
+
- targets:
|
|
100
|
+
- 'node-exporter:9100'
|
|
101
|
+
|
|
102
|
+
- job_name: 'applications'
|
|
103
|
+
static_configs:
|
|
104
|
+
- targets:
|
|
105
|
+
- 'app1:8080'
|
|
106
|
+
- 'app2:8080'
|
|
107
|
+
metrics_path: /metrics
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Kubernetes Deployment
|
|
111
|
+
|
|
112
|
+
### Using Helm
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# Add Prometheus community Helm repo
|
|
116
|
+
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
|
|
117
|
+
|
|
118
|
+
# Install kube-prometheus-stack
|
|
119
|
+
helm install prometheus prometheus-community/kube-prometheus-stack \
|
|
120
|
+
--namespace monitoring \
|
|
121
|
+
--create-namespace \
|
|
122
|
+
--set grafana.adminPassword=admin
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### ServiceMonitor
|
|
126
|
+
|
|
127
|
+
```yaml
|
|
128
|
+
apiVersion: monitoring.coreos.com/v1
|
|
129
|
+
kind: ServiceMonitor
|
|
130
|
+
metadata:
|
|
131
|
+
name: myapp
|
|
132
|
+
namespace: monitoring
|
|
133
|
+
spec:
|
|
134
|
+
selector:
|
|
135
|
+
matchLabels:
|
|
136
|
+
app: myapp
|
|
137
|
+
endpoints:
|
|
138
|
+
- port: metrics
|
|
139
|
+
interval: 30s
|
|
140
|
+
path: /metrics
|
|
141
|
+
namespaceSelector:
|
|
142
|
+
matchNames:
|
|
143
|
+
- default
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## PromQL Queries
|
|
147
|
+
|
|
148
|
+
### Basic Queries
|
|
149
|
+
|
|
150
|
+
```promql
|
|
151
|
+
# Current CPU usage
|
|
152
|
+
node_cpu_seconds_total{mode="idle"}
|
|
153
|
+
|
|
154
|
+
# Rate of HTTP requests per second
|
|
155
|
+
rate(http_requests_total[5m])
|
|
156
|
+
|
|
157
|
+
# Average response time
|
|
158
|
+
avg(http_request_duration_seconds_sum / http_request_duration_seconds_count)
|
|
159
|
+
|
|
160
|
+
# Memory usage percentage
|
|
161
|
+
(1 - (node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes)) * 100
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Aggregations
|
|
165
|
+
|
|
166
|
+
```promql
|
|
167
|
+
# Sum requests by status code
|
|
168
|
+
sum by (status_code) (rate(http_requests_total[5m]))
|
|
169
|
+
|
|
170
|
+
# Average CPU by instance
|
|
171
|
+
avg by (instance) (rate(node_cpu_seconds_total{mode!="idle"}[5m]))
|
|
172
|
+
|
|
173
|
+
# Top 5 endpoints by request count
|
|
174
|
+
topk(5, sum by (endpoint) (rate(http_requests_total[5m])))
|
|
175
|
+
|
|
176
|
+
# 95th percentile latency
|
|
177
|
+
histogram_quantile(0.95, rate(http_request_duration_seconds_bucket[5m]))
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Time-Based Queries
|
|
181
|
+
|
|
182
|
+
```promql
|
|
183
|
+
# Compare to 1 hour ago
|
|
184
|
+
http_requests_total - http_requests_total offset 1h
|
|
185
|
+
|
|
186
|
+
# Predict disk space in 4 hours
|
|
187
|
+
predict_linear(node_filesystem_avail_bytes[1h], 4 * 3600)
|
|
188
|
+
|
|
189
|
+
# Changes in last 5 minutes
|
|
190
|
+
changes(up[5m])
|
|
191
|
+
|
|
192
|
+
# Average over 24 hours
|
|
193
|
+
avg_over_time(http_requests_total[24h])
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Alerting Rules
|
|
197
|
+
|
|
198
|
+
```yaml
|
|
199
|
+
# rules/alerts.yml
|
|
200
|
+
groups:
|
|
201
|
+
- name: application
|
|
202
|
+
rules:
|
|
203
|
+
- alert: HighErrorRate
|
|
204
|
+
expr: |
|
|
205
|
+
sum(rate(http_requests_total{status=~"5.."}[5m]))
|
|
206
|
+
/ sum(rate(http_requests_total[5m])) > 0.05
|
|
207
|
+
for: 5m
|
|
208
|
+
labels:
|
|
209
|
+
severity: critical
|
|
210
|
+
annotations:
|
|
211
|
+
summary: "High error rate detected"
|
|
212
|
+
description: "Error rate is {{ $value | humanizePercentage }}"
|
|
213
|
+
|
|
214
|
+
- alert: ServiceDown
|
|
215
|
+
expr: up == 0
|
|
216
|
+
for: 1m
|
|
217
|
+
labels:
|
|
218
|
+
severity: critical
|
|
219
|
+
annotations:
|
|
220
|
+
summary: "Service {{ $labels.instance }} is down"
|
|
221
|
+
|
|
222
|
+
- alert: HighMemoryUsage
|
|
223
|
+
expr: |
|
|
224
|
+
(1 - (node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes)) > 0.9
|
|
225
|
+
for: 5m
|
|
226
|
+
labels:
|
|
227
|
+
severity: warning
|
|
228
|
+
annotations:
|
|
229
|
+
summary: "High memory usage on {{ $labels.instance }}"
|
|
230
|
+
description: "Memory usage is {{ $value | humanizePercentage }}"
|
|
231
|
+
|
|
232
|
+
- alert: DiskSpaceLow
|
|
233
|
+
expr: |
|
|
234
|
+
(node_filesystem_avail_bytes{mountpoint="/"} / node_filesystem_size_bytes{mountpoint="/"}) < 0.1
|
|
235
|
+
for: 5m
|
|
236
|
+
labels:
|
|
237
|
+
severity: warning
|
|
238
|
+
annotations:
|
|
239
|
+
summary: "Disk space low on {{ $labels.instance }}"
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## Alertmanager
|
|
243
|
+
|
|
244
|
+
```yaml
|
|
245
|
+
# alertmanager.yml
|
|
246
|
+
global:
|
|
247
|
+
resolve_timeout: 5m
|
|
248
|
+
slack_api_url: 'https://hooks.slack.com/services/xxx'
|
|
249
|
+
|
|
250
|
+
route:
|
|
251
|
+
receiver: 'slack-notifications'
|
|
252
|
+
group_by: ['alertname', 'severity']
|
|
253
|
+
group_wait: 30s
|
|
254
|
+
group_interval: 5m
|
|
255
|
+
repeat_interval: 4h
|
|
256
|
+
routes:
|
|
257
|
+
- match:
|
|
258
|
+
severity: critical
|
|
259
|
+
receiver: 'pagerduty'
|
|
260
|
+
|
|
261
|
+
receivers:
|
|
262
|
+
- name: 'slack-notifications'
|
|
263
|
+
slack_configs:
|
|
264
|
+
- channel: '#alerts'
|
|
265
|
+
send_resolved: true
|
|
266
|
+
title: '{{ .Status | toUpper }}: {{ .CommonAnnotations.summary }}'
|
|
267
|
+
text: '{{ .CommonAnnotations.description }}'
|
|
268
|
+
|
|
269
|
+
- name: 'pagerduty'
|
|
270
|
+
pagerduty_configs:
|
|
271
|
+
- service_key: 'xxx'
|
|
272
|
+
severity: critical
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
## Grafana Dashboards
|
|
276
|
+
|
|
277
|
+
### Dashboard JSON Structure
|
|
278
|
+
|
|
279
|
+
```json
|
|
280
|
+
{
|
|
281
|
+
"dashboard": {
|
|
282
|
+
"title": "Application Metrics",
|
|
283
|
+
"panels": [
|
|
284
|
+
{
|
|
285
|
+
"title": "Request Rate",
|
|
286
|
+
"type": "graph",
|
|
287
|
+
"targets": [
|
|
288
|
+
{
|
|
289
|
+
"expr": "sum(rate(http_requests_total[5m])) by (status_code)",
|
|
290
|
+
"legendFormat": "{{ status_code }}"
|
|
291
|
+
}
|
|
292
|
+
],
|
|
293
|
+
"gridPos": {"x": 0, "y": 0, "w": 12, "h": 8}
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"title": "Latency P95",
|
|
297
|
+
"type": "gauge",
|
|
298
|
+
"targets": [
|
|
299
|
+
{
|
|
300
|
+
"expr": "histogram_quantile(0.95, rate(http_request_duration_seconds_bucket[5m]))"
|
|
301
|
+
}
|
|
302
|
+
],
|
|
303
|
+
"gridPos": {"x": 12, "y": 0, "w": 6, "h": 8}
|
|
304
|
+
}
|
|
305
|
+
]
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### Provisioning Dashboards
|
|
311
|
+
|
|
312
|
+
```yaml
|
|
313
|
+
# grafana/provisioning/dashboards/dashboards.yml
|
|
314
|
+
apiVersion: 1
|
|
315
|
+
|
|
316
|
+
providers:
|
|
317
|
+
- name: 'default'
|
|
318
|
+
orgId: 1
|
|
319
|
+
folder: ''
|
|
320
|
+
type: file
|
|
321
|
+
disableDeletion: false
|
|
322
|
+
updateIntervalSeconds: 30
|
|
323
|
+
options:
|
|
324
|
+
path: /var/lib/grafana/dashboards
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
### Data Source Provisioning
|
|
328
|
+
|
|
329
|
+
```yaml
|
|
330
|
+
# grafana/provisioning/datasources/prometheus.yml
|
|
331
|
+
apiVersion: 1
|
|
332
|
+
|
|
333
|
+
datasources:
|
|
334
|
+
- name: Prometheus
|
|
335
|
+
type: prometheus
|
|
336
|
+
access: proxy
|
|
337
|
+
url: http://prometheus:9090
|
|
338
|
+
isDefault: true
|
|
339
|
+
editable: false
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
## Recording Rules
|
|
343
|
+
|
|
344
|
+
```yaml
|
|
345
|
+
# rules/recording.yml
|
|
346
|
+
groups:
|
|
347
|
+
- name: aggregations
|
|
348
|
+
interval: 30s
|
|
349
|
+
rules:
|
|
350
|
+
- record: job:http_requests:rate5m
|
|
351
|
+
expr: sum by (job) (rate(http_requests_total[5m]))
|
|
352
|
+
|
|
353
|
+
- record: instance:node_cpu:avg_rate5m
|
|
354
|
+
expr: |
|
|
355
|
+
avg by (instance) (
|
|
356
|
+
rate(node_cpu_seconds_total{mode!="idle"}[5m])
|
|
357
|
+
)
|
|
358
|
+
|
|
359
|
+
- record: job:http_latency:p95
|
|
360
|
+
expr: |
|
|
361
|
+
histogram_quantile(0.95,
|
|
362
|
+
sum by (job, le) (rate(http_request_duration_seconds_bucket[5m]))
|
|
363
|
+
)
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
## Application Instrumentation
|
|
367
|
+
|
|
368
|
+
### Go Application
|
|
369
|
+
|
|
370
|
+
```go
|
|
371
|
+
import (
|
|
372
|
+
"github.com/prometheus/client_golang/prometheus"
|
|
373
|
+
"github.com/prometheus/client_golang/prometheus/promhttp"
|
|
374
|
+
)
|
|
375
|
+
|
|
376
|
+
var httpRequests = prometheus.NewCounterVec(
|
|
377
|
+
prometheus.CounterOpts{
|
|
378
|
+
Name: "http_requests_total",
|
|
379
|
+
Help: "Total HTTP requests",
|
|
380
|
+
},
|
|
381
|
+
[]string{"method", "endpoint", "status"},
|
|
382
|
+
)
|
|
383
|
+
|
|
384
|
+
func init() {
|
|
385
|
+
prometheus.MustRegister(httpRequests)
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
// Expose metrics endpoint
|
|
389
|
+
http.Handle("/metrics", promhttp.Handler())
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
### Node.js Application
|
|
393
|
+
|
|
394
|
+
```javascript
|
|
395
|
+
const client = require('prom-client');
|
|
396
|
+
|
|
397
|
+
const httpRequests = new client.Counter({
|
|
398
|
+
name: 'http_requests_total',
|
|
399
|
+
help: 'Total HTTP requests',
|
|
400
|
+
labelNames: ['method', 'endpoint', 'status']
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
// Middleware
|
|
404
|
+
app.use((req, res, next) => {
|
|
405
|
+
res.on('finish', () => {
|
|
406
|
+
httpRequests.inc({
|
|
407
|
+
method: req.method,
|
|
408
|
+
endpoint: req.path,
|
|
409
|
+
status: res.statusCode
|
|
410
|
+
});
|
|
411
|
+
});
|
|
412
|
+
next();
|
|
413
|
+
});
|
|
414
|
+
|
|
415
|
+
// Expose metrics
|
|
416
|
+
app.get('/metrics', async (req, res) => {
|
|
417
|
+
res.set('Content-Type', client.register.contentType);
|
|
418
|
+
res.end(await client.register.metrics());
|
|
419
|
+
});
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
## Common Issues
|
|
423
|
+
|
|
424
|
+
### Issue: Targets Not Discovered
|
|
425
|
+
**Problem**: Prometheus not scraping targets
|
|
426
|
+
**Solution**: Check network connectivity, verify target labels
|
|
427
|
+
|
|
428
|
+
### Issue: High Memory Usage
|
|
429
|
+
**Problem**: Prometheus using excessive memory
|
|
430
|
+
**Solution**: Reduce retention, use recording rules, limit cardinality
|
|
431
|
+
|
|
432
|
+
### Issue: Slow Queries
|
|
433
|
+
**Problem**: PromQL queries timing out
|
|
434
|
+
**Solution**: Use recording rules, limit time ranges, optimize queries
|
|
435
|
+
|
|
436
|
+
### Issue: Missing Data Points
|
|
437
|
+
**Problem**: Gaps in metrics data
|
|
438
|
+
**Solution**: Check scrape interval, verify target availability
|
|
439
|
+
|
|
440
|
+
## Best Practices
|
|
441
|
+
|
|
442
|
+
- Use recording rules for frequently-used queries
|
|
443
|
+
- Limit label cardinality to prevent memory issues
|
|
444
|
+
- Set appropriate retention based on storage capacity
|
|
445
|
+
- Use histogram metrics for latency measurement
|
|
446
|
+
- Implement proper alerting thresholds
|
|
447
|
+
- Version control dashboards as code
|
|
448
|
+
- Use federation for large-scale deployments
|
|
449
|
+
- Regularly review and prune unused metrics
|
|
450
|
+
|
|
451
|
+
## Related Skills
|
|
452
|
+
|
|
453
|
+
- alerting-oncall (`alerting-oncall`) - Alert management
|
|
454
|
+
- loki-logging (`loki-logging`) - Log aggregation
|
|
455
|
+
- kubernetes-ops (`kubernetes-ops`) - K8s monitoring
|
|
456
|
+
|
|
457
|
+
## Limitations
|
|
458
|
+
|
|
459
|
+
- Guidance executes against real environments: confirm target, blast radius, and rollback plan before applying anything.
|
|
460
|
+
- Never deploy to production without explicit approval. Docs-only import: upstream scripts and templates not bundled.
|
|
461
|
+
|
|
462
|
+
### Example
|
|
463
|
+
|
|
464
|
+
```bash
|
|
465
|
+
git status && git diff --stat
|
|
466
|
+
kubectl diff -f manifest.yaml
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
> Adapted from [BagelHole/DevOps-Security-Agent-Skills](https://github.com/BagelHole/DevOps-Security-Agent-Skills) (MIT); frontmatter, When to Use/Limitations, and safety boundaries added for upstream compliance. Docs-only import: helper scripts and templates not bundled.
|