-
-
Notifications
You must be signed in to change notification settings - Fork 468
Expand file tree
/
Copy pathEventProcessor.java
More file actions
80 lines (72 loc) · 2.07 KB
/
EventProcessor.java
File metadata and controls
80 lines (72 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package io.sentry;
import io.sentry.protocol.SentryTransaction;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* An Event Processor that may mutate or drop an event. Runs for SentryEvent or SentryTransaction
*/
public interface EventProcessor {
/**
* May mutate or drop a SentryEvent
*
* @param event the SentryEvent
* @param hint the Hint
* @return the event itself, a mutated SentryEvent or null
*/
@Nullable
default SentryEvent process(@NotNull SentryEvent event, @NotNull Hint hint) {
return event;
}
/**
* May mutate or drop a SentryTransaction
*
* @param transaction the SentryTransaction
* @param hint the Hint
* @return the event itself, a mutated SentryTransaction or null
*/
@Nullable
default SentryTransaction process(@NotNull SentryTransaction transaction, @NotNull Hint hint) {
return transaction;
}
/**
* May mutate or drop a SentryEvent
*
* @param event the SentryEvent
* @param hint the Hint
* @return the event itself, a mutated SentryEvent or null
*/
@Nullable
default SentryReplayEvent process(@NotNull SentryReplayEvent event, @NotNull Hint hint) {
return event;
}
/**
* May mutate or drop a SentryLogEvent
*
* @param event the SentryLogEvent
* @return the event itself, a mutated SentryLogEvent or null
*/
@Nullable
default SentryLogEvent process(@NotNull SentryLogEvent event) {
return event;
}
/**
* May mutate or drop a SentryMetricsEvent
*
* @param event the SentryMetricsEvent
* @return the event itself, a mutated SentryMetricsEvent or null
*/
@Nullable
default SentryMetricsEvent process(@NotNull SentryMetricsEvent event, @NotNull Hint hint) {
return event;
}
/**
* Controls when this EventProcessor is invoked.
*
* @return order higher number = later, lower number = earlier (negative values may also be
* passed), null = latest (note: multiple event processors using null may lead to random
* ordering)
*/
default @Nullable Long getOrder() {
return null;
}
}