Add initial project structure and configuration for monitoring suite
- Create .gitignore to exclude Python-generated files and virtual environments - Add .python-version for Python version management - Initialize README.md with project description and usage instructions - Implement alloy.river configuration for Grafana Alloy observability - Set up grafana.ini for Grafana configuration - Configure dashboards.yml for automatic dashboard loading in Grafana - Define datasources.yml for connecting Grafana to Prometheus, Loki, and Tempo - Establish loki.yaml configuration for Loki logging - Set up prometheus.yml for Prometheus metrics collection - Configure tempo.yaml for Tempo tracing - Create docker-compose.yml for orchestrating services - Develop init.sh script for initializing project directories and services - Implement main.py as the entry point for the application - Define pyproject.toml for project metadata and dependencies - Update uv.lock for dependency management
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
# Configuración principal de Grafana
|
||||
# Puedes editar este archivo para personalizar Grafana
|
||||
|
||||
[server]
|
||||
# Puerto HTTP
|
||||
http_port = 3000
|
||||
# Dominio de la aplicación
|
||||
domain = localhost
|
||||
# URL raíz
|
||||
root_url = http://localhost:3000/
|
||||
|
||||
[database]
|
||||
# Tipo de base de datos (sqlite3, mysql, postgres)
|
||||
type = sqlite3
|
||||
# Ruta de la base de datos SQLite
|
||||
path = /var/lib/grafana/grafana.db
|
||||
|
||||
[security]
|
||||
# Usuario administrador por defecto
|
||||
admin_user = admin
|
||||
# Contraseña administrador por defecto
|
||||
admin_password = admin123
|
||||
# Clave secreta para cookies
|
||||
secret_key = your_secret_key_here
|
||||
|
||||
[users]
|
||||
# Permitir registro de usuarios
|
||||
allow_sign_up = false
|
||||
# Permitir que los usuarios creen organizaciones
|
||||
allow_org_create = false
|
||||
# Asignación automática de organización
|
||||
auto_assign_org = true
|
||||
# Rol por defecto para nuevos usuarios
|
||||
auto_assign_org_role = Viewer
|
||||
|
||||
[auth.anonymous]
|
||||
# Habilitar acceso anónimo
|
||||
enabled = false
|
||||
|
||||
[logging]
|
||||
# Nivel de logging (debug, info, warn, error)
|
||||
level = info
|
||||
# Formato de logging (console, json)
|
||||
format = console
|
||||
|
||||
[metrics]
|
||||
# Habilitar métricas internas de Grafana
|
||||
enabled = true
|
||||
# Intervalo de recolección de métricas
|
||||
interval_seconds = 10
|
||||
|
||||
[unified_alerting]
|
||||
# Habilitar nuevo sistema de alertas
|
||||
enabled = true
|
||||
|
||||
[explore]
|
||||
# Habilitar el modo Explore
|
||||
enabled = true
|
||||
|
||||
[feature_toggles]
|
||||
# Habilitar características experimentales
|
||||
enable = newPanelChromeUI
|
||||
|
||||
[panels]
|
||||
# Deshabilitar sanitización de HTML en paneles de texto
|
||||
disable_sanitize_html = false
|
||||
|
||||
[plugins]
|
||||
# Permitir carga de plugins sin firma
|
||||
allow_loading_unsigned_plugins = false
|
||||
# Habilitar plugins por defecto
|
||||
enable_alpha = false
|
||||
@@ -0,0 +1,29 @@
|
||||
# Configuración de dashboards para Grafana
|
||||
# Puedes editar este archivo para configurar la carga automática de dashboards
|
||||
|
||||
apiVersion: 1
|
||||
|
||||
providers:
|
||||
# Proveedor principal de dashboards
|
||||
- name: 'default'
|
||||
orgId: 1
|
||||
folder: ''
|
||||
type: file
|
||||
disableDeletion: false
|
||||
editable: true
|
||||
updateIntervalSeconds: 10
|
||||
allowUiUpdates: true
|
||||
options:
|
||||
path: /var/lib/grafana/dashboards
|
||||
|
||||
# Proveedor para dashboards de sistema
|
||||
- name: 'system'
|
||||
orgId: 1
|
||||
folder: 'System'
|
||||
type: file
|
||||
disableDeletion: false
|
||||
editable: true
|
||||
updateIntervalSeconds: 10
|
||||
allowUiUpdates: true
|
||||
options:
|
||||
path: /var/lib/grafana/dashboards/system
|
||||
@@ -0,0 +1,94 @@
|
||||
apiVersion: 1
|
||||
|
||||
# Configuración automática de datasources para Grafana
|
||||
# Conexión directa a Prometheus, Loki y Tempo
|
||||
datasources:
|
||||
# Prometheus para métricas
|
||||
- name: Prometheus
|
||||
type: prometheus
|
||||
access: proxy
|
||||
url: http://prometheus:9090
|
||||
uid: prometheus
|
||||
isDefault: true
|
||||
editable: false
|
||||
jsonData:
|
||||
httpMethod: POST
|
||||
prometheusType: Prometheus
|
||||
prometheusVersion: 2.40.0
|
||||
cacheLevel: 'High'
|
||||
disableRecordingRules: false
|
||||
incrementalQueryOverlapWindow: 10m
|
||||
exemplarTraceIdDestinations:
|
||||
- name: TraceID
|
||||
datasourceUid: tempo
|
||||
urlDisplayLabel: "View Trace"
|
||||
|
||||
# Loki para logs
|
||||
- name: Loki
|
||||
type: loki
|
||||
access: proxy
|
||||
url: http://loki:3100
|
||||
uid: loki
|
||||
editable: false
|
||||
jsonData:
|
||||
maxLines: 1000
|
||||
derivedFields:
|
||||
- datasourceUid: tempo
|
||||
matcherRegex: "(?:traceID|trace_id|traceid)=([A-Fa-f0-9]+)"
|
||||
name: TraceID
|
||||
url: "$${__value.raw}"
|
||||
urlDisplayLabel: "View Trace"
|
||||
|
||||
# Tempo para trazas
|
||||
- name: Tempo
|
||||
type: tempo
|
||||
access: proxy
|
||||
url: http://tempo:3200
|
||||
uid: tempo
|
||||
editable: false
|
||||
jsonData:
|
||||
httpMethod: GET
|
||||
tracesToLogs:
|
||||
datasourceUid: loki
|
||||
tags: ['job', 'instance', 'pod', 'namespace', 'container']
|
||||
mappedTags: [
|
||||
{
|
||||
key: 'service.name',
|
||||
value: 'service'
|
||||
},
|
||||
{
|
||||
key: 'container.name',
|
||||
value: 'container'
|
||||
}
|
||||
]
|
||||
mapTagNamesEnabled: true
|
||||
spanStartTimeShift: '1h'
|
||||
spanEndTimeShift: '1h'
|
||||
filterByTraceID: true
|
||||
filterBySpanID: false
|
||||
tracesToMetrics:
|
||||
datasourceUid: prometheus
|
||||
tags: [
|
||||
{
|
||||
key: 'service.name',
|
||||
value: 'service'
|
||||
},
|
||||
{
|
||||
key: 'job'
|
||||
}
|
||||
]
|
||||
queries:
|
||||
- name: 'Request Rate'
|
||||
query: 'rate(traces_service_graph_request_total{$$__tags}[5m])'
|
||||
- name: 'Error Rate'
|
||||
query: 'rate(traces_service_graph_request_failed_total{$$__tags}[5m])'
|
||||
- name: 'Duration P99'
|
||||
query: 'histogram_quantile(0.99, rate(traces_spanmetrics_latency_bucket{$$__tags}[5m]))'
|
||||
serviceMap:
|
||||
datasourceUid: prometheus
|
||||
search:
|
||||
hide: false
|
||||
nodeGraph:
|
||||
enabled: true
|
||||
lokiSearch:
|
||||
datasourceUid: loki
|
||||
Reference in New Issue
Block a user