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(metric-stats): Add metric_stats generic metrics namespace #66955

Merged
merged 5 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We just had an incident (INC-680) where adding new strings here broke existing strings in prod. Can you double check that none of these tags are in the indexer currently? Otherwise they will overwrite the old values and mess up the data.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did checked all of them (see PR description)

"mri.type": PREFIX + 274,
"mri.namespace": PREFIX + 275,
"outcome.id": PREFIX + 276,
"outcome.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,
Dav1dde marked this conversation as resolved.
Show resolved Hide resolved
"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