Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions infrastructure/config.alloy
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// Copyright Dave Verwer, Sven A. Schmidt, and other contributors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

loki.process "system" {
forward_to = [loki.write.default.receiver]

stage.docker { }

stage.regex {
expression = "\\[component:\\s*(?P<component>[\\w,-]+)\\]"
}

stage.labels {
values = {
component = null,
}
}

stage.drop {
// Drop Grafana logs so we don't do the "grep greps its own output"-thing
// https://github.com/SwiftPackageIndex/SwiftPackageIndex-Server/issues/839
expression = "caller=metrics.go:"
}
}

loki.source.file "system" {
targets = [{
__address__ = "localhost",
__path__ = "/var/log/*/*.log",
job = "containers",
}]
forward_to = [loki.process.system.receiver]

file_match {
enabled = true
}
legacy_positions_file = "/tmp/positions.yaml"
}

loki.write "default" {
endpoint {
url = "http://loki:3100/loki/api/v1/push"
}
external_labels = {}
}
42 changes: 0 additions & 42 deletions infrastructure/promtail.yml

This file was deleted.

17 changes: 8 additions & 9 deletions mon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,13 @@ services:
- app_backend


promtail:
# https://github.com/grafana/loki/releases
# (promtail is released in parallel with loki)
image: grafana/promtail:3.5.1
command: -config.file=/promtail.yml
alloy:
# https://github.com/grafana/alloy/releases
image: grafana/alloy:v1.15.1
command: run /config.alloy
configs:
- source: promtail_cfg
target: /promtail.yml
- source: alloy_cfg
target: /config.alloy
volumes:
- /var/lib/docker/containers:/var/log
networks:
Expand Down Expand Up @@ -129,8 +128,8 @@ services:
configs:
loki_cfg:
file: ./infrastructure/loki.yml
promtail_cfg:
file: ./infrastructure/promtail.yml
alloy_cfg:
file: ./infrastructure/config.alloy
prometheus_cfg:
file: ./infrastructure/prometheus.yml

Expand Down
Loading