Comments (4)
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.
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-native/src/sentry_envelope.c
Line 412 in e995329
I hope this answers your question. Feel free to reopen.
from sentry-native.
@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.
@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)
- Incorrect issue grouping on Windows HOT 5
- Feature Request: Provide explicit timings to the Performance Monitoring API HOT 4
- Add Linux distro meta-data to OS context. HOT 4
- Qt Android integration documentation HOT 7
- [native] Add support for Sentry Metrics
- Proposal: official crashpad handler as application exe HOT 1
- Set user agent string (sdk name + version) HOT 4
- Exception not catched in sentry - how to investigate why HOT 12
- [#inc-517] Re-test repros before and after applying Google Jan 24 updates HOT 2
- [#inc-517] Document caveats of signalhandlers and sigaltstack HOT 3
- [Epic] #inc-517 Followups
- [#inc-517] Add basic crashing test with asan (HW Asan, GWP-ASan)
- install issue HOT 4
- [linux] RISC-V 32/64 support HOT 1
- Android NDK Segfault crash related to `sentry_value_set_by_key_n` HOT 4
- Craspad under Epic's "Easy Anti-Cheat" HOT 4
- Stack overflow not sent to backend HOT 10
- Extend envelope API to allow event-specific attachments HOT 3
- sentry_transaction_set_data() - Discarded unknown attribute
- Only set up sigaltstack if there is none (Linux + Android)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sentry-native.