-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
[WIP] Step Functions: Telemetry #12581
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,6 +85,7 @@ | |
"OUTBOUND_HTTP_PROXY", | ||
"OUTBOUND_HTTPS_PROXY", | ||
"S3_DIR", | ||
"SFN_MOCK_CONFIG", | ||
"TMPDIR", | ||
] | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
import time | ||
from typing import Final, Optional | ||
|
||
import localstack.services.stepfunctions.usage as UsageMetrics | ||
from localstack.aws.api import CommonServiceException, RequestContext | ||
from localstack.aws.api.stepfunctions import ( | ||
ActivityDoesNotExist, | ||
|
@@ -789,6 +790,10 @@ def start_execution( | |
state_machine_arn_parts[1] if len(state_machine_arn_parts) == 2 else None | ||
) | ||
|
||
# Count metrics about the execution type. | ||
is_mock_test_case: bool = mock_test_case_name is not None | ||
UsageMetrics.execution_type_counter.labels(is_mock_test_case=is_mock_test_case).increment() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: Is this the right place to increment the counter given we could raise multiple exceptions following this counter (e.g., There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: Are we missing other entry points, such as |
||
|
||
store = self.get_store(context=context) | ||
|
||
alias: Optional[Alias] = store.aliases.get(state_machine_arn) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,8 @@ | |
name="language_features_used", | ||
labels=["query_language", "uses_variables"], | ||
) | ||
|
||
# Initialize a counter to record the use of each execution type. | ||
execution_type_counter = Counter( | ||
namespace="stepfunctions", name="execution_type", labels=["is_mock_test_case"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. naming: Isn't There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion/idea: Following the Lambda example in execution_counter = Counter(
namespace="stepfunctions"
name="execution",
labels=[
"is_mock_test_case",
"workflow_type", # standard | express
"invocation_type", # async | sync
],
) Is it worthwhile (i.e., can we derive something actionable) from capturing more metadata linked to executions? sidenote: The dimension There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is your recommendation/guidance from the data side @vittoriopolverino, especially regarding the trade-off: counters for features/parameters (e.g., JSONata, is_mock_test_case, workflow_type, invocation_type) vs. for operations (e.g., execute, create) with features as labels? |
||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think the new standard name is
analytics.py
(following the Notion guide and samples in API Gateway, Lambda, etc)