Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-2.9.x] chore(promtail): Use minimal init config in rpm/deb packaging. #11676

Merged
merged 2 commits into from
Jan 17, 2024
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
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,52 @@
##### Changes

* [11121](https://github.com/grafana/loki/pull/11121) **periklis** Ensure all lifecycler cfgs ref a valid IPv6 addr and port combination
* [10650](https://github.com/grafana/loki/pull/10650) **matthewpi** Ensure the frontend uses a valid IPv6 addr and port combination
* [11665](https://github.com/grafana/loki/pull/11665) **salvacorts** Deprecate and flip `-legacy-read-mode` flag to `false` by default.

#### Promtail

* [10752](https://github.com/grafana/loki/pull/10752) **gonzalesraul**: structured_metadata: enable structured_metadata convert labels
* [11511](https://github.com/grafana/loki/pull/11511) **kavirajk**: chore(promtail): Improve default configuration that is shipped with rpm/deb packages to avoid possible high CPU utilisation if there are lots of files inside `/var/log`.

##### Enhancements

* [10416](https://github.com/grafana/loki/pull/10416) **lpugoy**: Lambda-Promtail: Add support for WAF logs in S3
* [10301](https://github.com/grafana/loki/pull/10301) **wildum**: users can now define `additional_fields` in cloudflare configuration.
* [10755](https://github.com/grafana/loki/pull/10755) **hainenber**: Lambda-Promtail: Add support for dropping labels passed via env var

##### Changes

* [10677](https://github.com/grafana/loki/pull/10677) **chaudum** Remove deprecated `stream_lag_labels` setting from both the `options` and `client` configuration sections.
* [10689](https://github.com/grafana/loki/pull/10689) **dylanguedes**: Ingester: Make jitter to be 20% of flush check period instead of 1%.
* [11420](https://github.com/grafana/loki/pull/11420) **zry98**: Show a clearer reason in "disable watchConfig" log message when server is disabled.

##### Fixes

* [10631](https://github.com/grafana/loki/pull/10631) **thampiotr**: Fix race condition in cleaning up metrics when stopping to tail files.
* [10798](https://github.com/grafana/loki/pull/10798) **hainenber**: Fix agent panicking after reloaded due to duplicate metric collector registration.
* [10848](https://github.com/grafana/loki/pull/10848) **rgroothuijsen**: Correctly parse list of drop stage sources from YAML.

#### LogCLI

#### Mixins

* [11087](https://github.com/grafana/loki/pull/11087) **JoaoBraveCoding**: Adds structured metadata panels for ingested data
* [11637](https://github.com/grafana/loki/pull/11637) **JoaoBraveCoding**: Add route to write Distributor Latency dashboard

#### Fixes

#### FluentD

#### Jsonnet

* [11312](https://github.com/grafana/loki/pull/11312) **sentoz**: Loki ksonnet: Do not generate configMap for consul if you are using memberlist

* [11020](https://github.com/grafana/loki/pull/11020) **ashwanthgoli**: Loki ksonnet: Do not generate table-manager manifests if shipper store is in-use.

* [10784](https://github.com/grafana/loki/pull/10894) **slim-bean** Update index gateway client to use a headless service.

* [10542](https://github.com/grafana/loki/pull/10542) **chaudum**: Remove legacy deployment mode for ingester (Deployment, without WAL) and instead always run them as StatefulSet.

## 2.9.2 (2023-10-16)

Expand Down
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: './tools/packaging/promtail-minimal-config.yaml',
dst: '/etc/promtail/config.yml',
type: 'config|noreplace',
},
Expand Down
24 changes: 24 additions & 0 deletions tools/packaging/promtail-minimal-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This minimal config scrape only single log file.
# Primarily used in rpm/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
#NOTE: Need to be modified to scrape any additional logs of the system.
__path__: /var/log/messages
4 changes: 2 additions & 2 deletions tools/packaging/verify-deb-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ cat <<EOF | docker exec --interactive "${image}" sh

# Write some logs
mkdir -p /var/log/
echo "blablabla" > /var/log/test.log
echo "blablabla" >> /var/log/messages

# Install logcli
dpkg -i ${dir}/dist/logcli_*_amd64.deb
Expand All @@ -31,4 +31,4 @@ cat <<EOF | docker exec --interactive "${image}" sh
labels_found=\$(logcli labels)
echo "Found labels: \$labels_found"
[ "\$labels_found" != "" ] || (echo "no logs found with logcli" && exit 1)
EOF
EOF
4 changes: 2 additions & 2 deletions tools/packaging/verify-rpm-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cat <<EOF | docker exec --interactive "${image}" sh

# Write some logs
mkdir -p /var/log/
echo "blablabla" > /var/log/test.log
echo "blablabla" >> /var/log/messages

# Install logcli
rpm -i ${dir}/dist/logcli-*.x86_64.rpm
Expand All @@ -34,4 +34,4 @@ cat <<EOF | docker exec --interactive "${image}" sh
labels_found=\$(logcli labels)
echo "Found labels: \$labels_found"
[ "\$labels_found" != "" ] || (echo "no labels found with logcli" && exit 1)
EOF
EOF