Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ dependencies = [
# note: we cannot resolve urllib3[brotli] but brotli is installed
# and will be used
"urllib3>=2.2.2",
"vroomrs>=0.1.17",
"vroomrs>=0.1.18",
"xmlsec>=1.3.14",
"zstandard>=0.18.0",
# [begin] getsentry
Expand Down
10 changes: 10 additions & 0 deletions src/sentry/options/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -3480,3 +3480,13 @@
default=False,
flags=FLAG_AUTOMATOR_MODIFIABLE,
)

# option used to enable/disable tracking
# rate of potential functions metrics to
# be written into EAP
register(
"profiling.track_functions_metrics_write_rate.eap.enabled",
default=False,
type=Bool,
flags=FLAG_AUTOMATOR_MODIFIABLE,
)
32 changes: 32 additions & 0 deletions src/sentry/profiles/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -1430,6 +1430,22 @@ def _process_vroomrs_transaction_profile(profile: Profile) -> bool:
get_topic_definition(Topic.PROCESSED_PROFILES)["real_topic_name"]
)
processed_profiles_producer.produce(topic, payload)
# temporary: collect metrics about rate of functions metrics to be written into EAP
# should we loosen the constraints on the number and type of functions to be extracted.
if options.get("profiling.track_functions_metrics_write_rate.eap.enabled"):
eap_functions = prof.extract_functions_metrics(
min_depth=1, filter_system_frames=True, filter_non_leaf_functions=False
)
if eap_functions is not None and len(eap_functions) > 0:
tot = 0
for f in eap_functions:
tot += len(f.get_self_times_ns())
metrics.incr(
"process_profile.eap_functions_metrics.count",
tot,
tags={"type": "profile"},
sample_rate=1.0,
)
return True
except Exception as e:
sentry_sdk.capture_exception(e)
Expand Down Expand Up @@ -1478,6 +1494,22 @@ def _process_vroomrs_chunk_profile(profile: Profile) -> bool:
get_topic_definition(Topic.PROFILES_CALL_TREE)["real_topic_name"]
)
profile_functions_producer.produce(topic, payload)
# temporary: collect metrics about rate of functions metrics to be written into EAP
# should we loosen the constraints on the number and type of functions to be extracted.
if options.get("profiling.track_functions_metrics_write_rate.eap.enabled"):
eap_functions = chunk.extract_functions_metrics(
min_depth=1, filter_system_frames=True, filter_non_leaf_functions=False
)
if eap_functions is not None and len(eap_functions) > 0:
tot = 0
for f in eap_functions:
tot += len(f.get_self_times_ns())
metrics.incr(
"process_profile.eap_functions_metrics.count",
tot,
tags={"type": "chunk"},
sample_rate=1.0,
)
return True
except Exception as e:
sentry_sdk.capture_exception(e)
Expand Down
12 changes: 6 additions & 6 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading