-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
refactor: metrics instrumentation framework typing and structure #12717
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
Open
vittoriopolverino
wants to merge
14
commits into
master
Choose a base branch
from
DAT-159-refactor-metrics-instrumentation-framework-typing-and-structure
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+432
−401
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6fddafa
refactor: move and rename the base counter class in counter.py module
vittoriopolverino 06ea75e<
8000
/code>
refactor: move and the Counter factory class in factory.py module
vittoriopolverino Jun 4, 2025
2deda13
refactor: move publish_metrics in hooks.py module
vittoriopolverino 859c279
refactor: move abstract classes in interfaces.py module
vittoriopolverino 5064c94
refactor: move MetricRegistry in registry.py module
vittoriopolverino b241a63
refactor: move dataclasses/payloads in types.py module
vittoriopolverino 75de035
refactor: organize public export in __init__.py
vittoriopolverino 1267c95
chore: rename modules
vittoriopolverino 3f2c2d6
refactor: remove factory class and interfaces for counter and labeled…
vittoriopolverino a63594e
refactor: adapt test to the changes in the analytics.metrics module
vittoriopolverino 7060400
refactor: update counter definitions
vittoriopolverino 7410828
release version 4.5.0
localstack-bot cb3585a
prepare next development iteration
localstack-bot 2244fc6
refactor: rename module from hook to publisher
vittoriopolverino File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from localstack.utils.analytics.metrics import Counter | ||
from localstack.utils.analytics.metrics import LabeledCounter | ||
|
||
invocation_counter = Counter( | ||
invocation_counter = LabeledCounter( | ||
namespace="apigateway", name="rest_api_execute", labels=["invocation_type"] | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...calstack/services/cloudformation/usage.py → ...tack/services/cloudformation/analytics.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
from localstack.utils.analytics.metrics import Counter | ||
from localstack.utils.analytics.metrics import LabeledCounter | ||
|
||
COUNTER_NAMESPACE = "cloudformation" | ||
|
||
resources = Counter( | ||
resources = LabeledCounter( | ||
namespace=COUNTER_NAMESPACE, name="resources", labels=["resource_type", "missing"] | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
import logging | ||
from typing import Final | ||
|
||
import localstack.services.stepfunctions.usage as UsageMetrics | ||
import localstack.services.stepfunctions.analytics as UsageMetrics | ||
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. nit: I know this was already the case, but the casing of the import is a bit strange here. Would it make sense to just import |
||
from localstack.services.stepfunctions.asl.antlr.runtime.ASLParser import ASLParser | ||
from localstack.services.stepfunctions.asl.component.common.query_language import ( | ||
QueryLanguageMode, | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: Since you renamed the module from analytics to usage, would it make sense to also change the name here, i.e. avoid the
as usage
?Uh oh!
There was an error while loading. Please reload this page.
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.
Absolutely, that makes total sense. I initially avoided it out of caution, in case I missed some spots during the renaming 😄
I'll do it