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

Logger customization to avoid parse error #3871

Closed
icemanDD opened this issue Jul 16, 2024 · 5 comments
Closed

Logger customization to avoid parse error #3871

icemanDD opened this issue Jul 16, 2024 · 5 comments
Labels
stale Used for stale issues / PRs

Comments

@icemanDD
Copy link

Is your feature request related to a problem? Please describe.

grafana/dskit#536

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?

Describe the solution you'd like
We can customize server logger to add/edit/remove default logged fields

Describe alternatives you've considered
N/A

Additional context
N/A

@joe-elliott
Copy link
Member

The issue is this line here? You would like to change the field name?

https://github.com/grafana/tempo/blob/main/pkg/util/log/log.go#L28

It seems we call that init method in main. If you would like to suggest some config options we'd likely take a PR to make some of this configurable.

@icemanDD
Copy link
Author

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

@joe-elliott
Copy link
Member

we would definitely take a PR to configure these fields if it helps you

@icemanDD
Copy link
Author

thank you, this will help a lot!

Copy link
Contributor

This issue has been automatically marked as stale because it has not had any activity in the past 60 days.
The next time this stale check runs, the stale label will be removed if there is new activity. The issue will be closed after 15 days if there is no new activity.
Please apply keepalive label to exempt this Issue.

@github-actions github-actions bot added the stale Used for stale issues / PRs label Sep 30, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Used for stale issues / PRs
Projects
None yet
Development

No branches or pull requests

2 participants