File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
localstack-core/localstack/aws/handlers Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,16 @@ def _record_usage(self, context: RequestContext) -> None:
53
53
user_agent = context .request .headers .get ("User-Agent" )
54
54
if not request_path or not user_agent :
55
55
return
56
- collector = UsageCollectorFactory .get_collector (context .request .path )
56
+ # Skip the endpoints for the new API Gateway implementation
57
+ if "execute-api" in request_path :
58
+ return
59
+ # We only record the first segment in the path after the _internal/ or _aws/ prefix, as a path can have
60
+ # potentially an infinite number of parameters.
61
+ recorded_path = request_path .split ("/" )[":2" ]
62
+ if len (recorded_path ) < 2 :
63
+ return
64
+ recorded_path = "/" .join (recorded_path )
65
+ collector = UsageCollectorFactory .get_collector (recorded_path )
57
66
collector .record (user_agent )
58
67
59
68
def _load_specs (self ) -> None :
You can’t perform that action at this time.
0 commit comments