Skip to content

Commit 67450ca

Browse files
authored
fix(profiling): fix profile function metrics ingestion (#93908)
When no functions metrics are extracted, we should avoid sending a kafka message to Snuba with an empty list of functions.
1 parent b5a13ee commit 67450ca

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/sentry/profiles/task.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,11 +1314,12 @@ def _process_vroomrs_chunk_profile(profile: Profile) -> bool:
13141314
functions = chunk.extract_functions_metrics(
13151315
min_depth=1, filter_system_frames=True, max_unique_functions=100
13161316
)
1317-
payload = build_chunk_functions_kafka_message(chunk, functions)
1318-
topic = ArroyoTopic(
1319-
get_topic_definition(Topic.PROFILES_CALL_TREE)["real_topic_name"]
1320-
)
1321-
profile_functions_producer.produce(topic, payload)
1317+
if functions is not None and len(functions) > 0:
1318+
payload = build_chunk_functions_kafka_message(chunk, functions)
1319+
topic = ArroyoTopic(
1320+
get_topic_definition(Topic.PROFILES_CALL_TREE)["real_topic_name"]
1321+
)
1322+
profile_functions_producer.produce(topic, payload)
13221323
return True
13231324
except Exception as e:
13241325
sentry_sdk.capture_exception(e)

0 commit comments

Comments
 (0)