Git Product home page Git Product logo

Comments (4)

Swatinem avatar Swatinem commented on May 26, 2024 1

The URL in the post above does not seem to work, anymore, here is an updated one: https://develop.sentry.dev/sdk/overview/#parsing-the-dsn
The envelope docs also give you the POST url: https://develop.sentry.dev/sdk/envelopes

You have to parse the DSN and extract the authentication header from that yourself, as well as to create the actual envelope url from it. That functionality is unfortunately not exposed publicly from the SDK.

from sentry-native.

Swatinem avatar Swatinem commented on May 26, 2024

You can use sentry_options_set_transport to specify your own transport, and sentry_new_function_transport to create a very simple callback-based transport.

You use it like this:

        sentry_options_set_transport(
            options, sentry_new_function_transport(print_envelope, NULL));

All you can do right now with that envelope is to serialize it to a string, and then send it as a Content-Type: application/x-sentry-envelope to the store endpoint. See https://docs.sentry.io/development/sdk-dev/overview/#parsing-the-dsn for more details.

We are thinking about maybe exposing the internal sentry__envelope_for_each_request method in the future to make this a bit simpler for external users.

sentry__envelope_for_each_request(const sentry_envelope_t *envelope,

I hope this answers your question. Feel free to reopen.

from sentry-native.

agauniyal avatar agauniyal commented on May 26, 2024

@Swatinem how do I exactly send the serialized envelope information to required DSN? Suppose my DSN looks like - https://[email protected]/123, do I send a post request to it?
And how do I send the data I get from char* s = sentry_envelope_serialize(envelope, &size_out);? I see it's something like -

{"dsn": "...", "event_id": ""}
{"type":"event","length":...}
{"event_id":"...",.................................................}

From the previous comment, I notice I've to set Content-Type: application/x-sentry-envelope header but don't know about the string(containing 3 separate JSON) above.

For now, I've tried sending POST and PUT request to above DSN URL, with mentioned header set and that entire thing as raw string in body. The response I get is 404.

from sentry-native.

agauniyal avatar agauniyal commented on May 26, 2024

@Swatinem thanks! you correctly identified the problem of URL not working, thanks for providing the updated URL. I also managed to figure everything out by going through the sentry_example.c and putting curl_verbose = 1 😄

from sentry-native.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.