akin-ozer/cc-devops-skills/loki-config-generator
Claude Code and agent skill by akin-ozer/cc-devops-skills
- community
Checking that the SKILL.md file is still in the repository.
Generate/create Loki configs — ingester, querier, compactor, ruler, S3/GCS/Azure backends.
Install
npx vskill@latest install akin-ozer/cc-devops-skills/loki-config-generatorSKILL.md
Loki Configuration Generator
Overview
Generate production-ready Grafana Loki server configurations with best practices. Supports monolithic, simple scalable, and microservices deployment modes with S3, GCS, Azure, or filesystem storage.
Current Stable: Loki 3.6.2 (November 2025)Important: Promtail deprecated in 3.4 - use Grafana Alloy instead. Seeexamples/grafana-alloy.alloyfor the Alloy pipeline andexamples/grafana-alloy-daemonset.yamlfor the Kubernetes deployment.
When to Use
Invoke when: deploying Loki, creating configs from scratch, migrating to Loki, implementing multi-tenant logging, configuring storage backends, or optimizing existing deployments.
Generation Methods
Method 1: Script Generation (Recommended)
Use `scripts/generate_config.py` for consistent, validated configurations:
Script Options:
| Option | Description | |
|---|---|---|
--mode | monolithic, simple-scalable, microservices | |
--storage | filesystem, s3, gcs, azure | |
--auth-enabled / --no-auth-enabled | Explicitly enable/disable auth | |
--otlp-enabled | Enable OTLP ingestion configuration | |
--thanos-storage | Use Thanos object storage client (3.4+, cloud backends) | |
--time-sharding | Enable out-of-order ingestion (simple-scalable) | |
--ruler | Enable alerting/recording rules (not monolithic) | |
--horizontal-compactor | main/worker mode (simple-scalable, 3.6+) | |
--zone-awareness | Enable multi-AZ placement safeguards | |
--limits-dry-run | Log limit rejections without enforcing |
Method 2: Manual Configuration
Follow the staged workflow below when script generation doesn't meet specific requirements or when learning the configuration structure.
Output Formats
For Kubernetes deployments, generate BOTH formats:
- Native Loki config (
loki-config.yaml) - For ConfigMap or direct use - Helm values (
values.yaml) - For Helm chart deployments
See examples/kubernetes-helm-values.yaml for Helm format.
Documentation Lookup
When to Use Context7/Web Search
REQUIRED - Use Context7 MCP for:
- Configuring features from Loki 3.4+ (Thanos storage, time sharding)
- Configuring features from Loki 3.6+ (horizontal compactor, enforced labels)
- Bloom filter configuration (complex, experimental)
- Custom OTLP attribute mappings beyond standard patterns
- Troubleshooting configuration errors
OPTIONAL - Skip documentation lookup for:
- Standard deployment modes (monolithic, simple-scalable)
- Basic storage configuration (S3, GCS, Azure, filesystem)
- Default limits and component settings
- Configurations covered in
references/directory
Context7 MCP (preferred)
Example topics: storage_config, limits_config, otlp, compactor, ruler, bloom
Web Search Fallback
Use when Context7 unavailable: "Grafana Loki 3.6 [component] configuration documentation site:grafana.com"
Configuration Workflow
Stage 1: Gather Requirements
Deployment Mode:
| Mode | Scale | Use Case | |
|---|---|---|---|
| Monolithic | <100GB/day | Testing, development | |
| Simple Scalable | 100GB-1TB/day | Production | |
| Microservices | >1TB/day | Large-scale, multi-tenant |
Storage Backend: S3, GCS, Azure Blob, Filesystem, MinIO
Key Questions: Expected log volume? Retention period? Multi-tenancy needed? High availability requirements? Kubernetes deployment?
Ask the user directly if required information is missing.
Stage 2: Schema Configuration (CRITICAL)
For all new deployments (Loki 2.9+), use TSDB with v13 schema:
Key: Schema cannot change after deployment without migration.
Stage 3: Storage Configuration
S3:
GCS: gcs: { bucket_name: loki-bucket } Azure: azure: { container_name: loki-container, account_name: ${AZURE_ACCOUNT_NAME} } Filesystem: filesystem: { chunks_directory: /loki/chunks, rules_directory: /loki/rules }
Stage 4: Component Configuration
Ingester:
Querier:
Compactor:
Stage 5: Limits Configuration
Stage 6: Server & Auth
Stage 7: OTLP Ingestion (Loki 3.0+)
Native OpenTelemetry ingestion - use otlphttp exporter (NOT deprecated lokiexporter):
Actions: index_label (searchable, low-cardinality), structured_metadata (queryable), drop
⚠️ NEVER use `k8s.pod.name` as index_label - use structured_metadata instead.
OTel Collector:
Stage 8: Caching
Stage 9: Advanced Features
Pattern Ingester (3.0+):
Bloom Filters (Experimental, 3.3+): Only for >75TB/month deployments. Works on structured metadata only. See examples/ for config.
Time Sharding (3.4+): For out-of-order ingestion:
Thanos Storage (3.4+): New storage client, opt-in now, default later:
Stage 10: Ruler (Alerting)
Stage 11: Loki 3.6 Features
- Horizontally Scalable Compactor:
horizontal_scaling_mode: main|worker - Policy-Based Enforced Labels:
enforced_labels: [service.name] - FluentBit v4:
structured_metadataparameter support
Stage 12: Validate Configuration (REQUIRED)
Always validate before deployment:
Validation Checklist:
- [ ] No syntax errors from
-verify-config - [ ] Schema uses
tsdbandv13 - [ ]
replication_factor: 3for production - [ ]
auth_enabled: trueif multi-tenant - [ ] Storage credentials/IAM configured
- [ ] Retention period matches requirements
Production Checklist
High Availability Requirements
Zone-Aware Replication (CRITICAL for production multi-AZ deployments):
When using replication_factor: 3, ALWAYS enable zone-awareness for multi-AZ deployments:
Why: Without zone-awareness, all 3 replicas may land in the same AZ. If that AZ fails, you lose data.
Kubernetes Implementation:
TLS Configuration (Production Required)
Enable TLS for all inter-component and client communication:
See examples/production-tls.yaml for complete TLS configuration.
Production Checklist Summary
| Requirement | Setting | Required For | |
|---|---|---|---|
replication_factor: 3 | common block | All production | |
zone_awareness_enabled: true | ingester.lifecycler.ring | Multi-AZ | |
auth_enabled: true | root level | Multi-tenant | |
| TLS enabled | server block | All production | |
| IAM roles (not keys) | storage config | Cloud storage | |
| Caching enabled | chunk_store_config, query_range | Performance | |
| Pattern ingester | pattern_ingester.enabled | Observability | |
| Retention configured | compactor + limits_config | Cost control |
Monitoring Recommendations
Key Metrics to Monitor
Configure Prometheus to scrape Loki metrics and alert on these critical indicators:
Critical Alerts
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingdevops-skills-plugin/skills/loki-config-generator/SKILL.md
Popularity
- Repository stars
- 294
- Repository forks
- 32
- 7-day trend score
- 28
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 19 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/akin-ozer/cc-devops-skills/loki-config-generator)