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(encoding): new encode_registry and encode_end functions to compose cross-registry responses #154

Closed
wants to merge 5 commits into from

Conversation

amunra
Copy link
Contributor

@amunra amunra commented Jul 13, 2023

New encode_registry and encode_end functions allow encoding only parts of the response.

This is useful when there are multiple registries at play, or when composing metrics for a process that embeds Rust as part of its logic whilst serving metrics to Prometheus outside of Rust.

Closes #153


I wish to waive any ownership rights for the changes included in this PR and I'm happy for you to license these changes in any way you see fit, including the MIT and Apache licenses. Once accepted these changes are of your ownership.

Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

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

I am sorry for the delay here. Overall this looks good to me. Thank you for adding the test.

src/encoding/text.rs Outdated Show resolved Hide resolved
src/encoding/text.rs Outdated Show resolved Hide resolved
src/encoding/text.rs Outdated Show resolved Hide resolved
src/encoding/text.rs Show resolved Hide resolved
src/encoding/text.rs Outdated Show resolved Hide resolved
src/encoding/text.rs Outdated Show resolved Hide resolved
@hdost
Copy link

hdost commented Oct 26, 2023

@mxinden are the comments requested changes for @amunra ?

@amunra
Copy link
Contributor Author

amunra commented Oct 26, 2023

Yes, sorry. I still need to get around to finishing this. I am actively workings on metrics that will require this PR. Sorry for the delay!

…ompose cross-registry responses

Signed-off-by: Adam Cimarosti <[email protected]>
@amunra
Copy link
Contributor Author

amunra commented Nov 8, 2023

Changes are now ready for re-reviewing. Thanks for your feedback!

@amunra amunra changed the title feat(encoding): new parts::* functions to compose cross-registry responses feat(encoding): new encode_registry and encode_end functions to compose cross-registry responses Nov 8, 2023
@amunra
Copy link
Contributor Author

amunra commented Nov 15, 2023

@mxinden Hi Max, I hope you don't mind pinging you :-).
I'm hoping to see this merged: Let me know if there's anything else that would need changing.

Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

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

Sorry for the delay here. Two nit picks. Otherwise, just needs a patch version bump and a changelog entry.

If it is helpful, I can cut a new release once merged.

src/encoding/text.rs Outdated Show resolved Hide resolved
src/encoding/text.rs Outdated Show resolved Hide resolved
@amunra
Copy link
Contributor Author

amunra commented Dec 4, 2023

@mxinden Sorry for the delay, I was away on holiday. Updated as per your suggestions.

Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

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

Thanks

@mxinden
Copy link
Member

mxinden commented Dec 4, 2023

Note that you are missing the DCO sign-off. Would you mind either signing off each of your commits, or squashing into a single signed-off commit? Either way, this pull request will be squashed into master.

@amunra
Copy link
Contributor Author

amunra commented Dec 4, 2023

Note that you are missing the DCO sign-off. Would you mind either signing off each of your commits, or squashing into a single signed-off commit? Either way, this pull request will be squashed into master.

I have no idea what that means.
Would you have a list of commands for me to run or a web page to refer me to?

@mxinden
Copy link
Member

mxinden commented Jan 26, 2024

@amunra sorry for the incomplete message and the delay.

You have a set of instructions when you click Details on the last (failing) CI action called "DCO". Or you can click the link below.

https://github.com/prometheus/client_rust/pull/154/checks?check_run_id=19282972846

I am sorry for the inconvenience this is causing. I know it is annoying.

@tyrone-wu
Copy link
Contributor

tyrone-wu commented Jun 25, 2024

@amunra Hello! 🐱

Thanks for this feature! I was wondering if there's any update to this, as I have a usecase (described here #204) that could use this.

@amunra
Copy link
Contributor Author

amunra commented Jun 25, 2024

Hello,

I'll be honest here: I'm pretty bogged down with quite a number of other items of work and I'll doubt I'll realistically get around to ever understanding/completing the DCO bureaucracy around this PR to be able to get it into a mergeable state.

If anyone else has the energy to create a new PR I get the feeling that the @mxinden will likely accept the change (or at least I hope) since it's effectively code + test + review -complete.

I'm sorry I'm leaving this 98% done, but I don't have the mental energy necessary here.

I waive any rights / attribution etc over the code changes here (as I also mentioned in the PR description).

Any help to get this over the finish line would be most welcome and I thank in advance.

tyrone-wu added a commit to tyrone-wu/client_rust that referenced this pull request Jun 27, 2024
All credits on the initial idea, implementation, and testing belong to
@amunra, who is the original author of this PR prometheus#154.

From the original PR description:

Adds new `encode_registry` and `encode_eof` functions to allow encoding
of parts of the response.

This is useful when there are multiple registries at play, or when
composing metrics for a process that embeds Rust as part of its logic
whilst serving metrics to Prometheus outside of Rust.

Fixes: prometheus#153
Refs: prometheus#154, prometheus#204

Co-authored-by: Adam Cimarosti <[email protected]>
Signed-off-by: Tyrone Wu <[email protected]>
tyrone-wu added a commit to tyrone-wu/client_rust that referenced this pull request Jun 27, 2024
All credits on the initial idea, implementation, and testing belong to
@amunra, who is the original author of this PR prometheus#154.

From the original PR description:

Adds new `encode_registry` and `encode_eof` functions to allow encoding
of parts of the response.

This is useful when there are multiple registries at play, or when
composing metrics for a process that embeds Rust as part of its logic
whilst serving metrics to Prometheus outside of Rust.

Fixes: prometheus#153
Refs: prometheus#154, prometheus#204

Co-authored-by: amunra <[email protected]>
Signed-off-by: tyrone-wu <[email protected]>
tyrone-wu added a commit to tyrone-wu/client_rust that referenced this pull request Jun 27, 2024
All credits on the initial idea, implementation, and testing belong to
@amunra, who is the original author of this PR prometheus#154.

From the original PR description:

Adds new `encode_registry` and `encode_eof` functions to allow encoding
of parts of the response.

This is useful when there are multiple registries at play, or when
composing metrics for a process that embeds Rust as part of its logic
whilst serving metrics to Prometheus outside of Rust.

Fixes: prometheus#153
Refs: prometheus#154, prometheus#204

Co-authored-by: amunra <[email protected]>
Signed-off-by: tyrone-wu <[email protected]>
tyrone-wu added a commit to tyrone-wu/client_rust that referenced this pull request Jul 3, 2024
All credits on the initial idea, implementation, and testing belong to
@amunra, who is the original author of this PR prometheus#154.

From the original PR description:

Adds new `encode_registry` and `encode_eof` functions to allow encoding
of parts of the response.

This is useful when there are multiple registries at play, or when
composing metrics for a process that embeds Rust as part of its logic
whilst serving metrics to Prometheus outside of Rust.

Fixes: prometheus#153
Refs: prometheus#154, prometheus#204

Co-authored-by: amunra <[email protected]>
Signed-off-by: tyrone-wu <[email protected]>
mxinden pushed a commit that referenced this pull request Jul 7, 2024
#205)

All credits on the initial idea, implementation, and testing belong to
@amunra, who is the original author of this PR #154.

From the original PR description:

Adds new `encode_registry` and `encode_eof` functions to allow encoding
of parts of the response.

This is useful when there are multiple registries at play, or when
composing metrics for a process that embeds Rust as part of its logic
whilst serving metrics to Prometheus outside of Rust.

Fixes: #153
Refs: #154, #204

Co-authored-by: amunra <[email protected]>
Signed-off-by: tyrone-wu <[email protected]>
Signed-off-by: Max Inden <[email protected]>
@mxinden
Copy link
Member

mxinden commented Oct 20, 2024

Closing here with #205 merged.

@mxinden mxinden closed this Oct 20, 2024
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.

Encoder without EOF
4 participants