Add observability platform Ansible project
Deploys the Grafana stack (Prometheus/Alertmanager/Loki/Tempo/Grafana with Alloy as collector) and the ELK stack (Filebeat/Logstash/Elasticsearch/ Kibana) via Docker Compose on a target host. External to the application repo, pre-built by the mentor.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
filebeat.inputs:
|
||||
- type: filestream
|
||||
id: docker-containers
|
||||
enabled: true
|
||||
paths:
|
||||
- /var/lib/docker/containers/*/*.log
|
||||
parsers:
|
||||
- container:
|
||||
stream: all
|
||||
format: docker
|
||||
|
||||
processors:
|
||||
- add_docker_metadata:
|
||||
host: unix:///var/run/docker.sock
|
||||
- add_host_metadata: ~
|
||||
|
||||
output.logstash:
|
||||
hosts: ["logstash:5044"]
|
||||
|
||||
logging.level: info
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
apiVersion: 1
|
||||
|
||||
datasources:
|
||||
- name: Elasticsearch
|
||||
uid: elasticsearch
|
||||
type: elasticsearch
|
||||
access: proxy
|
||||
url: http://elasticsearch:9200
|
||||
database: "logs-*"
|
||||
isDefault: true
|
||||
editable: true
|
||||
jsonData:
|
||||
index: "logs-*"
|
||||
interval: Daily
|
||||
timeField: "@timestamp"
|
||||
logMessageField: message
|
||||
logLevelField: log.level
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
input {
|
||||
beats {
|
||||
port => 5044
|
||||
}
|
||||
tcp {
|
||||
port => 5000
|
||||
codec => json_lines
|
||||
}
|
||||
}
|
||||
|
||||
filter {
|
||||
if [message] =~ /^\s*\{/ {
|
||||
json {
|
||||
source => "message"
|
||||
skip_on_invalid_json => true
|
||||
}
|
||||
}
|
||||
mutate {
|
||||
add_field => { "[@metadata][target_index]" => "logs-%{+YYYY.MM.dd}" }
|
||||
}
|
||||
}
|
||||
|
||||
output {
|
||||
elasticsearch {
|
||||
hosts => ["http://elasticsearch:9200"]
|
||||
index => "%{[@metadata][target_index]}"
|
||||
}
|
||||
stdout { codec => dots }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user