|
| 1 | +// Copyright Dave Verwer, Sven A. Schmidt, and other contributors. |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +loki.process "system" { |
| 16 | + forward_to = [loki.write.default.receiver] |
| 17 | + |
| 18 | + stage.docker { } |
| 19 | + |
| 20 | + stage.regex { |
| 21 | + expression = "\\[component:\\s*(?P<component>[\\w,-]+)\\]" |
| 22 | + } |
| 23 | + |
| 24 | + stage.labels { |
| 25 | + values = { |
| 26 | + component = null, |
| 27 | + } |
| 28 | + } |
| 29 | + |
| 30 | + stage.drop { |
| 31 | + // Drop Grafana logs so we don't do the "grep greps its own output"-thing |
| 32 | + // https://github.com/SwiftPackageIndex/SwiftPackageIndex-Server/issues/839 |
| 33 | + expression = "caller=metrics.go:" |
| 34 | + } |
| 35 | +} |
| 36 | + |
| 37 | +loki.source.file "system" { |
| 38 | + targets = [{ |
| 39 | + __address__ = "localhost", |
| 40 | + __path__ = "/var/log/*/*.log", |
| 41 | + job = "containers", |
| 42 | + }] |
| 43 | + forward_to = [loki.process.system.receiver] |
| 44 | + |
| 45 | + file_match { |
| 46 | + enabled = true |
| 47 | + } |
| 48 | + legacy_positions_file = "/tmp/positions.yaml" |
| 49 | +} |
| 50 | + |
| 51 | +loki.write "default" { |
| 52 | + endpoint { |
| 53 | + url = "http://loki:3100/loki/api/v1/push" |
| 54 | + } |
| 55 | + external_labels = {} |
| 56 | +} |
0 commit comments