Skip to content
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

feat(metrics): Add an option to extrapolate tx and span metrics #73911

Merged
merged 6 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 12 additions & 0 deletions src/sentry/options/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -1466,6 +1466,18 @@
flags=FLAG_AUTOMATOR_MODIFIABLE,
)

register(
"sentry-metrics.extrapolation.enable_transactions",
default=False,
flags=FLAG_AUTOMATOR_MODIFIABLE,
)

register(
"sentry-metrics.extrapolation.enable_spans",
default=False,
flags=FLAG_AUTOMATOR_MODIFIABLE,
)

# Performance issue option for *all* performance issues detection
register("performance.issues.all.problem-detection", default=1.0, flags=FLAG_AUTOMATOR_MODIFIABLE)

Expand Down
16 changes: 15 additions & 1 deletion src/sentry/relay/config/metric_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,24 @@ def get_extrapolation_config(project: Project) -> MetricExtrapolationConfig | No
# Extrapolation applies to extracted metrics. This enables extrapolation for
# the entire `custom` namespace, but this does not extrapolate old custom
# metrics sent from the SDK directly.
return {
config = {
"include": ["?:custom/*"],
"exclude": [],
}

if options.get("sentry-metrics.extrapolation.enable_transactions"):
config["include"] += ["?:transactions/*"]
config["exclude"] += [
"c:transactions/usage@none",
"c:transactions/count_per_root_project@none",
]

if options.get("sentry-metrics.extrapolation.enable_spans"):
config["include"] += ["?:spans/*"]
config["exclude"] += ["c:spans/usage@none"]

return config


def get_on_demand_metric_specs(
timeout: TimeChecker, project: Project
Expand Down
Loading