Skip to content

Commit edbfd79

Browse files
TimPansinohmstepanek
authored andcommitted
Add instrumentation for new kinesis method (#1557)
1 parent 7a484b3 commit edbfd79

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

newrelic/hooks/external_botocore.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,6 +1451,9 @@ def wrap_serialize_to_request(wrapped, instance, args, kwargs):
14511451
("kinesis", "untag_resource"): aws_function_trace(
14521452
"untag_resource", extract_kinesis, extract_agent_attrs=extract_kinesis_agent_attrs, library="Kinesis"
14531453
),
1454+
("kinesis", "update_max_record_size"): aws_function_trace(
1455+
"update_max_record_size", extract_kinesis, extract_agent_attrs=extract_kinesis_agent_attrs, library="Kinesis"
1456+
),
14541457
("kinesis", "update_shard_count"): aws_function_trace(
14551458
"update_shard_count", extract_kinesis, extract_agent_attrs=extract_kinesis_agent_attrs, library="Kinesis"
14561459
),

tests/external_botocore/test_boto3_kinesis.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
}
4747
}
4848

49+
UNINSTRUMENTED_KINESIS_METHODS = ("generate_presigned_url", "close", "get_waiter", "can_paginate", "get_paginator")
50+
4951
_kinesis_scoped_metrics = [
5052
(f"MessageBroker/Kinesis/Stream/Produce/Named/{TEST_STREAM}", 2),
5153
(f"MessageBroker/Kinesis/Stream/Consume/Named/{TEST_STREAM}", 1),
@@ -117,10 +119,7 @@ def test_instrumented_kinesis_methods():
117119
region_name=AWS_REGION,
118120
)
119121

120-
ignored_methods = {
121-
("kinesis", method)
122-
for method in ("generate_presigned_url", "close", "get_waiter", "can_paginate", "get_paginator")
123-
}
122+
ignored_methods = {("kinesis", method) for method in UNINSTRUMENTED_KINESIS_METHODS}
124123
client_methods = inspect.getmembers(client, predicate=inspect.ismethod)
125124
methods = {("kinesis", name) for (name, method) in client_methods if not name.startswith("_")}
126125

0 commit comments

Comments
 (0)