{"componentChunkName":"component---src-templates-doc-tsx","path":"/clients/python/api/","result":{"data":{"file":{"id":"83fcd615-bd44-5735-b98d-65d4b1598a5c","relativePath":"clients/python/api.mdx","sourceInstanceName":"docs","childMarkdownRemark":null,"childMdx":{"body":"function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"draft\": false,\n  \"categories\": [],\n  \"toc\": true,\n  \"title\": \"API Reference\",\n  \"noindex\": true,\n  \"tags\": []\n};\n\nvar makeShortcode = function makeShortcode(name) {\n  return function MDXDefaultShortcode(props) {\n    console.warn(\"Component \" + name + \" was not imported, exported, or provided by MDXProvider as global scope\");\n    return mdx(\"div\", props);\n  };\n};\n\nvar CodeTabs = makeShortcode(\"CodeTabs\");\nvar CodeBlock = makeShortcode(\"CodeBlock\");\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, [\"components\"]);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"p\", null, \"This gives you an overview of the public API that raven-python exposes.\"), mdx(\"h2\", {\n    \"id\": \"client\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", _extends({\n    parentName: \"h2\"\n  }, {\n    \"href\": \"#client\",\n    \"aria-label\": \"client permalink\",\n    \"className\": \"anchor before\"\n  }), mdx(\"svg\", _extends({\n    parentName: \"a\"\n  }, {\n    \"viewBox\": \"0 0 24 24\",\n    \"xmlns\": \"http://www.w3.org/2000/svg\"\n  }), mdx(\"path\", _extends({\n    parentName: \"svg\"\n  }, {\n    \"d\": \"M10.879 6.05L15 1.93A5.001 5.001 0 0 1 22.071 9l-4.121 4.121a1 1 0 0 1-1.414-1.414l4.12-4.121a3 3 0 1 0-4.242-4.243l-4.121 4.121a1 1 0 1 1-1.414-1.414zm2.242 11.9L9 22.07A5 5 0 1 1 1.929 15l4.121-4.121a1 1 0 0 1 1.414 1.414l-4.12 4.121a3 3 0 1 0 4.242 4.243l4.121-4.121a1 1 0 1 1 1.414 1.414zm-8.364-.122l13.071-13.07a1 1 0 0 1 1.415 1.414L6.172 19.242a1 1 0 1 1-1.415-1.414z\",\n    \"fill\": \"currentColor\"\n  })))), \"Client\"), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, \"{: #raven.Client}\", mdx(\"em\", {\n    parentName: \"dt\"\n  }, \"class\"), \" \", mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"raven.``Client\"), \"(\", mdx(\"em\", {\n    parentName: \"dt\"\n  }, \"dsn=None\"), \", \", mdx(\"em\", {\n    parentName: \"dt\"\n  }, \"*\", \"*\", \"kwargs\"), \")\"), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"The client needs to be instantiated once and can then be used for submitting events to the Sentry server. For information about the configuration of that client and which parameters are accepted see \", mdx(\"a\", _extends({\n    parentName: \"dd\"\n  }, {\n    \"href\": \"/clients/python/advanced/#python-client-config\"\n  }), \"Configuring the Client\"), \".\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, \"{: #raven.Client.capture}\", mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"capture\"), \"(\", mdx(\"em\", {\n    parentName: \"dt\"\n  }, \"event_type\"), \", \", mdx(\"em\", {\n    parentName: \"dt\"\n  }, \"data=None\"), \", \", mdx(\"em\", {\n    parentName: \"dt\"\n  }, \"date=None\"), \", \", mdx(\"em\", {\n    parentName: \"dt\"\n  }, \"time_spent=None\"), \", \", mdx(\"em\", {\n    parentName: \"dt\"\n  }, \"extra=None\"), \", \", mdx(\"em\", {\n    parentName: \"dt\"\n  }, \"stack=False\"), \", \", mdx(\"em\", {\n    parentName: \"dt\"\n  }, \"tags=None\"), \", \", mdx(\"em\", {\n    parentName: \"dt\"\n  }, \"*\", \"*\", \"kwargs\"), \")\"), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"This method is the low-level method for reporting events to Sentry. It captures and processes an event and pipes it via the configured transport to Sentry.\"))), mdx(\"div\", {\n    \"className\": \"code-tabs-wrapper\"\n  }, mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"text\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-text\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-text\"\n  }), \"Example:\\n\\n```python\\ncapture('raven.events.Message', message='foo', data={\\n    'request': {\\n        'url': '...',\\n        'data': {},\\n        'query_string': '...',\\n        'method': 'POST',\\n    },\\n    'logger': 'logger.name',\\n}, extra={\\n    'key': 'value',\\n})\\n```\\n\\n<table class=\\\"table\\\"><tbody valign=\\\"top\\\"><tr><th>Parameters:</th><td><ul><li><strong>event_type</strong> \\u2013 the module path to the Event class. Builtins can use shorthand class notation and exclude the full module path.</li><li><strong>data</strong> \\u2013 the data base, useful for specifying structured data interfaces. Any key which contains a \\u2018.\\u2019 will be assumed to be a data interface.</li><li><strong>date</strong> \\u2013 the datetime of this event. If not supplied the current timestamp is used.</li><li><strong>time_spent</strong> \\u2013 a integer value representing the duration of the event (in milliseconds)</li><li><strong>extra</strong> \\u2013 a dictionary of additional standard metadata.</li><li><strong>stack</strong> \\u2013 If set to <cite>True</cite> a stack frame is recorded together with the event.</li><li><strong>tags</strong> \\u2013 dict of extra tags</li><li><strong>sample_rate</strong> \\u2013 a float in the range [0, 1] to sample this message. This overrides the Client object\\u2019s sample_rate</li><li><strong>kwargs</strong> \\u2013 extra keyword arguments are handled specific to the reported event type.</li></ul></td></tr><tr><th>Returns:</th><td>a tuple with a 32-length string identifying this event</td></tr></tbody></table>\")))))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, \"{: #raven.Client.captureMessage}\", mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"captureMessage\"), \"(\", mdx(\"em\", {\n    parentName: \"dt\"\n  }, \"message\"), \", \", mdx(\"em\", {\n    parentName: \"dt\"\n  }, \"*\", \"*\", \"kwargs\"), \")\"), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"This is a shorthand to reporting a message via \", mdx(\"a\", _extends({\n    parentName: \"dd\"\n  }, {\n    \"href\": \"#raven.Client.capture\",\n    \"title\": \"raven.Client.capture\"\n  }), mdx(\"inlineCode\", {\n    parentName: \"a\"\n  }, \"capture()\")), \". It passes \", mdx(\"inlineCode\", {\n    parentName: \"dd\"\n  }, \"'raven.events.Message'\"), \" as \", mdx(\"em\", {\n    parentName: \"dd\"\n  }, \"event_type\"), \" and the message along. All other keyword arguments are regularly forwarded.\"))), mdx(\"div\", {\n    \"className\": \"code-tabs-wrapper\"\n  }, mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"text\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-text\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-text\"\n  }), \"Example:\\n\\n```python\\nclient.captureMessage('This just happened!')\\n```\")))))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, \"{: #raven.Client.captureException}\", mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"captureException\"), \"(\", mdx(\"em\", {\n    parentName: \"dt\"\n  }, \"exc_info=None\"), \", \", mdx(\"em\", {\n    parentName: \"dt\"\n  }, \"*\", \"*\", \"kwargs\"), \")\"), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"This is a shorthand to reporting an exception via \", mdx(\"a\", _extends({\n    parentName: \"dd\"\n  }, {\n    \"href\": \"#raven.Client.capture\",\n    \"title\": \"raven.Client.capture\"\n  }), mdx(\"inlineCode\", {\n    parentName: \"a\"\n  }, \"capture()\")), \". It passes \", mdx(\"inlineCode\", {\n    parentName: \"dd\"\n  }, \"'raven.events.Exception'\"), \" as \", mdx(\"em\", {\n    parentName: \"dd\"\n  }, \"event_type\"), \" and the traceback along. All other keyword arguments are regularly forwarded.\"))), mdx(\"div\", {\n    \"className\": \"code-tabs-wrapper\"\n  }, mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"text\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-text\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-text\"\n  }), \"If exc_info is not provided, or is set to True, then this method will perform the `exc_info = sys.exc_info()` and the requisite clean-up for you.\\n\\nExample:\\n\\n```python\\ntry:\\n    1 / 0\\nexcept Exception:\\n    client.captureException()\\n```\")))))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"captureBreadcrumb(message=None, timestamp=None,\"), mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"level=None, category=None, data=None,\"), mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"type=None, processor=None)\")), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"Manually captures a breadcrumb in the internal buffer for the current client\\u2019s context. Instead of using this method you are encouraged to instead use the \", mdx(\"a\", _extends({\n    parentName: \"dd\"\n  }, {\n    \"href\": \"/clients/python/breadcrumbs/#raven.breadcrumbs.record\",\n    \"title\": \"raven.breadcrumbs.record\"\n  }), mdx(\"inlineCode\", {\n    parentName: \"a\"\n  }, \"raven.breadcrumbs.record()\")), \" function which records to the correct client automatically.\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, \"{: #raven.Client.send}\", mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"send\"), \"(\", mdx(\"em\", {\n    parentName: \"dt\"\n  }, \"*\", \"*\", \"data\"), \")\"), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"Accepts all data parameters and serializes them, then sends then onwards via the transport to Sentry. This can be used as to send low-level protocol data to the server.\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, \"{: #raven.Client.context}\", mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"context\")), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"Returns a reference to the thread local context object. See \", mdx(\"a\", _extends({\n    parentName: \"dd\"\n  }, {\n    \"href\": \"#raven.context.Context\",\n    \"title\": \"raven.context.Context\"\n  }), mdx(\"inlineCode\", {\n    parentName: \"a\"\n  }, \"raven.context.Context\")), \" for more information.\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, \"{: #raven.Client.user\", mdx(\"em\", {\n    parentName: \"dt\"\n  }, \"context}\", mdx(\"inlineCode\", {\n    parentName: \"em\"\n  }, \"user_context\"), \"(\", \"_\", \"data\"), \")\"), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"Updates the user context for future events.\"))), mdx(\"div\", {\n    \"className\": \"code-tabs-wrapper\"\n  }, mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"text\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-text\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-text\"\n  }), \"Equivalent to this:\\n\\n```python\\nclient.context.merge({'user': data})\\n```\")))))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, \"{: #raven.Client.http\", mdx(\"em\", {\n    parentName: \"dt\"\n  }, \"context}\", mdx(\"inlineCode\", {\n    parentName: \"em\"\n  }, \"http_context\"), \"(\", \"_\", \"data\"), \")\"), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"Updates the HTTP context for future events.\"))), mdx(\"div\", {\n    \"className\": \"code-tabs-wrapper\"\n  }, mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"text\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-text\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-text\"\n  }), \"Equivalent to this:\\n\\n```python\\nclient.context.merge({'request': data})\\n```\")))))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, \"{: #raven.Client.extra\", mdx(\"em\", {\n    parentName: \"dt\"\n  }, \"context}\", mdx(\"inlineCode\", {\n    parentName: \"em\"\n  }, \"extra_context\"), \"(\", \"_\", \"data\"), \")\"), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"Update the extra context for future events.\"))), mdx(\"div\", {\n    \"className\": \"code-tabs-wrapper\"\n  }, mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"text\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-text\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-text\"\n  }), \"Equivalent to this:\\n\\n```python\\nclient.context.merge({'extra': data})\\n```\")))))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, \"{: #raven.Client.tags\", mdx(\"em\", {\n    parentName: \"dt\"\n  }, \"context}\", mdx(\"inlineCode\", {\n    parentName: \"em\"\n  }, \"tags_context\"), \"(\", \"_\", \"data\"), \")\"), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"Update the tags context for future events.\"))), mdx(\"div\", {\n    \"className\": \"code-tabs-wrapper\"\n  }, mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"text\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-text\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-text\"\n  }), \"Equivalent to this:\\n\\n```python\\nclient.context.merge({'tags': data})\\n```\")))))), mdx(\"h2\", {\n    \"id\": \"context\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", _extends({\n    parentName: \"h2\"\n  }, {\n    \"href\": \"#context\",\n    \"aria-label\": \"context permalink\",\n    \"className\": \"anchor before\"\n  }), mdx(\"svg\", _extends({\n    parentName: \"a\"\n  }, {\n    \"viewBox\": \"0 0 24 24\",\n    \"xmlns\": \"http://www.w3.org/2000/svg\"\n  }), mdx(\"path\", _extends({\n    parentName: \"svg\"\n  }, {\n    \"d\": \"M10.879 6.05L15 1.93A5.001 5.001 0 0 1 22.071 9l-4.121 4.121a1 1 0 0 1-1.414-1.414l4.12-4.121a3 3 0 1 0-4.242-4.243l-4.121 4.121a1 1 0 1 1-1.414-1.414zm2.242 11.9L9 22.07A5 5 0 1 1 1.929 15l4.121-4.121a1 1 0 0 1 1.414 1.414l-4.12 4.121a3 3 0 1 0 4.242 4.243l4.121-4.121a1 1 0 1 1 1.414 1.414zm-8.364-.122l13.071-13.07a1 1 0 0 1 1.415 1.414L6.172 19.242a1 1 0 1 1-1.415-1.414z\",\n    \"fill\": \"currentColor\"\n  })))), \"Context\"), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, \"{: #raven.context.Context}\", mdx(\"em\", {\n    parentName: \"dt\"\n  }, \"class\"), \" \", mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"raven.context.``Context\")), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"The context object works similar to a dictionary and is used to record information that should be submitted with events automatically. It is available through \", mdx(\"a\", _extends({\n    parentName: \"dd\"\n  }, {\n    \"href\": \"#raven.Client.context\",\n    \"title\": \"raven.Client.context\"\n  }), mdx(\"inlineCode\", {\n    parentName: \"a\"\n  }, \"raven.Client.context\")), \" and is thread local. This means that you can modify this object over time to feed it with more appropriate information.\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, \"{: #raven.context.Context.activate}\", mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"activate\"), \"()\"), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"Binds the context to the current thread. This normally happens automatically on first usage but if the context was deactivated then this needs to be called again to bind it again. Only if a context is bound to the thread breadcrumbs will be recorded.\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, \"{: #raven.context.Context.deactivate}\", mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"deactivate\"), \"()\"), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"This deactivates the thread binding of the context. In particular it means that breadcrumbs of the current thread are no longer recorded to this context.\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, \"{: #raven.context.Context.merge}\", mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"merge\"), \"(\", mdx(\"em\", {\n    parentName: \"dt\"\n  }, \"data\"), \", \", mdx(\"em\", {\n    parentName: \"dt\"\n  }, \"activate=True\"), \")\"), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"Performs a merge of the current data in the context and the new data provided. This also automatically activates the context by default.\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, \"{: #raven.context.Context.clear}\", mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"clear\"), \"(\", mdx(\"em\", {\n    parentName: \"dt\"\n  }, \"deactivate=None\"), \")\"), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"Clears the context. It\\u2019s important that you make sure to call this when you reuse the thread for something else. For instance for web frameworks it\\u2019s generally a good idea to call this at the end of the HTTP request.\"))), mdx(\"div\", {\n    \"className\": \"code-tabs-wrapper\"\n  }, mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"text\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-text\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-text\"\n  }), \"Otherwise you run at risk of seeing incorrect information after the first use of the thread.\\n\\nOptionally _deactivate_ parameter controls if the context should automatically be deactivated. The default behavior is to deactivate if the context was not created for the main thread.\")))))), mdx(\"p\", null, \"The context can also be used as a context manager. In that case \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"#raven.context.Context.activate\",\n    \"title\": \"raven.context.Context.activate\"\n  }), mdx(\"inlineCode\", {\n    parentName: \"a\"\n  }, \"activate()\")), \" is called on enter and \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"#raven.context.Context.deactivate\",\n    \"title\": \"raven.context.Context.deactivate\"\n  }), mdx(\"inlineCode\", {\n    parentName: \"a\"\n  }, \"deactivate()\")), \" is called on exit.\"));\n}\n;\nMDXContent.isMDXComponent = true;","tableOfContents":{"items":[{"url":"#client","title":"Client"},{"url":"#context","title":"Context"}]},"internal":{"type":"Mdx"}}}},"pageContext":{"excerpt":"This gives you an overview of the public API that raven-python exposes. Client {: #raven.Client} class   raven.``Client ( dsn=None ,  * * kwargs ) : The client needs to be instantiated once and can then be used for submitting events to the Sentry server. For information about the configuration of that client and which parameters are accepted see  Configuring the Client . {: #raven.Client.capture} capture ( event_type ,  data=None ,  date=None ,  time_spent=None ,  extra=None ,  stack=False ,  tags=None ,  * * kwargs ) : This method is the low-level method for reporting events to Sentry. It captures and processes an event and pipes it via the configured transport to Sentry. {: #raven.Client.captureMessage} captureMessage ( message ,  * * kwargs ) : This is a shorthand to reporting a message via  capture() . It passes  'raven.events.Message'  as  event_type  and the message along. All other keyword arguments are regularly forwarded. {: #raven.Client.captureException} captureException ( exc_info=None ,  * * kwargs ) : This is a shorthand to reporting an exception via  capture() . It passes  'raven.events.Exception'  as  event_type  and the traceback along. All other keyword arguments are regularly forwarded. captureBreadcrumb(message=None, timestamp=None, \n level=None, category=None, data=None, \n type=None, processor=None) : Manually captures a breadcrumb in the internal buffer for the current client’s context. Instead of using this method you are encouraged to instead use the  raven.breadcrumbs.record()  function which records to the correct client automatically. {: #raven.Client.send} send ( * * data ) : Accepts all data parameters and serializes them, then sends then onwards via the transport to Sentry. This can be used as to send low-level protocol data to the server. {: #raven.Client.context} context : Returns a reference to the thread local context object. See  raven.context.Context  for more information. {: #raven.Client.user context} user_context ( _ data ) : Updates the user context for future events. {: #raven.Client.http context} http_context ( _ data ) : Updates the HTTP context for future events. {: #raven.Client.extra context} extra_context ( _ data ) : Update the extra context for future events. {: #raven.Client.tags context} tags_context ( _ data ) : Update the tags context for future events. Context {: #raven.context.Context} class   raven.context.``Context : The context object works similar to a dictionary and is used to record information that should be submitted with events automatically. It is available through  raven.Client.context  and is thread local. This means that you can modify this object over time to feed it with more appropriate information. {: #raven.context.Context.activate} activate () : Binds the context to the current thread. This normally happens automatically on first usage but if the context was deactivated then this needs to be called again to bind it again. Only if a context is bound to the thread breadcrumbs will be recorded. {: #raven.context.Context.deactivate} deactivate () : This deactivates the thread binding of the context. In particular it means that breadcrumbs of the current thread are no longer recorded to this context. {: #raven.context.Context.merge} merge ( data ,  activate=True ) : Performs a merge of the current data in the context and the new data provided. This also automatically activates the context by default. {: #raven.context.Context.clear} clear ( deactivate=None ) : Clears the context. It’s important that you make sure to call this when you reuse the thread for something else. For instance for web frameworks it’s generally a good idea to call this at the end of the HTTP request. The context can also be used as a context manager. In that case  activate()  is called on enter and  deactivate()  is called on exit.","title":"API Reference","description":null,"draft":false,"noindex":true,"notoc":null,"sidebar_order":null,"redirect_from":null,"keywords":null,"id":"83fcd615-bd44-5735-b98d-65d4b1598a5c","legacy":true}},"staticQueryHashes":["1218203755","1222113826","1222113826","1766336459","2158593473","2764967025","3345802723","3818502851","3990806462","4015007367","4192517163","4264099332","518019976"]}