Struct relay_event_schema::protocol::Event
source · pub struct Event {Show 51 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 _metrics_summary: Annotated<MetricsSummary>,
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).
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.
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.
_metrics_summary: Annotated<MetricsSummary>
Temporary protocol support for metric summaries.
This shall move to a stable location once we have stabilized the interface. This is intentionally not typed today.
_dsc: Annotated<Value>
Value of the DynamicSamplingContext
for this event.
other: Object<Value>
Additional arbitrary fields for forwards compatibility.
Implementations§
source§impl Event
impl Event
sourcepub fn tag_value(&self, tag_key: &str) -> Option<&str>
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.
sourcepub fn has_module(&self, module_name: &str) -> bool
pub fn has_module(&self, module_name: &str) -> bool
Returns true
if modules
contains the given module.
sourcepub fn sdk_name(&self) -> &str
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"
.
sourcepub fn sdk_version(&self) -> &str
pub fn sdk_version(&self) -> &str
Returns the version of the client SDK if available.
Defaults to "unknown"
.
sourcepub fn user_agent(&self) -> Option<&str>
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.
sourcepub fn extra_at(&self, path: &str) -> Option<&Value>
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.
sourcepub fn parse_release(&self) -> Option<ParsedRelease<'_>>
pub fn parse_release(&self) -> Option<ParsedRelease<'_>>
Returns parsed components of the Release string in Self::release
.
sourcepub fn measurement(&self, name: &str) -> Option<f64>
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
.
sourcepub fn breakdown(&self, breakdown: &str, measurement: &str) -> Option<f64>
pub fn breakdown(&self, breakdown: &str, measurement: &str) -> Option<f64>
Returns the numeric breakdown value.
sourcepub fn context<C: DefaultContext>(&self) -> Option<&C>
pub fn context<C: DefaultContext>(&self) -> Option<&C>
Returns a reference to the context if it exists in its default key.
sourcepub fn context_mut<C: DefaultContext>(&mut self) -> Option<&mut C>
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 FromValue for Event
impl FromValue for Event
source§fn from_value(__value: Annotated<Value>) -> Annotated<Self>
fn from_value(__value: Annotated<Value>) -> Annotated<Self>
source§impl IntoValue for Event
impl IntoValue for Event
source§fn into_value(self) -> Value
fn into_value(self) -> Value
source§fn serialize_payload<S>(
&self,
__serializer: S,
__behavior: SkipSerialization,
) -> Result<S::Ok, S::Error>where
Self: Sized,
S: Serializer,
fn serialize_payload<S>(
&self,
__serializer: S,
__behavior: SkipSerialization,
) -> Result<S::Ok, S::Error>where
Self: Sized,
S: Serializer,
source§fn extract_child_meta(&self) -> MetaMapwhere
Self: Sized,
fn extract_child_meta(&self) -> MetaMapwhere
Self: Sized,
§fn extract_meta_tree(value: &Annotated<Self>) -> MetaTreewhere
Self: Sized,
fn extract_meta_tree(value: &Annotated<Self>) -> MetaTreewhere
Self: Sized,
source§impl ProcessValue for Event
impl ProcessValue for Event
source§fn value_type(&self) -> EnumSet<ValueType>
fn value_type(&self) -> EnumSet<ValueType>
source§fn process_value<P>(
&mut self,
__meta: &mut Meta,
__processor: &mut P,
__state: &ProcessingState<'_>,
) -> ProcessingResultwhere
P: Processor,
fn process_value<P>(
&mut self,
__meta: &mut Meta,
__processor: &mut P,
__state: &ProcessingState<'_>,
) -> ProcessingResultwhere
P: Processor,
source§fn process_child_values<P>(
&mut self,
__processor: &mut P,
__state: &ProcessingState<'_>,
) -> ProcessingResultwhere
P: Processor,
fn process_child_values<P>(
&mut self,
__processor: &mut P,
__state: &ProcessingState<'_>,
) -> ProcessingResultwhere
P: Processor,
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)