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

feat: add successful, pending and failed metrics to HeadRuntime #5374

Merged
merged 16 commits into from
Nov 11, 2022

Conversation

JoanFM
Copy link
Member

@JoanFM JoanFM commented Nov 10, 2022

Goals:
Some metrics should be in the Head as they are in the Gateway

@JoanFM JoanFM changed the title refactor: create HeaderRequestHandler feat: cover missing Metrics in HeadRuntimer Nov 10, 2022
@github-actions github-actions bot added size/L area/core This issue/PR affects the core codebase labels Nov 10, 2022
@github-actions github-actions bot added the area/testing This issue/PR affects testing label Nov 10, 2022
@codecov
Copy link

codecov bot commented Nov 10, 2022

Codecov Report

Merging #5374 (f037508) into master (de53f95) will decrease coverage by 1.17%.
The diff coverage is 98.44%.

@@            Coverage Diff             @@
##           master    #5374      +/-   ##
==========================================
- Coverage   86.83%   85.66%   -1.18%     
==========================================
  Files         100      101       +1     
  Lines        6512     6598      +86     
==========================================
- Hits         5655     5652       -3     
- Misses        857      946      +89     
Flag Coverage Δ
jina 85.66% <98.44%> (-1.18%) ⬇️

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

Impacted Files Coverage Δ
jina/parsers/deprecated.py 83.33% <ø> (ø)
jina/parsers/orchestrate/pod.py 100.00% <ø> (ø)
jina/parsers/orchestrate/runtimes/head.py 100.00% <ø> (ø)
jina/parsers/orchestrate/runtimes/remote.py 100.00% <ø> (ø)
jina/parsers/orchestrate/runtimes/runtime.py 100.00% <ø> (ø)
jina/serve/streamer.py 95.91% <ø> (ø)
jina/serve/runtimes/head/request_handling.py 95.52% <95.52%> (ø)
jina/orchestrate/flow/base.py 84.12% <100.00%> (-6.65%) ⬇️
jina/parsers/orchestrate/runtimes/worker.py 100.00% <100.00%> (ø)
jina/serve/gateway.py 94.11% <100.00%> (ø)
... and 16 more

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

@JoanFM JoanFM changed the title feat: cover missing Metrics in HeadRuntimer feat: cover missing Metrics in HeadRuntime Nov 10, 2022
@JoanFM JoanFM force-pushed the head-runtime-metrics branch from 6e19557 to d910673 Compare November 10, 2022 17:48
@github-actions github-actions bot added the area/docs This issue/PR affects the docs label Nov 10, 2022
@JoanFM JoanFM force-pushed the head-runtime-metrics branch from 2537471 to 82c048d Compare November 10, 2022 18:21
@JoanFM JoanFM changed the title feat: cover missing Metrics in HeadRuntime fix: cover missing Metrics in HeadRuntime Nov 10, 2022
@JoanFM JoanFM changed the title fix: cover missing Metrics in HeadRuntime fix: cover missing metrics in HeadRuntime Nov 10, 2022
@JoanFM JoanFM marked this pull request as ready for review November 11, 2022 09:35
@JoanFM JoanFM force-pushed the head-runtime-metrics branch from 394a361 to a05b6a6 Compare November 11, 2022 09:42
@JoanFM JoanFM requested review from girishc13 and removed request for girishc13 November 11, 2022 10:00
)

if self._receiving_request_metrics:
self._request_init_time[request.request_id] = time.time()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to this PR but I want to mention it. This map is not always safely cleared after every request ends. Especially in the head _gather_worker_tasks is not catching all exceptions. Right now it's focused on the AioRpcError and InternalNetworkError for retrying. In case if something else happens then the the _update_end_successful_requests_metrics method will not correctly remove entries from the dict.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's open a ticket for this, I am not sure there can be other errors,it should be handled in another PR

if result.status.code != jina_pb2.StatusProto.ERROR:
self._update_end_successful_requests_metrics(result)
else:
self._update_end_failed_requests_metrics()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also pop the Request entry in this method?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am just moving this method around

Copy link
Contributor

@JohannesMessner JohannesMessner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I like the new file structure / refactoring aspect

@github-actions
Copy link

📝 Docs are deployed on https://head-runtime-metrics--jina-docs.netlify.app 🎉

@JoanFM JoanFM merged commit 3371919 into master Nov 11, 2022
@JoanFM JoanFM deleted the head-runtime-metrics branch November 11, 2022 11:11
@alaeddine-13 alaeddine-13 changed the title fix: cover missing metrics in HeadRuntime feat: add successful, pending and failed metrics to HeadRuntime Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core This issue/PR affects the core codebase area/docs This issue/PR affects the docs area/testing This issue/PR affects testing size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Catch up with the missing metrics in the Head
3 participants