8000 Add EventBridge rule target analytics (#11884) · localstack/localstack@ad1af78 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

< 8000 div class="position-relative HeaderMenu-link-wrap d-lg-inline-block">
Appearance settings

Commit ad1af78

Browse files
authored
Add EventBridge rule target analytics (#11884)
1 parent 0fc17fb commit ad1af78

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

localstack-core/localstack/services/events/provider.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@
145145
TargetSenderDict,
146146
TargetSenderFactory,
147147
)
148+
from localstack.services.events.usage import rule_error, rule_invocation
148149
from localstack.services.events.utils import (
149150
extract_event_bus_name,
150151
extract_region_and_account_id,
@@ -1334,7 +1335,6 @@ def put_events(
13341335
f"1 validation error detected: Value '{formatted_entries}' at 'entries' failed to satisfy constraint: Member must have length less than or equal to 10"
13351336
)
13361337
entries, failed_entry_count = self._process_entries(context, entries)
1337-
13381338
response = PutEventsResponse(
13391339
Entries=entries,
13401340
FailedEntryCount=failed_entry_count,
@@ -2035,7 +2035,9 @@ def _process_rules(
20352035
try:
20362036
target_sender.process_event(event_formatted.copy())
20372037
processed_entries.append({"EventId": event_formatted["id"]})
2038+
926E rule_invocation.record(target_sender.service)
20382039
except Exception as error:
2040+
rule_error.record(target_sender.service)
20392041
processed_entries.append(
20402042
{
20412043
"ErrorCode": "InternalException",
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from localstack.utils.analytics.usage import UsageSetCounter
2+
3+
# number of pipe invocations per source (e.g. aws:sqs, aws:kafka, SelfManagedKafka) and target (e.g., aws:lambda)
4+
rule_invocation = UsageSetCounter("events:rule:invocation")
5+
6+
# number of pipe errors per source (e.g. aws:sqs, aws:kafka, SelfManagedKafka) and target (e.g., aws:lambda)
7+
rule_error = UsageSetCounter("events:rule:error")

0 commit comments

Comments
 (0)
0