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(overlay): Enhanced Trace detail page. #557

Merged
merged 6 commits into from
Nov 8, 2024
Merged
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
Prev Previous commit
Next Next commit
small refactor regarding traceId filtering
  • Loading branch information
BYK committed Nov 8, 2024
commit 93f31c47a57478372e4558c7ab57ec31d663c672
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@ import { useSpotlightContext } from '~/lib/useSpotlightContext';
import Badge from '~/ui/Badge';
import CardList from '../../../../components/CardList';
import TimeSince from '../../../../components/TimeSince';
import sentryDataCache from '../../data/sentryDataCache';
import { useSentryEvents } from '../../data/useSentryEvents';
import { useSentryHelpers } from '../../data/useSentryHelpers';
import type { SentryEvent } from '../../types';
@@ -17,13 +16,10 @@ function renderEvent(event: SentryEvent) {
}

export default function EventList({ traceId }: { traceId?: string }) {
let events = useSentryEvents();
const events = useSentryEvents(traceId);
const helpers = useSentryHelpers();
const context = useSpotlightContext();

if (traceId) {
events = sentryDataCache.getEventsByTrace(traceId);
}
const matchingEvents = events.filter(e => e.type !== 'transaction');

const [showAll, setShowAll] = useState(!context.experiments['sentry:focus-local-events']);
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ import { useContext } from 'react';
import sentryDataCache from './sentryDataCache';
import { SentryEventsContext } from './sentryEventsContext';

export const useSentryEvents = () => {
export const useSentryEvents = (traceId?: string) => {
useContext(SentryEventsContext);
return sentryDataCache.getEvents();
return traceId ? sentryDataCache.getEventsByTrace(traceId) : sentryDataCache.getEvents();
};