loki icon indicating copy to clipboard operation
loki copied to clipboard

Unable to disable "service_name" feature via CLI

Open nehaev opened this issue 9 months ago • 3 comments

Describe the bug The documentation states that CLI flag -validation.discover-service-name can be used to set which label to take "service_name" from, or to disable "service_name" label completely. Neither of these works.

To Reproduce Steps to reproduce the behavior:

  1. Start Loki v3.0.0 with a clean (i.e., no discover_service_name defined) config file and the CLI flag that should disable "service_name" feature: loki -config.file=/etc/loki/local-config.yaml -validation.discover-service-name=
  2. Send a log record with a label app=my-app
  3. Query this record from Loki and see now it has two labels instead of one: app=my-app, service_name=my-app

Expected behavior CLI flag -validation.discover-service-name can be used to set which label to take "service_name" from, or to disable "service_name" label completely.

nehaev avatar May 12 '24 22:05 nehaev

side quest: why is this a -validation. setting?

matryer avatar May 14 '24 11:05 matryer

While a default value is provided, the setter is append-only, which would cause any user-defined values to be added at the end of the list instead of creating a new list.

rgroothuijsen avatar May 16 '24 18:05 rgroothuijsen

@matryer that's a side affect of it being a per-tenant limit, so it's following the pattern of the other ones, ie validation.max-length-label-name, validation.max-length-label-value, validation.max-label-names-per-series, etc.

we can change it though :)

trevorwhitney avatar May 16 '24 22:05 trevorwhitney