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 finch instance name to telemetry metadata #252

Merged

Conversation

arthurnovak
Copy link
Contributor

Recently, my team have adopted the practice of employing distinct finch instances for handling our requests. In this commit, we aim to include the pool-id/finch-instance-name in the telemetry metadata during request processing. This addition is particularly valuable for collecting statistics on a per-finch-instance basis.

This change aligns with both @aselder 's request and @oliveigah 's PR, but it's a bit more concise. Hope this makes the review and merging process quicker.

@sneako
Copy link
Owner

sneako commented Nov 14, 2023

Thanks for taking a look at this!

A few comments:

  • Why only add it only to the :queue events and nothing else?
  • Why only http1?
  • Metadata is documented in the Telemetry module and should be updated accordingly.

@arthurnovak arthurnovak force-pushed the add_finch_instance_to_req_telemetry_meta branch from da9a831 to 6fcfc78 Compare November 14, 2023 22:37
@arthurnovak
Copy link
Contributor Author

Hey @sneako thank you very much for the review. I've updated :queue docs in telemetry module.

Regarding the other comments, I completely agree that it'd be great to report finch instance name everywhere. However, I'd prefer to make the rest of the updates in separate PRs so that the changes won't appear complex and can be quickly reviewed. Let me know if having only the queue update in this PR would work

lib/finch.ex Show resolved Hide resolved
lib/finch.ex Show resolved Hide resolved
@isavita
Copy link

isavita commented Nov 15, 2023

If we move the pool_name to opts we will not change the arity etc.

@arthurnovak
Copy link
Contributor Author

hey @sneako can you give us any feedback please

Finch.Request.t(),
acc,
Finch.stream(acc),
atom(),
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
atom(),
Finch.name(),

@callback async_request(
pid(),
Finch.Request.t(),
atom(),
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
atom(),
Finch.name(),

@sneako
Copy link
Owner

sneako commented Nov 20, 2023

Thanks! I'd be ok with separate PRs for h1 & h2, but I'd rather not have separate PRs for each individual telemetry event.

The current implementation seems fine to me, I'm not too concerned about changing the arity of these internal/private behaviours and I don't feel it belongs in opts anyway.

@arthurnovak arthurnovak force-pushed the add_finch_instance_to_req_telemetry_meta branch 3 times, most recently from 13887a7 to 094cc48 Compare November 22, 2023 13:26
@arthurnovak
Copy link
Contributor Author

hey @sneako thank you for your reply. I've updated the pr by adding finch name to the metadata for :connect, :recv and :send events in http1 and ignored http2 one for now. Please have a look when you have a min. Cheers!

@arthurnovak
Copy link
Contributor Author

hi @sneako have you had a chance to have a look at the change?

@arthurnovak arthurnovak force-pushed the add_finch_instance_to_req_telemetry_meta branch from 094cc48 to d7de556 Compare December 5, 2023 21:01
@arthurnovak arthurnovak changed the title Add finch instance name to telemetry meta in request Add finch instance name to telemetry meta in HTTP/1 request Dec 5, 2023
@arthurnovak arthurnovak force-pushed the add_finch_instance_to_req_telemetry_meta branch from d7de556 to 77fd65e Compare January 8, 2024 09:32
@arthurnovak
Copy link
Contributor Author

hey @sneako, I had a bit of time around New Year's, so I went ahead and added the finch name to the telemetry meta for the H2 interface, as we discussed earlier. Could you please take a look? Oh, and by the way, happy new year!

@sneako sneako changed the title Add finch instance name to telemetry meta in HTTP/1 request Add finch instance name to telemetry metadata Jan 8, 2024
@sneako
Copy link
Owner

sneako commented Jan 8, 2024

hey @sneako, I had a bit of time around New Year's, so I went ahead and added the finch name to the telemetry meta for the H2 interface, as we discussed earlier. Could you please take a look? Oh, and by the way, happy new year!

Happy new year to you as well! Thank you for picking this up and completing the implementation. This looks good to me. Please run mix format and I will merge :)

@arthurnovak
Copy link
Contributor Author

hey @sneako, I had a bit of time around New Year's, so I went ahead and added the finch name to the telemetry meta for the H2 interface, as we discussed earlier. Could you please take a look? Oh, and by the way, happy new year!

Happy new year to you as well! Thank you for picking this up and completing the implementation. This looks good to me. Please run mix format and I will merge :)

done!

@sneako sneako merged commit 1a46841 into sneako:main Jan 9, 2024
2 checks passed
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.

4 participants