Skip to content

Commit

Permalink
feat(metric-stats): Add metric_stats generic metrics namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Dav1dde committed Mar 14, 2024
1 parent b291992 commit a40c5ec
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/sentry/options/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -1258,6 +1258,11 @@
],
flags=FLAG_AUTOMATOR_MODIFIABLE,
)
register(
"sentry-metrics.cardinality-limiter.limits.metric_stats.per-org",
default=[],
flags=FLAG_AUTOMATOR_MODIFIABLE,
)
register(
"sentry-metrics.cardinality-limiter.limits.generic-metrics.per-org",
default=[
Expand Down
15 changes: 14 additions & 1 deletion src/sentry/sentry_metrics/indexer/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@
"os.version": PREFIX + 271,
# Performance Score
"sentry.score_profile_version": PREFIX + 272,
# Metric stats
"mri": PREFIX + 273,
"mri.type": PREFIX + 274,
"mri.namespace": PREFIX + 275,
"outcome": PREFIX + 276,
"reason": PREFIX + 277,
# GENERAL/MISC (don't have a category)
"": PREFIX + 1000,
}
Expand Down Expand Up @@ -236,15 +242,22 @@
"d:bundle_analysis/bundle_size@byte": PREFIX + 700,
}

# 800-899
METRIC_STATS_METRIC_NAMES = {
"g:metric_stats/volume@none": PREFIX + 800,
"g:metric_stats/cardinality@none": PREFIX + 801,
}


SHARED_STRINGS = {
**SESSION_METRIC_NAMES,
**TRANSACTION_METRICS_NAMES,
**SPAN_METRICS_NAMES,
**ESCALATING_ISSUES_METRIC_NAMES,
**PROFILING_METRIC_NAMES,
**SHARED_TAG_STRINGS,
**BUNDLE_ANALYSIS_METRIC_NAMES,
**METRIC_STATS_METRIC_NAMES,
**SHARED_TAG_STRINGS,
}
REVERSE_SHARED_STRINGS = {v: k for k, v in SHARED_STRINGS.items()}

Expand Down
3 changes: 3 additions & 0 deletions src/sentry/sentry_metrics/use_case_id_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class UseCaseID(Enum):
CUSTOM = "custom"
PROFILES = "profiles"
BUNDLE_ANALYSIS = "bundle_analysis"
METRIC_STATS = "metric_stats"


# UseCaseKey will be renamed to MetricPathKey
Expand All @@ -30,6 +31,7 @@ class UseCaseID(Enum):
UseCaseID.CUSTOM: UseCaseKey.PERFORMANCE,
UseCaseID.BUNDLE_ANALYSIS: UseCaseKey.PERFORMANCE,
UseCaseID.PROFILES: UseCaseKey.PERFORMANCE,
UseCaseID.METRIC_STATS: UseCaseKey.PERFORMANCE,
}

# TODO: Remove this as soon as the entire indexer system is use case aware
Expand All @@ -46,6 +48,7 @@ class UseCaseID(Enum):
UseCaseID.SPANS: "sentry-metrics.cardinality-limiter.limits.spans.per-org",
UseCaseID.CUSTOM: "sentry-metrics.cardinality-limiter.limits.custom.per-org",
UseCaseID.PROFILES: "sentry-metrics.cardinality-limiter.limits.profiles.per-org",
UseCaseID.METRIC_STATS: "sentry-metrics.cardinality-limiter.limits.metric_stats.per-org",
}

USE_CASE_ID_WRITES_LIMIT_QUOTA_OPTIONS = {
Expand Down

0 comments on commit a40c5ec

Please sign in to comment.