#how to add Release Health in native-sentry sdk?

4 messages · Page 1 of 1 (latest)

zinc owl
#

I am new to sentry,I see "To track user adoption, crash rates, session data and more, add Release Health to your current setup." I read the doc and try to run the sdk code, I can see the issue , but i do not find Release Health in sentry. I ask AI , it tells me to add sentry_start_session() ,but it doesn't help.
This is my sdk code ,Thanks for your help

#include <stdio.h>
#include <sentry.h>

int main(void) {
    sentry_options_t* options = sentry_options_new();

    sentry_options_set_dsn(options, "my_dsn");
    sentry_options_set_database_path(options, ".sentry-native");
    sentry_options_set_environment(options, "production");
    sentry_options_set_release(options, "my-project-name@2.3.15");
    sentry_options_set_debug(options, 1);

    sentry_init(options);

    sentry_value_t user = sentry_value_new_user("33", "Alice", "alice@example.com", "{{auto}}");
    sentry_value_set_by_key(user, "custom_key", sentry_value_new_string("custom_value"));
    sentry_set_user(user);

    sentry_capture_event(sentry_value_new_message_event(
        /*   level */ SENTRY_LEVEL_ERROR,
        /*  logger */ "custom",
        /* message */ "An error occurred!!"
    ));
    sentry_close();

    return 0;
}
hoary quest
#

Hi, the snippet you shared looks correct (you would only have to add sentry_start_session() if you want manual session tracking but this is not required).

You can find the Releases in sidebar > Explore > Releases (new UI, first screenshot)
Or just in the sidebar under 'Releases' in the old UI (second screenshot)

zinc owl
hoary quest
#

hmm you're right, that seems incorrect. I tried throwing a *(int *)0 = 0; in my code to confirm, and it does not show up as a crashed session. I'll investigate, thanks for bringing this up!