Skip to content

Commit

Permalink
feat(explore): Support profile.id (#81318)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zylphrex authored Nov 26, 2024
1 parent a4ac88d commit cbc4a8c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion static/app/utils/discover/fieldRenderers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ const SPECIAL_FIELDS: SpecialFields = {
sortField: 'profile.id',
renderFunc: data => {
const id: string | unknown = data?.['profile.id'];
if (typeof id !== 'string') {
if (typeof id !== 'string' || id === '') {
return emptyValue;
}

Expand Down
1 change: 1 addition & 0 deletions static/app/views/explore/contexts/spanTagsContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export function SpanTagsProvider({children, dataset, enabled}: SpanTagsProviderP
// as we're moving toward span ids

'id', // SpanIndexedField.SPAN_OP is actually `span_id`
'profile.id', // SpanIndexedField.PROFILE_ID is actually `profile_id`
SpanIndexedField.BROWSER_NAME,
SpanIndexedField.ENVIRONMENT,
SpanIndexedField.ORIGIN_TRANSACTION,
Expand Down
10 changes: 10 additions & 0 deletions static/app/views/explore/tables/fieldRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {getFieldRenderer} from 'sentry/utils/discover/fieldRenderers';
import {Container} from 'sentry/utils/discover/styles';
import {generateLinkToEventInTraceView} from 'sentry/utils/discover/urls';
import {getShortEventId} from 'sentry/utils/events';
import {generateProfileFlamechartRouteWithQuery} from 'sentry/utils/profiling/routes';
import {MutableSearch} from 'sentry/utils/tokenizeSearch';
import {useLocation} from 'sentry/utils/useLocation';
import useOrganization from 'sentry/utils/useOrganization';
Expand Down Expand Up @@ -78,6 +79,15 @@ export function FieldRenderer({data, meta, unit, column}: FieldProps) {
rendered = <Link to={target}>{rendered}</Link>;
}

if (field === 'profile.id') {
const target = generateProfileFlamechartRouteWithQuery({
orgSlug: organization.slug,
projectSlug: data.project,
profileId: data['profile.id'],
});
rendered = <Link to={target}>{rendered}</Link>;
}

return (
<CellAction
column={column}
Expand Down

0 comments on commit cbc4a8c

Please sign in to comment.