Skip to main content

Scope

A scope holds data that should implicitly be sent with Sentry events. It can hold context data, extra parameters, level overrides, fingerprints etc.

The user can modify the current scope (to set extra, tags, current user) through the global function configure_scope. configure_scope takes a callback function to which it passes the current scope.

Functions

new

Scope.new() → ()

ConfigureScope

Scope:ConfigureScope(Callback(Scope) → ()) → ()

The reason for this callback-based API is efficiency. If the SDK is disabled, it should not invoke the callback, thus avoiding unnecessary work.

SetUser

Scope:SetUser(PlayerPlayer | number) → ()

Adds information of the given player to each event sent. Only one user may be associated with a Scope at any given time. Calling this method will override the current user. When no player is provided, any existing player information is removed.

The UserId, Name and country-code of the player is sent.

SetExtra

Scope:SetExtra(
Keystring,
ValueDefaults.ValidJSONValues
) → ()

SetExtras

Scope:SetExtras(Dictionary{[string]Defaults.ValidJSONValues}) → ()

SetTag

Scope:SetTag(
Keystring,
ValueDefaults.ValidJSONValues
) → ()

SetTags

Scope:SetTags(Dictionary{[string]Defaults.ValidJSONValues}) → ()

SetContext

Scope:SetContext(
Keystring,
ValueDefaults.ValidJSONValues
) → ()

SetLevel

Scope:SetLevel(LevelDefaults.Level) → ()

SetTranSaction

Scope:SetTranSaction(TransactionNamestring) → ()

SetFingerprint

Scope:SetFingerprint(Fingerprint{string}) → ()

AddEventProcessor

Scope:AddEventProcessor(Processor(
Event,
) → (Event)) → ()

Clear

Scope:Clear() → ()

Clone

Scope:Clone() → ()

AddBreadcrumb

unreleased
</>
Scope:AddBreadcrumb(BreadcrumbBreadcrumb) → ()

ClearBreadcrumbs

unreleased
</>
Scope:ClearBreadcrumbs() → ()

ApplyToEvent

Scope:ApplyToEvent(
EventEvent,
HintHint
) → Defaults.Event
Show raw api
{
    "functions": [
        {
            "name": "_AddGlobalEventProcessor",
            "desc": "",
            "params": [
                {
                    "name": "Function",
                    "desc": "",
                    "lua_type": "(Event, Hint) -> (Event)"
                }
            ],
            "returns": [],
            "function_type": "static",
            "private": true,
            "source": {
                "line": 29,
                "path": "src/Hub/Scope.lua"
            }
        },
        {
            "name": "new",
            "desc": "",
            "params": [],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 40,
                "path": "src/Hub/Scope.lua"
            }
        },
        {
            "name": "ConfigureScope",
            "desc": "The reason for this callback-based API is efficiency. If the SDK is disabled, it\nshould not invoke the callback, thus avoiding unnecessary work.",
            "params": [
                {
                    "name": "Callback",
                    "desc": "",
                    "lua_type": "(Scope) -> ()"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 54,
                "path": "src/Hub/Scope.lua"
            }
        },
        {
            "name": "SetUser",
            "desc": "Adds information of the given player to each event sent.\nOnly one user may be associated with a Scope at any given time. Calling this method will override the current user.\nWhen no player is provided, any existing player information is removed.\n\nThe `UserId`, `Name` and country-code of the player is sent.",
            "params": [
                {
                    "name": "Player",
                    "desc": "",
                    "lua_type": "Player | number"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 66,
                "path": "src/Hub/Scope.lua"
            }
        },
        {
            "name": "SetExtra",
            "desc": "",
            "params": [
                {
                    "name": "Key",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "Value",
                    "desc": "",
                    "lua_type": "Defaults.ValidJSONValues"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 102,
                "path": "src/Hub/Scope.lua"
            }
        },
        {
            "name": "SetExtras",
            "desc": "",
            "params": [
                {
                    "name": "Dictionary",
                    "desc": "",
                    "lua_type": "{[string]: Defaults.ValidJSONValues}"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 108,
                "path": "src/Hub/Scope.lua"
            }
        },
        {
            "name": "SetTag",
            "desc": "",
            "params": [
                {
                    "name": "Key",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "Value",
                    "desc": "",
                    "lua_type": "Defaults.ValidJSONValues"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 117,
                "path": "src/Hub/Scope.lua"
            }
        },
        {
            "name": "SetTags",
            "desc": "",
            "params": [
                {
                    "name": "Dictionary",
                    "desc": "",
                    "lua_type": "{[string]: Defaults.ValidJSONValues}"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 123,
                "path": "src/Hub/Scope.lua"
            }
        },
        {
            "name": "SetContext",
            "desc": "",
            "params": [
                {
                    "name": "Key",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "Value",
                    "desc": "",
                    "lua_type": "Defaults.ValidJSONValues"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 132,
                "path": "src/Hub/Scope.lua"
            }
        },
        {
            "name": "SetLevel",
            "desc": "",
            "params": [
                {
                    "name": "Level",
                    "desc": "",
                    "lua_type": "Defaults.Level"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 138,
                "path": "src/Hub/Scope.lua"
            }
        },
        {
            "name": "SetTranSaction",
            "desc": "",
            "params": [
                {
                    "name": "TransactionName",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 144,
                "path": "src/Hub/Scope.lua"
            }
        },
        {
            "name": "SetFingerprint",
            "desc": "",
            "params": [
                {
                    "name": "Fingerprint",
                    "desc": "",
                    "lua_type": "{string}"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 150,
                "path": "src/Hub/Scope.lua"
            }
        },
        {
            "name": "AddEventProcessor",
            "desc": "",
            "params": [
                {
                    "name": "Processor",
                    "desc": "",
                    "lua_type": "(Event, Hint) -> (Event)"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 158,
                "path": "src/Hub/Scope.lua"
            }
        },
        {
            "name": "Clear",
            "desc": "",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 165,
                "path": "src/Hub/Scope.lua"
            }
        },
        {
            "name": "Clone",
            "desc": "",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 175,
                "path": "src/Hub/Scope.lua"
            }
        },
        {
            "name": "AddBreadcrumb",
            "desc": "",
            "params": [
                {
                    "name": "Breadcrumb",
                    "desc": "",
                    "lua_type": "Breadcrumb"
                }
            ],
            "returns": [],
            "function_type": "method",
            "unreleased": true,
            "source": {
                "line": 184,
                "path": "src/Hub/Scope.lua"
            }
        },
        {
            "name": "ClearBreadcrumbs",
            "desc": "",
            "params": [],
            "returns": [],
            "function_type": "method",
            "unreleased": true,
            "source": {
                "line": 191,
                "path": "src/Hub/Scope.lua"
            }
        },
        {
            "name": "ApplyToEvent",
            "desc": "",
            "params": [
                {
                    "name": "Event",
                    "desc": "",
                    "lua_type": "Event"
                },
                {
                    "name": "Hint",
                    "desc": "",
                    "lua_type": "Hint"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Defaults.Event\n"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 200,
                "path": "src/Hub/Scope.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "Scope",
    "desc": "A scope holds data that should implicitly be sent with Sentry events.\nIt can hold context data, extra parameters, level overrides, fingerprints etc.\n\nThe user can modify the current scope (to set extra, tags, current user) through\nthe global function configure_scope. configure_scope takes a callback function\nto which it passes the current scope.",
    "source": {
        "line": 20,
        "path": "src/Hub/Scope.lua"
    }
}