Skip to content

Commit

Permalink
chore(promtail): Use minimal init config in npm/deb packaging.
Browse files Browse the repository at this point in the history
Related issue: #11398

This minimal config scrape only single file thus not overloading the systems as described in the issue

Signed-off-by: Kaviraj <[email protected]>
  • Loading branch information
kavirajk committed Dec 18, 2023
1 parent 724a841 commit bd0dd7d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
23 changes: 23 additions & 0 deletions clients/cmd/promtail/promtail-minimal-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This minimal config scrape only single log file.
# Primarily used in npm/deb packaging where promtail service can be started during system init process.
# And too much scraping during init process can overload the complete system.
# https://github.com/grafana/loki/issues/11398

server:
http_listen_port: 9080
grpc_listen_port: 0

positions:
filename: /tmp/positions.yaml

clients:
- url: http://localhost:3100/loki/api/v1/push

scrape_configs:
- job_name: system
static_configs:
- targets:
- localhost
labels:
job: varlogs
__path__: /var/log/messages
8 changes: 4 additions & 4 deletions tools/packaging/nfpm.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ local overrides = {

loki: {
description: |||
Loki is a horizontally-scalable, highly-available, multi-tenant log aggregation system inspired by Prometheus.
It is designed to be very cost effective and easy to operate.
Loki is a horizontally-scalable, highly-available, multi-tenant log aggregation system inspired by Prometheus.
It is designed to be very cost effective and easy to operate.
It does not index the contents of the logs, but rather a set of labels for each log stream.
|||,
contents+: [
Expand All @@ -35,7 +35,7 @@ local overrides = {

promtail: {
description: |||
Promtail is an agent which ships the contents of local logs to a private Grafana Loki instance or Grafana Cloud.
Promtail is an agent which ships the contents of local logs to a private Grafana Loki instance or Grafana Cloud.
It is usually deployed to every machine that has applications needed to be monitored.
|||,
license: 'Apache-2.0',
Expand All @@ -45,7 +45,7 @@ local overrides = {
dst: '/etc/systemd/system/promtail.service',
},
{
src: './clients/cmd/promtail/promtail-local-config.yaml',
src: './clients/cmd/promtail/promtail-minimal-config.yaml',
dst: '/etc/promtail/config.yml',
type: 'config|noreplace',
},
Expand Down

0 comments on commit bd0dd7d

Please sign in to comment.