Skip to content

feat(ourlogs): Add a count unique function #93852

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

Merged
merged 1 commit into from
Jun 18, 2025
Merged

Conversation

colin-sentry
Copy link
Member

This lets you show how many unique values exist for a given parameter

@colin-sentry colin-sentry requested a review from a team as a code owner June 18, 2025 19:54
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jun 18, 2025
@colin-sentry colin-sentry enabled auto-merge (squash) June 18, 2025 19:58
@colin-sentry colin-sentry merged commit 99c7881 into master Jun 18, 2025
46 checks passed
@colin-sentry colin-sentry deleted the count_unique_logs branch June 18, 2025 20:06
Comment on lines +76 to +90
let aggregatableKeys = Object.keys(numberTags ?? {}).map(key => ({
label: prettifyTagKey(key),
value: key,
}));
if (aggregateFunction === 'count') {
aggregatableKeys.length = 0;
aggregatableKeys.unshift({label: t('logs'), value: 'logs'});

if (aggregateFunction === AggregationKey.COUNT) {
aggregatableKeys = [{label: t('logs'), value: 'logs'}];
aggregateParam = 'logs';
}
if (aggregateFunction === AggregationKey.COUNT_UNIQUE) {
aggregatableKeys = Object.keys(stringTags ?? {}).map(key => ({
label: prettifyTagKey(key),
value: key,
}));
}
Copy link
Member

Choose a reason for hiding this comment

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

IMO this should be a helper function so we avoid mutable aggregatableKeys.

andrewshie-sentry pushed a commit that referenced this pull request Jun 19, 2025
This lets you show how many unique values exist for a given parameter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants