The Native SDK supports C and C++ applications. Download the latest release from the GitHub releases page.
Initialize the SDK early in your application:
#include <sentry.h>
int main(void) {
sentry_options_t *options = sentry_options_new();
sentry_options_set_dsn(options, "YOUR_DSN");
sentry_options_set_sample_rate(options, 0.01); // 1% of transactions
sentry_init(options);
/* Your application code */
sentry_close();
}
Important: Call sentry_close() before exiting. This ensures pending events are flushed.
sentry_capture_event(sentry_value_new_message_event(
SENTRY_LEVEL_INFO,
"custom",
"Test GlitchTip error!"
));
Upload debug symbols (dSYM, PDB, ELF) for readable stack traces using the GlitchTip CLI:
glitchtip-cli debug-files upload ./build --org my-org --project my-project
SENTRY_DSN environment variable.