@@ -1402,7 +1402,7 @@ SENTRY_API uint64_t sentry_options_get_shutdown_timeout(sentry_options_t *opts);
14021402SENTRY_API void sentry_options_set_backend (
14031403 sentry_options_t * opts , sentry_backend_t * backend );
14041404
1405- /* -- Global APIs -- */
1405+ /* -- Global/Scope APIs -- */
14061406
14071407/**
14081408 * Initializes the Sentry SDK with the specified options.
@@ -1502,6 +1502,26 @@ SENTRY_API void sentry_user_consent_reset(void);
15021502 */
15031503SENTRY_API sentry_user_consent_t sentry_user_consent_get (void );
15041504
1505+ /**
1506+ * A sentry Scope.
1507+ *
1508+ * See https://develop.sentry.dev/sdk/telemetry/scopes/
1509+ */
1510+ struct sentry_scope_s ;
1511+ typedef struct sentry_scope_s sentry_scope_t ;
1512+
1513+ /**
1514+ * Creates a local scope.
1515+ *
1516+ * The return value must be freed with `sentry_scope_free`.
1517+ */
1518+ SENTRY_API sentry_scope_t * sentry_local_scope_new (void );
1519+
1520+ /**
1521+ * Deallocates previously allocated scope.
1522+ */
1523+ SENTRY_API void sentry_scope_free (sentry_scope_t * scope );
1524+
15051525/**
15061526 * Sends a sentry event.
15071527 *
@@ -1510,6 +1530,8 @@ SENTRY_API sentry_user_consent_t sentry_user_consent_get(void);
15101530 * be used to send transactions.
15111531 */
15121532SENTRY_API sentry_uuid_t sentry_capture_event (sentry_value_t event );
1533+ SENTRY_API sentry_uuid_t sentry_capture_event_with_scope (
1534+ sentry_value_t event , sentry_scope_t * scope );
15131535
15141536/**
15151537 * Allows capturing independently created minidumps.
@@ -1555,11 +1577,15 @@ SENTRY_EXPERIMENTAL_API void sentry_handle_exception(
15551577 * Adds the breadcrumb to be sent in case of an event.
15561578 */
15571579SENTRY_API void sentry_add_breadcrumb (sentry_value_t breadcrumb );
1580+ SENTRY_API void sentry_scope_add_breadcrumb (
1581+ sentry_scope_t * scope , sentry_value_t breadcrumb );
15581582
15591583/**
15601584 * Sets the specified user.
15611585 */
15621586SENTRY_API void sentry_set_user (sentry_value_t user );
1587+ SENTRY_API void sentry_scope_set_user (
1588+ sentry_scope_t * scope , sentry_value_t user );
15631589
15641590/**
15651591 * Removes a user.
@@ -1572,6 +1598,10 @@ SENTRY_API void sentry_remove_user(void);
15721598SENTRY_API void sentry_set_tag (const char * key , const char * value );
15731599SENTRY_API void sentry_set_tag_n (
15741600 const char * key , size_t key_len , const char * value , size_t value_len );
1601+ SENTRY_API void sentry_scope_set_tag (
1602+ sentry_scope_t * scope , const char * key , const char * value );
1603+ SENTRY_API void sentry_scope_set_tag_n (sentry_scope_t * scope , const char * key ,
1604+ size_t key_len , const char * value , size_t value_len );
15751605
15761606/**
15771607 * Removes the tag with the specified key.
@@ -1585,6 +1615,10 @@ SENTRY_API void sentry_remove_tag_n(const char *key, size_t key_len);
15851615SENTRY_API void sentry_set_extra (const char * key , sentry_value_t value );
15861616SENTRY_API void sentry_set_extra_n (
15871617 const char * key , size_t key_len , sentry_value_t value );
1618+ SENTRY_API void sentry_scope_set_extra (
1619+ sentry_scope_t * scope , const char * key , sentry_value_t value );
1620+ SENTRY_API void sentry_scope_set_extra_n (sentry_scope_t * scope , const char * key ,
1621+ size_t key_len , sentry_value_t value );
15881622
15891623/**
15901624 * Removes the extra with the specified key.
@@ -1598,6 +1632,10 @@ SENTRY_API void sentry_remove_extra_n(const char *key, size_t key_len);
15981632SENTRY_API void sentry_set_context (const char * key , sentry_value_t value );
15991633SENTRY_API void sentry_set_context_n (
16001634 const char * key , size_t key_len , sentry_value_t value );
1635+ SENTRY_API void sentry_scope_set_context (
1636+ sentry_scope_t * scope , const char * key , sentry_value_t value );
1637+ SENTRY_API void sentry_scope_set_context_n (sentry_scope_t * scope ,
1638+ const char * key , size_t key_len , sentry_value_t value );
16011639
16021640/**
16031641 * Removes the context object with the specified key.
@@ -1614,6 +1652,10 @@ SENTRY_API void sentry_remove_context_n(const char *key, size_t key_len);
16141652SENTRY_API void sentry_set_fingerprint (const char * fingerprint , ...);
16151653SENTRY_API void sentry_set_fingerprint_n (
16161654 const char * fingerprint , size_t fingerprint_len , ...);
1655+ SENTRY_API void sentry_scope_set_fingerprint (
1656+ sentry_scope_t * scope , const char * fingerprint , ...);
1657+ SENTRY_API void sentry_scope_set_fingerprint_n (sentry_scope_t * scope ,
1658+ const char * fingerprint , size_t fingerprint_len , ...);
16171659
16181660/**
16191661 * Removes the fingerprint.
@@ -1635,11 +1677,17 @@ SENTRY_API void sentry_set_trace_n(const char *trace_id, size_t trace_id_len,
16351677SENTRY_API void sentry_set_transaction (const char * transaction );
16361678SENTRY_API void sentry_set_transaction_n (
16371679 const char * transaction , size_t transaction_len );
1680+ SENTRY_API void sentry_scope_set_transaction (
1681+ sentry_scope_t * scope , const char * transaction );
1682+ SENTRY_API void sentry_scope_set_transaction_n (
1683+ sentry_scope_t * scope , const char * transaction , size_t transaction_len );
16381684
16391685/**
16401686 * Sets the event level.
16411687 */
16421688SENTRY_API void sentry_set_level (sentry_level_t level );
1689+ SENTRY_API void sentry_scope_set_level (
1690+ sentry_scope_t * scope , sentry_level_t level );
16431691
16441692/**
16451693 * Sets the maximum number of spans that can be attached to a
0 commit comments