10000 Add EventBridge rule target analytics by joe4dev · Pull Request #11884 · localstack/localstack · GitHub
[go: up one dir, main page]

Skip to content
< 8000 div id="partial-discussion-header" class="gh-header mb-3 js-details-container Details js-socket-channel js-updatable-content pull request js-pull-header-details" data-channel="eyJjIjoicHVsbF9yZXF1ZXN0OjIxOTA0MDk4NTciLCJ0IjoxNzUwNTMxMDE5fQ==--1885d994f0d6b165510ee6d1a5bbaafa25c916285a2f209ba27678523c843907" data-url="/localstack/localstack/pull/11884/partials/title?sticky=false" data-channel-event-name="title_updated" data-pull-is-open="false" data-gid="PR_kwDOBEnY0s6CjwCB">

Add EventBridge rule target analytics #11884

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion localstack-core/localstack/services/events/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
TargetSenderDict,
TargetSenderFactory,
)
from localstack.services.events.usage import rule_error, rule_invocation
from localstack.services.events.utils import (
extract_event_bus_name,
extract_region_and_account_id,
Expand Down Expand Up @@ -1334,7 +1335,6 @@ def put_events(
f"1 validation error detected: Value '{formatted_entries}' at 'entries' failed to satisfy constraint: Member must have length less than or equal to 10"
)
entries, failed_entry_count = self._process_entries(context, entries)

response = PutEventsResponse(
Entries=entries,
FailedEntryCount=failed_entry_count,
Expand Down Expand Up @@ -2035,7 +2035,9 @@ def _process_rules(
try:
target_sender.process_event(event_formatted.copy())
processed_entries.append({"EventId": event_formatted["id"]})
rule_invocation.record(target_sender.service)
except Exception as error:
rule_error.record(target_sender.service)
processed_entries.append(
{
8A78 "ErrorCode": "InternalException",
Expand Down
7 changes: 7 additions & 0 deletions localstack-core/localstack/services/events/usage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from localstack.utils.analytics.usage import UsageSetCounter

# number of pipe invocations per source (e.g. aws:sqs, aws:kafka, SelfManagedKafka) and target (e.g., aws:lambda)
rule_invocation = UsageSetCounter("events:rule:invocation")

# number of pipe errors per source (e.g. aws:sqs, aws:kafka, SelfManagedKafka) and target (e.g., aws:lambda)
rule_error = UsageSetCounter("events:rule:error")
Loading
0