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

Integrating Rust binaries in tracer extensions #32502

Closed
hoolioh opened this issue Feb 21, 2024 · 5 comments
Closed

Integrating Rust binaries in tracer extensions #32502

hoolioh opened this issue Feb 21, 2024 · 5 comments
Labels
area/extension stale stalebot believes this issue/PR has not been touched recently

Comments

@hoolioh
Copy link

hoolioh commented Feb 21, 2024

Title: Integrating Rust binaries in tracer extensions

Description:
Hi envoy team, as you might know Datadog is currently integrating a tracer into envoy. As a result of a company initiative to harmonize implementations that are common to the different tracers implemented inside the company we'd have the need to use this common modules into the dd-trace-cpp project. The language of choice for those common modules is Rust which means we'd need to either compile Rust code inside envoy project or importing a precompiled binary during the compilation of the extension. I've tried to look for another extensions using any of the aforementioned mechanisms to integrate Rust code but, unfortunately, I had no luck. So Is there a way to integrate Rust code/libraries in a tracer?
Aside from that I've found this PR, with that we could build a dynamic library which will include the cpp tracer and the rust parts to be loaded upon envoy initialization right?

Relevant Links:
https://github.com/envoyproxy/envoy/tree/main/source/extensions/tracers/datadog
#2252

@hoolioh hoolioh added the triage Issue requires triage label Feb 21, 2024
@lizan lizan added area/extension and removed triage Issue requires triage labels Feb 22, 2024
@lizan
Copy link
Member

lizan commented Feb 22, 2024

We currently don't have a mechanism for dynamic load and Rust support, but I'd be excited to see Rust code build inside Envoy and linking to binary. There was a discussion regards to dynamic loadable modules in #2053 as well.

@hoolioh
Copy link
Author

hoolioh commented Feb 28, 2024

@lizan when you say you'd be excited to see Rust code build an linking to a binary you mean that the rust module should be embedded in the envoy project, built from source and linked as part of the envoy compilation (just as the tracer) right?
Would it be acceptable, as a first approach, to import a static library during the datadog tracer compilation and link to it?

@hoolioh
Copy link
Author

hoolioh commented Mar 27, 2024

Following on the topic @lizan and leaving the dynamic loadable modules aside. We've been evaluating what options we have to put this in motion for the short term. The one we are considering is using an external dependency (tgz file) which will contain the static library compiled for all architectures supported. The proper architecture will be selected based on the ARCH of the bazel project. This static library will contain the rust code and FFI methods to be called from Datadog tracer so all will be statically linked with no external dependencies. How does that sound?

Copy link

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label Apr 26, 2024
Copy link

github-actions bot commented May 3, 2024

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 3, 2024
mattklein123 pushed a commit that referenced this issue Aug 6, 2024
Commit Message: dynamic_modules: adds initial object loading logic
Additional Description:
This is the very first commit of the dynamic loading feature discussed
among community
members. This is the effort to upstream the playground repository 
https://github.com/mathetake/envoy-dynamic-modules as an Envoy core
extension.
Series of commits will follow this little by little.

#2053, #24230, #32502

Risk Level: N/A (not compiled into the final build yet)
Testing: unit
Docs Changes: N/A
Release Notes: N/A 
Platform Specific Features: N/A
[Optional Runtime guard:]
[Optional Fixes #Issue] 
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]

---------

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
martinduke pushed a commit to martinduke/envoy that referenced this issue Aug 8, 2024
Commit Message: dynamic_modules: adds initial object loading logic
Additional Description:
This is the very first commit of the dynamic loading feature discussed
among community
members. This is the effort to upstream the playground repository
https://github.com/mathetake/envoy-dynamic-modules as an Envoy core
extension.
Series of commits will follow this little by little.

envoyproxy#2053, envoyproxy#24230, envoyproxy#32502

Risk Level: N/A (not compiled into the final build yet)
Testing: unit
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]

---------

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
Signed-off-by: Martin Duke <martin.h.duke@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/extension stale stalebot believes this issue/PR has not been touched recently
Projects
None yet
Development

No branches or pull requests

2 participants