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

Missing documentation about the SENTRY_PROFILER_BINARY_DIR and SENTRY_PROFILER_BINARY_PATH env variable #11128

Closed
Jimmy89 opened this issue Aug 21, 2024 · 7 comments · Fixed by #11382
Assignees

Comments

@Jimmy89
Copy link

Jimmy89 commented Aug 21, 2024

Core or SDK?

Platform/SDK

Which part? Which one?

@sentry/profiling-node

Description

I was debugging errors from my webpack output (packing node_modules as well) for our lambda, as I received a missing SENTRY_FILE.node error.

After some debugging, I found out that the @sentry/profiling-node package dynamically lookup a compiled .node file, where the path can be set with SENTRY_PROFILER_BINARY_DIR or SENTRY_PROFILER_BINARY_PATH. However, I did not find any documentation within Sentry that these env variables exist.

Suggested Solution

Document these two variables.

@Jimmy89 Jimmy89 added the Type: Content Issues about the contents of our docs label Aug 21, 2024
@getsantry
Copy link
Contributor

getsantry bot commented Aug 21, 2024

Assigning to @getsentry/support for routing ⏲️

@JonasBa
Copy link
Member

JonasBa commented Sep 9, 2024

@Jimmy89 We intentionally did not document this as we do not really want to encourage the usage - in most cases this should never be used. Is this something that you need in your project?

@Jimmy89
Copy link
Author

Jimmy89 commented Sep 12, 2024

@JonasBa yes, as we used webpack to minimize our build (a copy of our node_modules and code exceeded the 50mb zip file limit), we used webpack to minimize our build (including the node_modules artifacts). We got errors from the sentry package which stated that the binaries could not be found within the build path location (running within the lambda environment). Therefore, I started digging into the code to find a way to patch the lookup path for the binary. Resulting into finding these env variables, including the sentry-prune-profiler-binaries. By using both (env and pruner) I managed to create a very minimal and working package in our lambda, without monkey-patching any code.

We used the lambda layer, which should also have the binaries, but with the latest major version (v8) of Sentry EcmaScript code (which we use) we must apply the NPM modules way. In combination with a webpack build you must use those Sentry env variables. Therefore, I think it's good to document these, as it will help others.

@getsantry
Copy link
Contributor

getsantry bot commented Sep 13, 2024

Routing to @getsentry/product-owners-sdks-web-frontend for triage ⏲️

@andreiborza
Copy link
Member

Hi @Jimmy89, we have getsentry/sentry-javascript#13049 in our backlog aiming to create a dedicated layer for Lambda, but didn't get to it yet.

This might still be nice to document tho @JonasBa wdyt?

@JonasBa
Copy link
Member

JonasBa commented Sep 17, 2024

@andreiborza yes, I'm adding the doc today. I planned on adding it yesterday, but ended up prioritizing other work.

@JonasBa
Copy link
Member

JonasBa commented Sep 17, 2024

Added the documentation in #11382

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants