getsentry / sentry-docs

Sentry's documentation (and tools to build it)
https://docs.sentry.io
Other
326 stars 1.43k forks source link

Document how to make a barebones HTTP reuquest, without any SDK #6835

Open tredondo opened 1 year ago

tredondo commented 1 year ago

Core or SDK?

Platform/SDK

Which part? Which one?

Event creation

Description

I have a request similar to the muzzled #6054. I'm in an environment (Google Apps Script) for which there's no SDK, because it's impossible to import anything. It also has crappy logging so I want to use Sentry.

How can I make a simple API request to log something? I'm coming from Rollbar, where this is very easy and clearly documented. With Sentry, it's very hard to figure out how to do this:

Would be nice not to have to go through the whole Node.js code base to figure out something this basic.

Suggested Solution

Learn from Rollbar - https://docs.rollbar.com/reference/create-item

getsantry[bot] commented 1 year ago

Assigning to @getsentry/support for routing, due by (sfo). ⏲️

cleptric commented 1 year ago

Based on our Code of Conduct, I had to adjust your original message.

We can take a look to clarify the documentation around this topic.

GCSBOSS commented 9 months ago

I'm spending a week already reverse engineering the NodeJs SDK enormous source code in order try and assemble a valid request and got stuck at that message also.

I'm sending a POST request to https://<MY_TOKEN>@sentry.io/api/<OROJECT_ID>/store with JSON body and Content-Type: application/json header and get the infamous message:

Failed to deserialize query string: missing field `sentry_data`

I can't seem to find this field description anywhere. Except for this, maybe.

GCSBOSS commented 9 months ago

Well, after a lot of coming and going, my issue was missing a trailing slash in the URL.

It worked for me like this: POST to https://sentry.io/api/<PROJECT_ID>/store/. Sending X-Sentry-Auth header like this:

Sentry sentry_version=7,  sentry_key=<MY_KEY>,

Here are some resources:

getsantry[bot] commented 9 months ago

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

mydea commented 9 months ago

I'm going to backlog this - I think docs in this direction could for sure be improved, but we are so swamped with work right now that it may be some time until we get around to do this - PRs are welcome!

getsantry[bot] commented 2 months ago

Routing to @getsentry/product-owners-apis for triage ⏲️