dskit
dskit copied to clipboard
How to configure Logger in yaml
We are getting this error when try exporter logs from Tempo as json format:
{"index"=>{"status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse field [ts] of type [float] in document with id 'wsMnW5AB6IW1ExbRjrjx'. Preview of field's value: '2024-06-27T19:23:52.997740845Z'", "caused_by"=>{"type"=>"number_format_exception", "reason"=>"For input string: \"2024-06-27T19:23:52.997740845Z\""}}}}
and i notice this in dskit server config
Log gokit_log.Logger `yaml:"-"`
Is it possible to configure the logger in yaml to remove ts or rename ts to timestamp to match our logging system schema?
You can set Log field in the code before creating Server, then configuration options for setting up logger will be ignored, and supplied logger will be used instead.
You can set Log field in the code before creating Server
We are directly using Tempo image, can you help provide some example to set the Log field?
Tempo log level can be configured with the following.
server:
log_level: debug
It doesn't look like we currently expose log_format on the server as a config option.
log_format is configurable to json, and this is the configurable list: https://github.com/grafana/dskit/blob/main/server/server.go#L135-L144
However, they are not helpful to tune the logger field ts or rename ts to timestamp to match our logging system schema
I am thinking adding some config like log_fields which will accept a list of key value pairs to override what is already configured in the logger