sentry-php
sentry-php copied to clipboard
how to attach uploaded files?
people will upload excels to our app but the excel contents may not fit to our requirements and sometimes our app will crash... therefore, it could be easier for us if we can have the file to test.
As far as I know this is not a feature supported by the Sentry server (attaching files to events).
This might be best handled in your app to keep the excel source file until the job succeeds or the user deletes it.
This way you can re-download the file as much as you want (and the end-user can too).
thanks for suggestion, I was also thinking about uploading files to cloud and attach the link as extra context when crashes.
Would be great if this was added to the SDK!
Seems like newer versions of the Sentry server actually do support attachments. There are docs for some SDKs (1, 2, 3), but not for PHP. Can we have support of attachments for PHP, please?
There's no reason to not support this now that the server does, however I have no ETA to share on when this will happen, if it will.
Disclaimer: I'm not a Sentry employee, so while me as a OSS contributor don't have a plan to implement this anytime soon, maybe the Sentry guys have it
@ste93cry could someone from the team at least reopen this issue?
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
@Jean85 is it possible to add this one to the backlog? Thank you!
Added, thanks. I cannot promised anything about if and when this will be implemented (but contribution is welcome of course, even though it may not be that easy), but it's definitely something we want to keep track of
While we will add this at some point in the future, I believe this is possible for you to do this on your own already today. 😉
The way we did it in the Javascript SDK, before introducing our own api to do that was just by calling the sentry api directly.
It is quite easy. I dig up the old commit with the code example for you (in JS though, but you can easily rewrite this in php).
https://github.com/getsentry/sentry-docs/blob/e6536cff4d6ecaddc19fbee9d3de1771d270034f/src/includes/enriching-events/add-attachment/javascript.mdx
Hello, is someone working on this or is help appreciated?
We won't add this feature in the current major version. See https://github.com/getsentry/sentry-php/pull/1436
For now, you can implement this feature by doing something similar as outlined in https://github.com/getsentry/sentry-php/issues/996#issuecomment-1212922687