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

Add better logging options #5675

Merged
merged 2 commits into from
Jun 23, 2024
Merged

Conversation

yurishkuro
Copy link
Member

Which problem is this PR solving?

Description of the changes

  • Add --log-encoding option to allow changing logs to plain text (console).
  • Fix logger initialization for ES to reuse the existing logger instead of creating a new one (new one was switching back to JSON)

How was this change tested?

$ SPAN_STORAGE_TYPE=elasticsearch go run -tags=ui ./cmd/all-in-one --es.log-level=debug --log-encoding=console

A query is logged like this:

2024-06-22T22:56:34.272-0400	info	elastic@v6.2.37+incompatible/client.go:835	GET /_msearch?rest_total_hits_as_int=true HTTP/1.1
Host: 127.0.0.1:9200
User-Agent: elastic/6.2.37 (darwin-arm64)
Content-Length: 310
Accept: application/json
Content-Type: application/json
Accept-Encoding: gzip

{"ignore_unavailable":true,"indices":["jaeger-span-2024-06-23","jaeger-span-2024-06-22","jaeger-span-2024-06-21","jaeger-span-2024-06-20"]}
{"query":{"bool":{"must":{"term":{"traceID":"1a2cee16e928c8a2f00d9ae784d8cccc"}}}},"search_after":[1718848594271777],"size":10000,"sort":[{"startTime":{"order":"asc"}}]}

Checklist

Signed-off-by: Yuri Shkuro <github@ysh.us>
Signed-off-by: Yuri Shkuro <github@ysh.us>
Copy link

codecov bot commented Jun 23, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.

Project coverage is 96.38%. Comparing base (ca8cdae) to head (730917f).

Files Patch % Lines
cmd/internal/flags/flags.go 71.42% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5675      +/-   ##
==========================================
- Coverage   96.39%   96.38%   -0.02%     
==========================================
  Files         329      329              
  Lines       16056    16060       +4     
==========================================
+ Hits        15477    15479       +2     
- Misses        403      404       +1     
- Partials      176      177       +1     
Flag Coverage Δ
badger_v1 8.04% <0.00%> (+<0.01%) ⬆️
badger_v2 1.92% <0.00%> (+<0.01%) ⬆️
cassandra-3.x-v1 16.60% <0.00%> (+<0.01%) ⬆️
cassandra-3.x-v2 1.84% <0.00%> (+<0.01%) ⬆️
cassandra-4.x-v1 16.60% <0.00%> (+<0.01%) ⬆️
cassandra-4.x-v2 1.84% <0.00%> (+<0.01%) ⬆️
elasticsearch-7.x-v1 18.87% <100.00%> (+<0.01%) ⬆️
elasticsearch-8.x-v1 19.08% <100.00%> (+0.01%) ⬆️
elasticsearch-8.x-v2 19.08% <100.00%> (+0.01%) ⬆️
grpc_v1 9.46% <0.00%> (-0.02%) ⬇️
grpc_v2 7.47% <0.00%> (+<0.01%) ⬆️
kafka 9.76% <0.00%> (+<0.01%) ⬆️
opensearch-1.x-v1 18.92% <100.00%> (+0.01%) ⬆️
opensearch-2.x-v1 18.92% <100.00%> (+0.01%) ⬆️
opensearch-2.x-v2 18.92% <100.00%> (+0.01%) ⬆️
unittests 94.23% <85.71%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yurishkuro yurishkuro merged commit 1c1bc08 into jaegertracing:main Jun 23, 2024
41 of 42 checks passed
@yurishkuro yurishkuro deleted the better-logging branch June 23, 2024 05:15
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants