Skip to content

Commit 4b3d47d

Browse files
committed
Hide show.actions from the properties panel
1 parent cd8f6b9 commit 4b3d47d

File tree

3 files changed

+25
-15
lines changed

3 files changed

+25
-15
lines changed

apps/webapp/app/presenters/v3/SpanPresenter.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class SpanPresenter {
5555
output: span.output ? JSON.stringify(span.output, null, 2) : undefined,
5656
payload: span.payload ? JSON.stringify(span.payload, null, 2) : undefined,
5757
properties: span.properties ? JSON.stringify(span.properties, null, 2) : undefined,
58-
showActionBar: (span.properties?.show as any)?.actions === true,
58+
showActionBar: span.show?.actions === true,
5959
},
6060
};
6161
}

apps/webapp/app/v3/eventRepository.server.ts

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,14 @@ export class EventRepository {
354354
? null
355355
: unflattenAttributes(fullEvent.output as Attributes);
356356

357+
const show = unflattenAttributes(
358+
filteredAttributes(fullEvent.properties as Attributes, SemanticInternalAttributes.SHOW)
359+
)[SemanticInternalAttributes.SHOW] as
360+
| {
361+
actions?: boolean;
362+
}
363+
| undefined;
364+
357365
const properties = sanitizedAttributes(fullEvent.properties);
358366

359367
const events = transformEvents(span.data.events, fullEvent.metadata as Attributes);
@@ -365,6 +373,7 @@ export class EventRepository {
365373
output,
366374
properties,
367375
events,
376+
show,
368377
};
369378
}
370379

@@ -480,14 +489,14 @@ export class EventRepository {
480489
const links: Link[] =
481490
options.spanParentAsLink && propagatedContext?.traceparent
482491
? [
483-
{
484-
context: {
485-
traceId: propagatedContext.traceparent.traceId,
486-
spanId: propagatedContext.traceparent.spanId,
487-
traceFlags: TraceFlags.SAMPLED,
492+
{
493+
context: {
494+
traceId: propagatedContext.traceparent.traceId,
495+
spanId: propagatedContext.traceparent.spanId,
496+
traceFlags: TraceFlags.SAMPLED,
497+
},
488498
},
489-
},
490-
]
499+
]
491500
: [];
492501

493502
const eventBuilder = {
@@ -742,9 +751,9 @@ function prepareEvent(event: QueriedEvent): PreparedEvent {
742751
function parseEventsField(events: Prisma.JsonValue): SpanEvents {
743752
const eventsUnflattened = events
744753
? (events as any[]).map((e) => ({
745-
...e,
746-
properties: unflattenAttributes(e.properties as Attributes),
747-
}))
754+
...e,
755+
properties: unflattenAttributes(e.properties as Attributes),
756+
}))
748757
: undefined;
749758

750759
const spanEvents = SpanEvents.safeParse(eventsUnflattened);
@@ -938,8 +947,8 @@ function transformException(
938947
...exception,
939948
stacktrace: exception.stacktrace
940949
? correctErrorStackTrace(exception.stacktrace, projectDirAttributeValue, {
941-
removeFirstLine: true,
942-
})
950+
removeFirstLine: true,
951+
})
943952
: undefined,
944953
};
945954
}
@@ -966,4 +975,4 @@ function getNowInNanoseconds(): bigint {
966975

967976
function getDateFromNanoseconds(nanoseconds: bigint) {
968977
return new Date(Number(nanoseconds) / 1_000_000);
969-
}
978+
}

packages/core/src/v3/semanticInternalAttributes.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export const SemanticInternalAttributes = {
2828
METADATA: "$metadata",
2929
TRIGGER: "$trigger",
3030
PAYLOAD: "$payload",
31-
SHOW_ACTIONS: "show.actions",
31+
SHOW: "$show",
32+
SHOW_ACTIONS: "$show.actions",
3233
WORKER_ID: "worker.id",
3334
WORKER_VERSION: "worker.version",
3435
CLI_VERSION: "cli.version",

0 commit comments

Comments
 (0)