@@ -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,55 +1577,83 @@ 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.
15661592 */
15671593SENTRY_API void sentry_remove_user (void );
1594+ SENTRY_API void sentry_scope_remove_user (sentry_scope_t * scope );
15681595
15691596/**
15701597 * Sets a tag.
15711598 */
15721599SENTRY_API void sentry_set_tag (const char * key , const char * value );
15731600SENTRY_API void sentry_set_tag_n (
15741601 const char * key , size_t key_len , const char * value , size_t value_len );
1602+ SENTRY_API void sentry_scope_set_tag (
1603+ sentry_scope_t * scope , const char * key , const char * value );
1604+ SENTRY_API void sentry_scope_set_tag_n (sentry_scope_t * scope , const char * key ,
1605+ size_t key_len , const char * value , size_t value_len );
15751606
15761607/**
15771608 * Removes the tag with the specified key.
15781609 */
15791610SENTRY_API void sentry_remove_tag (const char * key );
15801611SENTRY_API void sentry_remove_tag_n (const char * key , size_t key_len );
1612+ SENTRY_API void sentry_scope_remove_tag (sentry_scope_t * scope , const char * key );
1613+ SENTRY_API void sentry_scope_remove_tag_n (
1614+ sentry_scope_t * scope , const char * key , size_t key_len );
15811615
15821616/**
15831617 * Sets extra information.
15841618 */
15851619SENTRY_API void sentry_set_extra (const char * key , sentry_value_t value );
15861620SENTRY_API void sentry_set_extra_n (
15871621 const char * key , size_t key_len , sentry_value_t value );
1622+ SENTRY_API void sentry_scope_set_extra (
1623+ sentry_scope_t * scope , const char * key , sentry_value_t value );
1624+ SENTRY_API void sentry_scope_set_extra_n (sentry_scope_t * scope , const char * key ,
1625+ size_t key_len , sentry_value_t value );
15881626
15891627/**
15901628 * Removes the extra with the specified key.
15911629 */
15921630SENTRY_API void sentry_remove_extra (const char * key );
15931631SENTRY_API void sentry_remove_extra_n (const char * key , size_t key_len );
1632+ SENTRY_API void sentry_scope_remove_extra (
1633+ sentry_scope_t * scope , const char * key );
1634+ SENTRY_API void sentry_scope_remove_extra_n (
1635+ sentry_scope_t * scope , const char * key , size_t key_len );
15941636
15951637/**
15961638 * Sets a context object.
15971639 */
15981640SENTRY_API void sentry_set_context (const char * key , sentry_value_t value );
15991641SENTRY_API void sentry_set_context_n (
16001642 const char * key , size_t key_len , sentry_value_t value );
1643+ SENTRY_API void sentry_scope_set_context (
1644+ sentry_scope_t * scope , const char * key , sentry_value_t value );
1645+ SENTRY_API void sentry_scope_set_context_n (sentry_scope_t * scope ,
1646+ const char * key , size_t key_len , sentry_value_t value );
16011647
16021648/**
16031649 * Removes the context object with the specified key.
16041650 */
16051651SENTRY_API void sentry_remove_context (const char * key );
16061652SENTRY_API void sentry_remove_context_n (const char * key , size_t key_len );
1653+ SENTRY_API void sentry_scope_remove_context (
1654+ sentry_scope_t * scope , const char * key );
1655+ SENTRY_API void sentry_scope_remove_context_n (
1656+ sentry_scope_t * scope , const char * key , size_t key_len );
16071657
16081658/**
16091659 * Sets the event fingerprint.
@@ -1614,11 +1664,16 @@ SENTRY_API void sentry_remove_context_n(const char *key, size_t key_len);
16141664SENTRY_API void sentry_set_fingerprint (const char * fingerprint , ...);
16151665SENTRY_API void sentry_set_fingerprint_n (
16161666 const char * fingerprint , size_t fingerprint_len , ...);
1667+ SENTRY_API void sentry_scope_set_fingerprint (
1668+ sentry_scope_t * scope , const char * fingerprint , ...);
1669+ SENTRY_API void sentry_scope_set_fingerprint_n (sentry_scope_t * scope ,
1670+ const char * fingerprint , size_t fingerprint_len , ...);
16171671
16181672/**
16191673 * Removes the fingerprint.
16201674 */
16211675SENTRY_API void sentry_remove_fingerprint (void );
1676+ SENTRY_API void sentry_scope_remove_fingerprint (sentry_scope_t * scope );
16221677
16231678/**
16241679 * Set the trace. The primary use for this is to allow other SDKs to propagate
@@ -1635,11 +1690,17 @@ SENTRY_API void sentry_set_trace_n(const char *trace_id, size_t trace_id_len,
16351690SENTRY_API void sentry_set_transaction (const char * transaction );
16361691SENTRY_API void sentry_set_transaction_n (
16371692 const char * transaction , size_t transaction_len );
1693+ SENTRY_API void sentry_scope_set_transaction (
1694+ sentry_scope_t * scope , const char * transaction );
1695+ SENTRY_API void sentry_scope_set_transaction_n (
1696+ sentry_scope_t * scope , const char * transaction , size_t transaction_len );
16381697
16391698/**
16401699 * Sets the event level.
16411700 */
16421701SENTRY_API void sentry_set_level (sentry_level_t level );
1702+ SENTRY_API void sentry_scope_set_level (
1703+ sentry_scope_t * scope , sentry_level_t level );
16431704
16441705/**
16451706 * Sets the maximum number of spans that can be attached to a
0 commit comments