relay_event_schema::protocol

Struct Event

source
pub struct Event {
Show 50 fields pub id: Annotated<EventId>, pub level: Annotated<Level>, pub version: Annotated<String>, pub ty: Annotated<EventType>, pub fingerprint: Annotated<Fingerprint>, pub culprit: Annotated<String>, pub transaction: Annotated<String>, pub transaction_info: Annotated<TransactionInfo>, pub time_spent: Annotated<u64>, pub logentry: Annotated<LogEntry>, pub logger: Annotated<String>, pub modules: Annotated<Object<String>>, pub platform: Annotated<String>, pub timestamp: Annotated<Timestamp>, pub start_timestamp: Annotated<Timestamp>, pub received: Annotated<Timestamp>, pub server_name: Annotated<String>, pub release: Annotated<LenientString>, pub dist: Annotated<String>, pub environment: Annotated<String>, pub site: Annotated<String>, pub user: Annotated<User>, pub request: Annotated<Request>, pub contexts: Annotated<Contexts>, pub breadcrumbs: Annotated<Values<Breadcrumb>>, pub exceptions: Annotated<Values<Exception>>, pub stacktrace: Annotated<Stacktrace>, pub template: Annotated<TemplateInfo>, pub threads: Annotated<Values<Thread>>, pub tags: Annotated<Tags>, pub extra: Annotated<Object<ExtraValue>>, pub debug_meta: Annotated<DebugMeta>, pub client_sdk: Annotated<ClientSdkInfo>, pub ingest_path: Annotated<Array<RelayInfo>>, pub errors: Annotated<Array<EventProcessingError>>, pub key_id: Annotated<String>, pub project: Annotated<u64>, pub grouping_config: Annotated<Object<Value>>, pub checksum: Annotated<String>, pub csp: Annotated<Csp>, pub hpkp: Annotated<Hpkp>, pub expectct: Annotated<ExpectCt>, pub expectstaple: Annotated<ExpectStaple>, pub spans: Annotated<Array<Span>>, pub measurements: Annotated<Measurements>, pub breakdowns: Annotated<Breakdowns>, pub scraping_attempts: Annotated<Value>, pub _metrics: Annotated<Metrics>, pub _dsc: Annotated<Value>, pub other: Object<Value>,
}
Expand description

The sentry v7 event structure.

Fields§

§id: Annotated<EventId>

Unique identifier of this event.

Hexadecimal string representing a uuid4 value. The length is exactly 32 characters. Dashes are not allowed. Has to be lowercase.

Even though this field is backfilled on the server with a new uuid4, it is strongly recommended to generate that uuid4 clientside. There are some features like user feedback which are easier to implement that way, and debugging in case events get lost in your Sentry installation is also easier.

Example:

{
  "event_id": "fc6d8c0c43fc4630ad850ee518f1b9d0"
}
§level: Annotated<Level>

Severity level of the event. Defaults to error.

Example:

{"level": "warning"}
§version: Annotated<String>

Version

§ty: Annotated<EventType>

Type of the event. Defaults to default.

The event type determines how Sentry handles the event and has an impact on processing, rate limiting, and quotas. There are three fundamental classes of event types:

  • Error monitoring events: Processed and grouped into unique issues based on their exception stack traces and error messages.
  • Security events: Derived from Browser security violation reports and grouped into unique issues based on the endpoint and violation. SDKs do not send such events.
  • Transaction events (transaction): Contain operation spans and collected into traces for performance monitoring.

Transactions must explicitly specify the "transaction" event type. In all other cases, Sentry infers the appropriate event type from the payload and overrides the stated type. SDKs should not send an event type other than for transactions.

Example:

{
  "type": "transaction",
  "spans": []
}
§fingerprint: Annotated<Fingerprint>

Manual fingerprint override.

A list of strings used to dictate how this event is supposed to be grouped with other events into issues. For more information about overriding grouping see Customize Grouping with Fingerprints.

{
    "fingerprint": ["myrpc", "POST", "/foo.bar"]
}
§culprit: Annotated<String>

Custom culprit of the event.

This field is deprecated and shall not be set by client SDKs.

§transaction: Annotated<String>

Transaction name of the event.

For example, in a web app, this might be the route name ("/users/<username>/" or UserView), in a task queue it might be the function + module name.

§transaction_info: Annotated<TransactionInfo>

Additional information about the name of the transaction.

§time_spent: Annotated<u64>

Time since the start of the transaction until the error occurred.

§logentry: Annotated<LogEntry>

Custom parameterized message for this event.

§logger: Annotated<String>

Logger that created the event.

§modules: Annotated<Object<String>>

Name and versions of all installed modules/packages/dependencies in the current environment/application.

{ "django": "3.0.0", "celery": "4.2.1" }

In Python this is a list of installed packages as reported by pkg_resources together with their reported version string.

This is primarily used for suggesting to enable certain SDK integrations from within the UI and for making informed decisions on which frameworks to support in future development efforts.

§platform: Annotated<String>

Platform identifier of this event (defaults to “other”).

A string representing the platform the SDK is submitting from. This will be used by the Sentry interface to customize various components in the interface, but also to enter or skip stacktrace processing.

Acceptable values are: as3, c, cfml, cocoa, csharp, elixir, haskell, go, groovy, java, javascript, native, node, objc, other, perl, php, python, ruby

§timestamp: Annotated<Timestamp>

Timestamp when the event was created.

Indicates when the event was created in the Sentry SDK. The format is either a string as defined in RFC 3339 or a numeric (integer or float) value representing the number of seconds that have elapsed since the Unix epoch.

Timezone is assumed to be UTC if missing.

Sub-microsecond precision is not preserved with numeric values due to precision limitations with floats (at least in our systems). With that caveat in mind, just send whatever is easiest to produce.

All timestamps in the event protocol are formatted this way.

§Example

All of these are the same date:

{ "timestamp": "2011-05-02T17:41:36Z" }
{ "timestamp": "2011-05-02T17:41:36" }
{ "timestamp": "2011-05-02T17:41:36.000" }
{ "timestamp": 1304358096.0 }
§start_timestamp: Annotated<Timestamp>

Timestamp when the event has started (relevant for event type = “transaction”)

§received: Annotated<Timestamp>

Timestamp when the event has been received by Sentry.

§server_name: Annotated<String>

Server or device name the event was generated on.

This is supposed to be a hostname.

§release: Annotated<LenientString>

The release version of the application.

Release versions must be unique across all projects in your organization. This value can be the git SHA for the given project, or a product identifier with a semantic version.

§dist: Annotated<String>

Program’s distribution identifier.

The distribution of the application.

Distributions are used to disambiguate build or deployment variants of the same release of an application. For example, the dist can be the build number of an XCode build or the version code of an Android build.

§environment: Annotated<String>

The environment name, such as production or staging.

{ "environment": "production" }
§site: Annotated<String>

Deprecated in favor of tags.

§user: Annotated<User>

Information about the user who triggered this event.

§request: Annotated<Request>

Information about a web request that occurred during the event.

§contexts: Annotated<Contexts>

Contexts describing the environment (e.g. device, os or browser).

§breadcrumbs: Annotated<Values<Breadcrumb>>

List of breadcrumbs recorded before this event.

§exceptions: Annotated<Values<Exception>>

One or multiple chained (nested) exceptions.

§stacktrace: Annotated<Stacktrace>

Event stacktrace.

DEPRECATED: Prefer threads or exception depending on which is more appropriate.

§template: Annotated<TemplateInfo>

Simplified template error location information. DEPRECATED: Non-Raven clients are not supposed to send this anymore, but rather just report synthetic frames.

§threads: Annotated<Values<Thread>>

Threads that were active when the event occurred.

§tags: Annotated<Tags>

Custom tags for this event.

A map or list of tags for this event. Each tag must be less than 200 characters.

§extra: Annotated<Object<ExtraValue>>

Arbitrary extra information set by the user.

{
    "extra": {
        "my_key": 1,
        "some_other_value": "foo bar"
    }
}```
§debug_meta: Annotated<DebugMeta>

Meta data for event processing and debugging.

§client_sdk: Annotated<ClientSdkInfo>

Information about the Sentry SDK that generated this event.

§ingest_path: Annotated<Array<RelayInfo>>

Information about the Relays that processed this event during ingest.

§errors: Annotated<Array<EventProcessingError>>

Errors encountered during processing. Intended to be phased out in favor of annotation/metadata system.

§key_id: Annotated<String>

Project key which sent this event.

§project: Annotated<u64>

Project which sent this event.

§grouping_config: Annotated<Object<Value>>

The grouping configuration for this event.

§checksum: Annotated<String>

Legacy checksum used for grouping before fingerprint hashes.

§csp: Annotated<Csp>

CSP (security) reports.

§hpkp: Annotated<Hpkp>

HPKP (security) reports.

§expectct: Annotated<ExpectCt>

ExpectCT (security) reports.

§expectstaple: Annotated<ExpectStaple>

ExpectStaple (security) reports.

§spans: Annotated<Array<Span>>

Spans for tracing.

§measurements: Annotated<Measurements>

Measurements which holds observed values such as web vitals.

Measurements are only available on transactions. They contain measurement values of observed values such as Largest Contentful Paint (LCP).

§breakdowns: Annotated<Breakdowns>

Breakdowns which holds product-defined values such as span operation breakdowns.

§scraping_attempts: Annotated<Value>

Information about attempts to scrape a JS source or sourcemap file from the web. This field is populated by sentry.

§_metrics: Annotated<Metrics>

Internal ingestion and processing metrics.

This value should not be ingested and will be overwritten by the store normalizer.

§_dsc: Annotated<Value>

Value of the DynamicSamplingContext for this event.

§other: Object<Value>

Additional arbitrary fields for forwards compatibility.

Implementations§

source§

impl Event

source

pub fn tag_value(&self, tag_key: &str) -> Option<&str>

Returns the value of a tag with the given key.

If tags are specified in a pair list and the tag is declared multiple times, this function returns the first match.

source

pub fn has_module(&self, module_name: &str) -> bool

Returns true if modules contains the given module.

source

pub fn sdk_name(&self) -> &str

Returns the identifier of the client SDK if available.

Sentry’s own SDKs use a naming schema prefixed with sentry.. Defaults to "unknown".

source

pub fn sdk_version(&self) -> &str

Returns the version of the client SDK if available.

Defaults to "unknown".

source

pub fn user_agent(&self) -> Option<&str>

Returns the raw user agent string.

Returns Some if the event’s request interface contains a user-agent header. Returns None otherwise.

source

pub fn extra_at(&self, path: &str) -> Option<&Value>

Returns extra data at the specified path.

The path is evaluated recursively where each path component is joined by a period ("."). Periods in extra keys are not supported.

source

pub fn parse_release(&self) -> Option<ParsedRelease<'_>>

Returns parsed components of the Release string in Self::release.

source

pub fn measurement(&self, name: &str) -> Option<f64>

Returns the numeric measurement value.

The name is provided without a prefix, for example "lcp" loads event.measurements.lcp.

source

pub fn breakdown(&self, breakdown: &str, measurement: &str) -> Option<f64>

Returns the numeric breakdown value.

source

pub fn context<C: DefaultContext>(&self) -> Option<&C>

Returns a reference to the context if it exists in its default key.

source

pub fn context_mut<C: DefaultContext>(&mut self) -> Option<&mut C>

Returns a mutable reference to the context if it exists in its default key.

Trait Implementations§

source§

impl Clone for Event

source§

fn clone(&self) -> Event

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Event

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Event

source§

fn default() -> Event

Returns the “default value” for a type. Read more
source§

impl Empty for Event

source§

fn is_empty(&self) -> bool

Returns whether this value is empty.
source§

fn is_deep_empty(&self) -> bool

Returns whether this value is empty or all of its descendants are empty. Read more
source§

impl From<&Event> for Span

source§

fn from(event: &Event) -> Self

Converts to this type from the input type.
source§

impl FromValue for Event

source§

fn from_value(__value: Annotated<Value>) -> Annotated<Self>

Creates a meta structure from an annotated boxed value.
source§

impl Getter for Event

source§

fn get_value(&self, path: &str) -> Option<Val<'_>>

Returns the serialized value of a field pointed to by a path.
source§

fn get_iter(&self, path: &str) -> Option<GetterIter<'_>>

Returns an iterator over the array pointed to by a path. Read more
source§

impl IntoValue for Event

source§

fn into_value(self) -> Value

Boxes the meta structure back into a value.
source§

fn serialize_payload<S>( &self, __serializer: S, __behavior: SkipSerialization, ) -> Result<S::Ok, S::Error>
where Self: Sized, S: Serializer,

Efficiently serializes the payload directly.
source§

fn extract_child_meta(&self) -> MetaMap
where Self: Sized,

Extracts children meta map out of a value.
§

fn extract_meta_tree(value: &Annotated<Self>) -> MetaTree
where Self: Sized,

Extracts the meta tree out of annotated value. Read more
source§

impl PartialEq for Event

source§

fn eq(&self, other: &Event) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl ProcessValue for Event

source§

fn value_type(&self) -> EnumSet<ValueType>

Returns the type of the value.
source§

fn process_value<P>( &mut self, __meta: &mut Meta, __processor: &mut P, __state: &ProcessingState<'_>, ) -> ProcessingResult
where P: Processor,

Executes a processor on this value.
source§

fn process_child_values<P>( &mut self, __processor: &mut P, __state: &ProcessingState<'_>, ) -> ProcessingResult
where P: Processor,

Recurses into children of this value.
source§

impl StructuralPartialEq for Event

Auto Trait Implementations§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T