Expand description
This crate provides the core of the Sentry SDK, which can be used to log events and errors.
This crate is meant for integration authors and third party library authors that want to instrument their code for sentry.
Regular users who wish to integrate sentry into their applications should
rather use the sentry crate, which comes with a default transport, and
a large set of integrations for various third-party libraries.
§Core Concepts
This crate follows the Unified API guidelines and is centered around
the concepts of Client, Hub and Scope, as well as the extension
points via the Integration, Transport and TransportFactory traits.
§Minimal API
By default, this crate comes with a so-called “minimal” mode. This mode will provide all the APIs needed to instrument code with sentry, and to write sentry integrations, but it will blackhole a lot of operations.
In minimal mode some types are restricted in functionality. For instance
the Client is not available and the Hub does not retain all API
functionality.
§Features
feature = "client": Activates theClienttype and certainHubfunctionality.feature = "test": Activates thetestmodule, which can be used to write integration tests. It comes with a test transport which can capture all sent events for inspection.feature = "debug-logs": Uses thelogcrate for debug output, instead of printing tostderr. This feature is deprecated and will be replaced by a dedicated log callback in the future.
Modules§
- protocol
- The current latest sentry protocol version.
- test
- This provides testing functionality for building tests.
- types
- This crate provides common types for working with the Sentry protocol or the Sentry server. It’s used by the Sentry Relay infrastructure as well as the rust Sentry client.
Macros§
- release_
name - Returns the intended release for Sentry as an
Option<Cow<'static, str>>.
Structs§
- Breadcrumb
- Represents a single breadcrumb.
- Client
- The Sentry Client.
- Client
Options - Configuration settings for the client.
- Envelope
- A Sentry Envelope.
- Hub
- The central object that can manages scopes and clients.
- Scope
- Holds contextual data for the current scope.
- Scope
Guard - A scope guard.
- Sentry
Future - A future that binds a
Hubto its execution. - User
- Represents user info.
Enums§
- Level
- Represents the level of severity of an event or breadcrumb.
Traits§
- Integration
- Integration abstraction.
- Into
Breadcrumbs - A helper trait that converts self into an Iterator of Breadcrumbs.
- IntoDsn
- Helper trait to convert a string into an
Option<Dsn>. - Sentry
Future Ext - Future extensions for Sentry.
- Transport
- The trait for transports.
- Transport
Factory - A factory creating transport instances.
Functions§
- add_
breadcrumb - Records a breadcrumb by calling a function.
- capture_
error - Captures a
std::error::Error. - capture_
event - Captures an event on the currently active client if any.
- capture_
message - Captures an arbitrary message.
- configure_
scope - Invokes a function that can modify the current scope.
- end_
session - End the current Release Health Session.
- end_
session_ with_ status - End the current Release Health Session with the given
SessionStatus. - event_
from_ error - Create a sentry
Eventfrom astd::error::Error. - last_
event_ id - Returns the last event ID captured.
- parse_
type_ from_ debug - Parse the types name from
Debugoutput. - start_
session - Start a new session for Release Health.
- with_
integration - Looks up an integration on the current Hub.
- with_
scope - Temporarily pushes a scope for a single call optionally reconfiguring it.