jina icon indicating copy to clipboard operation
jina copied to clipboard

feat(instrumentation): create basic tracer and meter with console exporter

Open girishc13 opened this issue 2 years ago • 2 comments

Goals:

  • resolves #5155
  • [x] Integrate OpenTelemetry API and SDK.
  • [ ] Provide environment variable configurations to enable tracking when required. Use console exporter for now.
  • [x] Trace gRPC requests within the Flow.
  • [ ] Add helpers for creating traces on request methods with default span attributes.
  • [ ] Convert send_health_check_sync or is_ready method to async to prevent the grpc aio interceptor from throwing and capturing an exception.
  • [x] Extract tracing context from the server and make it available for the Executor methods in the kwargs list or arguments.
  • [ ] check and update documentation. See guide and ask the team.

girishc13 avatar Sep 15 '22 15:09 girishc13

Codecov Report

Merging #5175 (bb0b003) into master (bcf17c3) will increase coverage by 23.24%. The diff coverage is 52.91%.

@@             Coverage Diff             @@
##           master    #5175       +/-   ##
===========================================
+ Coverage   51.99%   75.23%   +23.24%     
===========================================
  Files          95      100        +5     
  Lines        6145     6433      +288     
===========================================
+ Hits         3195     4840     +1645     
+ Misses       2950     1593     -1357     
Flag Coverage Δ
jina 75.23% <52.91%> (+23.24%) :arrow_up:

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

Impacted Files Coverage Δ
jina/clients/base/http.py 91.89% <ø> (+2.70%) :arrow_up:
jina/clients/base/websocket.py 83.80% <ø> (+7.61%) :arrow_up:
jina/orchestrate/flow/base.py 90.15% <ø> (+29.81%) :arrow_up:
jina/serve/instrumentation/_aio_server.py 0.00% <0.00%> (ø)
jina/serve/runtimes/gateway/http/gateway.py 87.30% <ø> (+63.49%) :arrow_up:
jina/serve/runtimes/gateway/websocket/gateway.py 85.71% <ø> (+58.92%) :arrow_up:
jina/serve/runtimes/gateway/http/app.py 38.19% <25.00%> (+29.62%) :arrow_up:
jina/serve/runtimes/gateway/websocket/app.py 29.03% <25.00%> (+20.42%) :arrow_up:
jina/clients/base/grpc.py 82.85% <33.33%> (+5.71%) :arrow_up:
jina/serve/runtimes/asyncio.py 69.02% <44.44%> (+20.06%) :arrow_up:
... and 76 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Sep 16 '22 14:09 codecov[bot]

The python OpenTelemetry sdk currently doesn't have support for the grpc.aio.Server. There is an open pull request which will make the implementation easy for us.

girishc13 avatar Sep 19 '22 08:09 girishc13

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Sep 27 '22 13:09 github-actions[bot]

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Sep 27 '22 14:09 github-actions[bot]

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Sep 27 '22 15:09 github-actions[bot]

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Sep 28 '22 07:09 github-actions[bot]

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Sep 28 '22 07:09 github-actions[bot]

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Sep 28 '22 08:09 github-actions[bot]

All these usage of 'args' to create or initialise global parameters is not suitable. I will work on removing the instrumentation mixin and move the initialisation to module level. This will work fine when deployed to k8s but there might be some slight unknowns or side effects when running the flow locally.

girishc13 avatar Sep 28 '22 09:09 girishc13

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Sep 30 '22 13:09 github-actions[bot]

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Sep 30 '22 13:09 github-actions[bot]

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Oct 04 '22 08:10 github-actions[bot]

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Oct 04 '22 15:10 github-actions[bot]

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Oct 05 '22 08:10 github-actions[bot]

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Oct 05 '22 08:10 github-actions[bot]

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Oct 05 '22 09:10 github-actions[bot]

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Oct 05 '22 11:10 github-actions[bot]

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Oct 05 '22 11:10 github-actions[bot]

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Oct 05 '22 14:10 github-actions[bot]

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Oct 05 '22 14:10 github-actions[bot]

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Oct 06 '22 07:10 github-actions[bot]

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Oct 06 '22 07:10 github-actions[bot]

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Oct 06 '22 08:10 github-actions[bot]

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Oct 06 '22 09:10 github-actions[bot]

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Oct 06 '22 12:10 github-actions[bot]

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Oct 06 '22 12:10 github-actions[bot]

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Oct 06 '22 14:10 github-actions[bot]

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Oct 06 '22 15:10 github-actions[bot]

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Oct 06 '22 21:10 github-actions[bot]

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Oct 07 '22 07:10 github-actions[bot]