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

How to configure Logger in yaml #536

Open
icemanDD opened this issue Jun 27, 2024 · 5 comments
Open

How to configure Logger in yaml #536

icemanDD opened this issue Jun 27, 2024 · 5 comments

Comments

@icemanDD
Copy link

icemanDD commented Jun 27, 2024

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?

@pstibrany
Copy link
Member

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.

@icemanDD
Copy link
Author

icemanDD commented Jul 1, 2024

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?

@zalegrala
Copy link
Contributor

zalegrala commented Jul 1, 2024

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.

@icemanDD
Copy link
Author

icemanDD commented Jul 1, 2024

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

@icemanDD
Copy link
Author

icemanDD commented Jul 1, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants