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

metric_aggregation_enabled and metric_aggregation settings do not work in Loki 3.1.2 #15567

Open
hoonyworld opened this issue Dec 31, 2024 · 2 comments
Labels
type/bug Somehing is not working as expected

Comments

@hoonyworld
Copy link

hoonyworld commented Dec 31, 2024

Describe the bug

In Loki 3.1.2, the metric_aggregation_enabled and metric_aggregation configuration options are not working as expected. When these settings are included in the cmd/loki/loki-local-config.yaml file and Loki is started using docker-compose, the following error occurs:

failed parsing config: /etc/loki/local-config.yaml: yaml: unmarshal errors:
  line 32: field metric_aggregation_enabled not found in type validation.plain
  line 48: field metric_aggregation not found in type pattern.Config. Use `-config.expand-env=true` flag if you want to expand environment variables in your config file

To Reproduce
Steps to reproduce the behavior:

  1. Use Loki 3.1.2(latest) version.
  2. Include the following configuration in loki-local-config.yaml
limits_config:
  metric_aggregation_enabled: true

pattern_ingester:
  enabled: true
  metric_aggregation:
    loki_address: localhost:3100
  1. Start Loki with docker-compose.
  2. Observe the following error message
failed parsing config: /etc/loki/local-config.yaml: yaml: unmarshal errors:
  line 32: field metric_aggregation_enabled not found in type validation.plain
  line 48: field metric_aggregation not found in type pattern.Config. Use `-config.expand-env=true` flag if you want to expand environment variables in your config file

Expected behavior
I expected that enabling metric_aggregation_enabled: true would activate metric aggregation functionality in Loki. Additionally, the metric_aggregation configuration under pattern_ingester should work as intended for log aggregation.

Environment:

  • Infrastructure: Ubuntu 24, Docker
  • Deployment tool: Docker Compose

Screenshots, Promtail config, or terminal output

  • Here is the relevant section of the loki-local-config.yaml file:
auth_enabled: false

server:
  http_listen_port: 3100
  log_level: info

common:
  instance_addr: 127.0.0.1
  path_prefix: /var/loki
  storage:
    filesystem:
      chunks_directory: /var/loki/chunks
      rules_directory: /var/loki/rules
  replication_factor: 1
  ring:
    kvstore:
      store: inmemory

query_range:
  results_cache:
    cache:
      embedded_cache:
        enabled: true
        max_size_mb: 100

limits_config:
  metric_aggregation_enabled: true

schema_config:
  configs:
    - from: 2020-10-24
      store: tsdb
      object_store: filesystem
      schema: v13
      index:
        prefix: index_
        period: 24h

pattern_ingester:
  enabled: true
  metric_aggregation:
    loki_address: localhost:3100

ruler:
  alertmanager_url: http://localhost:9093

frontend:
  encoding: protobuf
  • The following error appears when Loki attempts to start
Image
@hoonyworld hoonyworld changed the title metric_aggregation_enabled and metric_aggregation settings do not work in Rocky 3.3.2 metric_aggregation_enabled and metric_aggregation settings do not work in Loki 3.3.2 Dec 31, 2024
@hoonyworld hoonyworld changed the title metric_aggregation_enabled and metric_aggregation settings do not work in Loki 3.3.2 metric_aggregation_enabled and metric_aggregation settings do not work in Loki 3.1.2 Dec 31, 2024
@JStickler JStickler added the type/bug Somehing is not working as expected label Jan 6, 2025
@chaudum
Copy link
Contributor

chaudum commented Jan 8, 2025

@hoonyworld You are using the example config for a wrong Loki version. You can find the loki-local-config.yaml for 3.1.x here: https://github.com/grafana/loki/blob/release-3.1.x/cmd/loki/loki-local-config.yaml

@danielo515
Copy link

This same problem happens with loki 3.3.0, but in the opposite direction.

This is what the default example file here has:

pattern_ingester:
  enabled: true
  metric_aggregation:
    enabled: true
    loki_address: localhost:3100

And this is the output from loki 3.3.0:

loki, version 3.3.0 (branch: , revision: unknown)
  build user:       buildozer@build-edge-x86_64
  build date:       2024-12-01T16:51:48Z
  go version:       go1.23.3
  platform:         linux/amd64
  tags:             netgo
grafana:~# loki -config.file=/etc/loki/loki-local-config.yaml -config.expand-env=true
failed parsing config: /etc/loki/loki-local-config.yaml: yaml: unmarshal errors:
  line 41: field enabled not found in type aggregation.Config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Somehing is not working as expected
Projects
None yet
4 participants