sentry-php icon indicating copy to clipboard operation
sentry-php copied to clipboard

how to attach uploaded files?

Open ghost opened this issue 5 years ago • 10 comments

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.

ghost avatar Apr 04 '20 00:04 ghost

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).

stayallive avatar Apr 04 '20 08:04 stayallive

thanks for suggestion, I was also thinking about uploading files to cloud and attach the link as extra context when crashes.

ghost avatar Apr 04 '20 09:04 ghost

Would be great if this was added to the SDK!

peterrattew-old avatar Aug 10 '20 16:08 peterrattew-old

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?

Kolyunya avatar Nov 16 '21 10:11 Kolyunya

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 avatar Nov 16 '21 16:11 ste93cry

@ste93cry could someone from the team at least reopen this issue?

Kolyunya avatar Nov 16 '21 20:11 Kolyunya

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 🥀

github-actions[bot] avatar Jan 12 '22 21:01 github-actions[bot]

@Jean85 is it possible to add this one to the backlog? Thank you!

Kolyunya avatar Jan 12 '22 21:01 Kolyunya

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

ste93cry avatar Jan 12 '22 22:01 ste93cry

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

vladanpaunovic avatar Aug 12 '22 09:08 vladanpaunovic

Hello, is someone working on this or is help appreciated?

jankonas avatar Apr 21 '23 07:04 jankonas

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

cleptric avatar Apr 21 '23 10:04 cleptric