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

Fix es.log-level behaviour #3664

Merged
merged 3 commits into from
May 7, 2022

Conversation

albertteoh
Copy link
Contributor

Signed-off-by: albertteoh see.kwang.teoh@gmail.com

Which problem is this PR solving?

Short description of the changes

  • Fixes the es.log-level config setting, which was hard coded to zap's Debug logging level for all es.log-levels.
  • This resulted in some debug logging appearing when es.log-level is set to error.
  • The fix results in no logs appearing if both log-level and es.log-level are set to error, which seems to be more desirable behaviour. Other es.log-level behaviour remain unchanged.

Testing

  • Start collector with log-level=error and (send a single trace) with...
    • es.log-level=error
      Before
      Was zap.DebugLevel logging elastic error logs.

      {"level":"info","ts":1651915151.4875429,"caller":"zapgrpc/zapgrpc.go:129","msg":"Deprecation warning: 299 Elasticsearch-7.16.1-5b38441b16b1ebb16a27c107a4c3865776e20c53 \"legacy template [jaeger-span] has index patterns [*jaeger-span-*] matching patterns from existing composable templates..."}
      {"level":"info","ts":1651915151.4876504,"caller":"zapgrpc/zapgrpc.go:129","msg":"Deprecation warning: 299 Elasticsearch-7.16.1-5b38441b16b1ebb16a27c107a4c3865776e20c53 \"Elasticsearch built-in security features are not enabled. Without authentication, your cluster could be accessible to anyone. ..."}
      {"level":"info","ts":1651915151.4948773,"caller":"zapgrpc/zapgrpc.go:129","msg":"Deprecation warning: 299 Elasticsearch-7.16.1-5b38441b16b1ebb16a27c107a4c3865776e20c53 \"legacy template [jaeger-service] has index patterns [*jaeger-service-*] matching patterns from existing composable templates..."}
      {"level":"info","ts":1651915151.4950364,"caller":"zapgrpc/zapgrpc.go:129","msg":"Deprecation warning: 299 Elasticsearch-7.16.1-5b38441b16b1ebb16a27c107a4c3865776e20c53 \"Elasticsearch built-in security features are not enabled. Without authentication, your cluster could be accessible to anyone. See https://www.elastic.co/guide/en/elasticsearch/reference/7.16/security-minimal-setup.html to enable security.\""}
      {"level":"info","ts":1651915151.4951203,"caller":"zapgrpc/zapgrpc.go:129","msg":"Deprecation warning: 299 Elasticsearch-7.16.1-5b38441b16b1ebb16a27c107a4c3865776e20c53 \"Legacy index templates are deprecated in favor of composable templates.\""}
      {"level":"info","ts":1651922721.561439,"caller":"zapgrpc/zapgrpc.go:129","msg":"Deprecation warning: 299 Elasticsearch-7.16.1-5b38441b16b1ebb16a27c107a4c3865776e20c53 \"Elasticsearch built-in security features are not enabled. Without authentication, your cluster could be accessible to anyone. See https://www.elastic.co/guide/en/elasticsearch/reference/7.16/security-minimal-setup.html to enable security.\""}
      (nothing more...)
      

      After
      Now zap.ErrorLevel logging elastic error logs.

      (nothing more...)
      
    • es.log-level=info
      Before
      Was zap.DebugLevel logging elastic info logs.

      {"level":"info","ts":1651915290.5823646,"caller":"zapgrpc/zapgrpc.go:129","msg":"PUT http://127.0.0.1:9200/_template/jaeger-span [status:200, request:0.006s]"}
      {"level":"info","ts":1651915290.5882316,"caller":"zapgrpc/zapgrpc.go:129","msg":"PUT http://127.0.0.1:9200/_template/jaeger-service [status:200, request:0.005s]"}
      {"level":"info","ts":1651915299.580772,"caller":"zapgrpc/zapgrpc.go:129","msg":"POST http://127.0.0.1:9200/_bulk [status:200, request:0.006s]"}
      (nothing more...)
      

      After
      Was zap.InfoLevel logging elastic info logs.

      {"level":"info","ts":1651921340.2083728,"caller":"zapgrpc/zapgrpc.go:129","msg":"PUT http://127.0.0.1:9200/_template/jaeger-span [status:200, request:0.007s]"}
      {"level":"info","ts":1651921340.21438,"caller":"zapgrpc/zapgrpc.go:129","msg":"PUT http://127.0.0.1:9200/_template/jaeger-service [status:200, request:0.005s]"}
      {"level":"info","ts":1651921358.605698,"caller":"zapgrpc/zapgrpc.go:129","msg":"POST http://127.0.0.1:9200/_bulk [status:200, request:0.006s]"}
      (nothing more...)
      
    • es.log-level=debug
      Before
      Was zap.DebugLevel logging elastic debug logs.

      {"level":"debug","ts":1651915393.57845,"caller":"zapgrpc/zapgrpc.go:129","msg":"PUT /_template/jaeger-span ..."}
      {"level":"debug","ts":1651915393.585142,"caller":"zapgrpc/zapgrpc.go:129","msg":"HTTP/1.1 200 OK\r\nContent-Type: application/json; charset=UTF-8\r\nWarning: 299 Elasticsearch-7.16.1-5b38441b16b1ebb16a27c107a4c3865776e20c53 \"legacy template [jaeger-span] has index patterns [*jaeger-span-*] matching patterns from existing composable templates ..."}
      {"level":"debug","ts":1651915393.5866783,"caller":"zapgrpc/zapgrpc.go:129","msg":"PUT /_template/jaeger-service ..."}
      {"level":"debug","ts":1651915393.5929275,"caller":"zapgrpc/zapgrpc.go:129","msg":"HTTP/1.1 200 OK\r\nContent-Type: application/json; charset=UTF-8\r\nWarning: 299 Elasticsearch-7.16.1-5b38441b16b1ebb16a27c107a4c3865776e20c53 \"legacy template [jaeger-service] has index patterns [*jaeger-service-*] matching patterns from existing composable templates ..."}
      {"level":"debug","ts":1651915404.5853775,"caller":"zapgrpc/zapgrpc.go:129","msg":"POST /_bulk H..."}
      {"level":"debug","ts":1651915404.5916934,"caller":"zapgrpc/zapgrpc.go:129","msg":"HTTP/1.1 200 OK\r\nContent-Type: application/json; charset=UTF-8\r\nWarning: 299 Elasticsearch-7.16.1-5b38441b16b1ebb16a27c107a4c3865776e20c53 \"Elasticsearch built-in security features are not enabled. Without authentication, your cluster could be accessible to anyone. ..."}
      (nothing more...)
      

      After
      Now still zap.DebugLevel logging elastic debug logs.

      {"level":"debug","ts":1651921458.1075134,"caller":"zapgrpc/zapgrpc.go:129","msg":"PUT /_template/jaeger-span..."}
      {"level":"debug","ts":1651921458.1143427,"caller":"zapgrpc/zapgrpc.go:129","msg":"HTTP/1.1 200 OK\r\nContent-Type: application/json; charset=UTF-8\r\nWarning: 299 Elasticsearch-7.16.1-5b38441b16b1ebb16a27c107a4c3865776e20c53 \"legacy template [jaeger-span] has index patterns [*jaeger-span-*] matching patterns from existing composable templates ..."}
      {"level":"debug","ts":1651921458.1146176,"caller":"zapgrpc/zapgrpc.go:129","msg":"PUT /_template/jaeger-service..."}
      {"level":"debug","ts":1651921458.120642,"caller":"zapgrpc/zapgrpc.go:129","msg":"HTTP/1.1 200 OK\r\nContent-Type: application/json; charset=UTF-8\r\nWarning: 299 Elasticsearch-7.16.1-5b38441b16b1ebb16a27c107a4c3865776e20c53 \"legacy template [jaeger-service] has index patterns [*jaeger-service-*] matching patterns from existing composable templates..."}
      {"level":"debug","ts":1651921463.7124484,"caller":"zapgrpc/zapgrpc.go:129","msg":"POST /_bulk..."}
      {"level":"debug","ts":1651921463.7170844,"caller":"zapgrpc/zapgrpc.go:129","msg":"HTTP/1.1 200 OK\r\nContent-Type: application/json; charset=UTF-8\r\nWarning: 299 Elasticsearch-7.16.1-5b38441b16b1ebb16a27c107a4c3865776e20c53 \"Elasticsearch built-in security features are not enabled. Without authentication, your cluster could be accessible to anyone. ..."}
      (nothing more...)
      

Signed-off-by: albertteoh <see.kwang.teoh@gmail.com>
Signed-off-by: albertteoh <see.kwang.teoh@gmail.com>
@albertteoh albertteoh requested a review from a team as a code owner May 7, 2022 11:30
@codecov
Copy link

codecov bot commented May 7, 2022

Codecov Report

Merging #3664 (33cc2cf) into main (754880c) will decrease coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #3664      +/-   ##
==========================================
- Coverage   96.50%   96.48%   -0.02%     
==========================================
  Files         265      265              
  Lines       15581    15581              
==========================================
- Hits        15036    15034       -2     
- Misses        455      457       +2     
  Partials       90       90              
Impacted Files Coverage Δ
pkg/config/tlscfg/cert_watcher.go 92.63% <0.00%> (-2.11%) ⬇️
cmd/query/app/static_handler.go 95.80% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 754880c...33cc2cf. Read the comment docs.

@yurishkuro yurishkuro merged commit 87d9ca4 into jaegertracing:main May 7, 2022
albertteoh added a commit to albertteoh/jaeger that referenced this pull request Jul 13, 2022
Signed-off-by: Albert Teoh <see.kwang.teoh@gmail.com>
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

Successfully merging this pull request may close these issues.

2 participants