Skip to content

feat(sdk): Add Rust SDK #7578

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

Merged
merged 34 commits into from
Mar 7, 2024
Merged

feat(sdk): Add Rust SDK #7578

merged 34 commits into from
Mar 7, 2024

Conversation

mogery
Copy link
Contributor

@mogery mogery commented Jan 25, 2024

Summary

Fixes #6756
/claim #6756

This PR adds two new Rust SDK crates, highlightio and highlightio-actix, for capturing logs and errors & instrumenting Rust code. These depend heavily on the various opentelemetry libraries.

To-do

  • write bare library with no framework support
  • write examples for bare library
  • write library for integrating into actix
  • write examples for actix library
  • write docs, finalise v1 crate structure

Known issues

  • logging is not shown on stdout, only sent to the server

How did you test this change?

I wrote examples in sdk/highlight-rust/*/examples and validated them using my highlight.io profile.

Are there any deployment considerations?

You need to publish the crates in sdk/highlight-rust.

Copy link

changeset-bot bot commented Jan 25, 2024

⚠️ No Changeset found

Latest commit: d56cf23

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package or glob expression "@highlight-run/rrdom" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "@highlight-run/rrdom-nodejs" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "@highlight-run/rrweb" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "@highlight-run/rrweb-player" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "@highlight-run/rrweb-snapshot" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "@highlight-run/rrweb-types" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "@highlight-run/rrweb-web-extension" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "rrvideo" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.

@Vadman97 Vadman97 requested review from a team, ccschmitz and Vadman97 and removed request for a team January 25, 2024 07:27
@mogery
Copy link
Contributor Author

mogery commented Jan 25, 2024

This is a WIP, no need to review yet, I'll un-draft the PR when it's ready :)

@mogery mogery marked this pull request as ready for review January 27, 2024 16:55
@mogery
Copy link
Contributor Author

mogery commented Jan 27, 2024

@Vadman97 @ccschmitz This is ready to go :) I mainly focused on writing docs for the highlight site, so our docs.rs site might not look the best, but that is fine in my opinion.

Copy link
Member

@Vadman97 Vadman97 left a comment

Choose a reason for hiding this comment

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

looks great, thanks for all the hard work @mogery, and for the thorough testing in the youtube video!

would appreciate your thoughts on how we should publish the packages as rust cargo. once we have that figured out, this will be ready to merge!

@mogery
Copy link
Contributor Author

mogery commented Feb 18, 2024

looks great, thanks for all the hard work @mogery, and for the thorough testing in the youtube video!

would appreciate your thoughts on how we should publish the packages as rust cargo. once we have that figured out, this will be ready to merge!

awesome! been having some super busy days. will get the cargo info to you on tuesday though. are we looking for a CI automated option or just manual is fine?

@Vadman97
Copy link
Member

looks great, thanks for all the hard work @mogery, and for the thorough testing in the youtube video!
would appreciate your thoughts on how we should publish the packages as rust cargo. once we have that figured out, this will be ready to merge!

awesome! been having some super busy days. will get the cargo info to you on tuesday though. are we looking for a CI automated option or just manual is fine?

CI automated would be ideal. i can help with testing it though via a branch to validate the secrets needed etc.

@Vadman97
Copy link
Member

friendly bump here @mogery

@mogery
Copy link
Contributor Author

mogery commented Feb 26, 2024

sorry @Vadman97! been super busy lately. i've got another thing's deadline tonight, will 100% get on this tomorrow.

@mogery
Copy link
Contributor Author

mogery commented Mar 6, 2024

Seems like we'll need to publish the crate manually first, and then we can use this action to automatically detect changes and publish new versions. Could we coordinate this first push over Discord or some other real-time chat? I can walk you through it so that you get the publish token & ownership.

@Vadman97
Copy link
Member

Vadman97 commented Mar 6, 2024

another bump here @mogery . if you think this is in a close spot, i can pull the CI work into a new ticket

@mogery
Copy link
Contributor Author

mogery commented Mar 6, 2024

another bump here @mogery . if you think this is in a close spot, i can pull the CI work into a new ticket

I can work on this now, I posted a comment with info 4 hours ago.

@mogery
Copy link
Contributor Author

mogery commented Mar 6, 2024

Added the READMEs and the GitHub Action. Not sure how to make the action actually run in this PR though. Maybe it only runs once merged.

@Vadman97
Copy link
Member

Vadman97 commented Mar 6, 2024

Run katyo/publish-crates@v2
Searching cargo packages at '.'
/home/runner/.cargo/bin/cargo metadata --no-deps --format-version 1 --manifest-path Cargo.toml
error: manifest path Cargo.toml does not exist
Error: Error: The process '/home/runner/.cargo/bin/cargo' failed with exit code 101

looks like the current working directory isn't set right?

@mogery
Copy link
Contributor Author

mogery commented Mar 6, 2024

Run katyo/publish-crates@v2
Searching cargo packages at '.'
/home/runner/.cargo/bin/cargo metadata --no-deps --format-version 1 --manifest-path Cargo.toml
error: manifest path Cargo.toml does not exist
Error: Error: The process '/home/runner/.cargo/bin/cargo' failed with exit code 101

looks like the current working directory isn't set right?

oops! pushed a fix 🤞

Copy link
Member

@Vadman97 Vadman97 left a comment

Choose a reason for hiding this comment

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

sweet! thanks for getting the CI done as part of this too 🙏

@Vadman97 Vadman97 merged commit 6229bcf into highlight:main Mar 7, 2024
@SpennyNDaJets
Copy link
Contributor

@all-contributors please add @mogery for code

Copy link
Contributor

@SpennyNDaJets

I've put up a pull request to add @mogery! 🎉

SpennyNDaJets pushed a commit that referenced this pull request Mar 7, 2024
Adds @mogery as a contributor for code.

This was requested by SpennyNDaJets [in this
comment](#7578 (comment))

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Rust among our SDKs
4 participants