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

Improves tags for sentry page #100

Merged
merged 1 commit into from
Dec 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion src/entities/sentry/lib/normalize-sentry-event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ export const normalizeSentryEvent = (event: ServerEvent<Sentry>): NormalizedEven
labels: [EVENT_TYPES.SENTRY, 'exception'],
origin: {
logger: event.payload.logger,
environment: event.payload.environment
environment: event.payload.environment,
release: event.payload?.release || '-',
},
serverName: event.payload?.server_name || '',
date: event.timestamp ? new Date(event.timestamp * 1000) : null,
Expand Down
1 change: 1 addition & 0 deletions src/entities/sentry/mocks/sentry-spiral.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"logger": "php",
"server_name": "ButschsterLpp",
"environment": "production",
"release": "0.4.0",
"modules": {
"brick/math": "0.10.2",
"clue/stream-filter": "v1.6.0",
Expand Down
81 changes: 47 additions & 34 deletions src/screens/sentry/ui/sentry-page-tags/sentry-page-tags.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ const contextsOS = computed(() => {

<template>
<section class="sentry-page-tags">
<h3 class="sentry-page-tags__title">tags</h3>

<div class="sentry-page-tags__boxes">
<div v-if="contextsRuntime.name" class="sentry-page-tags__box">
<span class="sentry-page-tags__box-title">runtime</span>
Expand All @@ -58,45 +56,56 @@ const contextsOS = computed(() => {
</div>
</div>

<div class="sentry-page-tags__labels">
<div class="sentry-page-tags__label">
<div class="sentry-page-tags__label-name">env</div>
<div class="sentry-page-tags__label-value">
{{ payload.environment }}
<div class="sentry-page-tags__labels-wrapper">
<h3 class="sentry-page-tags__title">tags</h3>
<div class="sentry-page-tags__labels">

<div class="sentry-page-tags__label">
<div class="sentry-page-tags__label-name">env</div>
<div class="sentry-page-tags__label-value">
{{ payload.environment }}
</div>
</div>
</div>
<div v-if="payload.logger" class="sentry-page-tags__label">
<div class="sentry-page-tags__label-name">logger</div>
<div class="sentry-page-tags__label-value">
{{ payload.logger }}

<div v-if="payload.release" class="sentry-page-tags__label">
<div class="sentry-page-tags__label-name">release</div>
<div class="sentry-page-tags__label-value">
{{ payload.release }}
</div>
</div>
</div>
<div v-if="contextsOS.name" class="sentry-page-tags__label">
<div class="sentry-page-tags__label-name">os</div>
<div class="sentry-page-tags__label-value">
{{ contextsOS.name }} {{ contextsOS.version }}
<div v-if="payload.logger" class="sentry-page-tags__label">
<div class="sentry-page-tags__label-name">logger</div>
<div class="sentry-page-tags__label-value">
{{ payload.logger }}
</div>
</div>
</div>
<div v-if="contextsRuntime.name" class="sentry-page-tags__label">
<div class="sentry-page-tags__label-name">runtime</div>
<div class="sentry-page-tags__label-value">
{{ contextsRuntime.name }} {{ contextsRuntime.version }}
<div v-if="contextsOS.name" class="sentry-page-tags__label">
<div class="sentry-page-tags__label-name">os</div>
<div class="sentry-page-tags__label-value">
{{ contextsOS.name }} {{ contextsOS.version }}
</div>
</div>
</div>
<div v-if="payload.server_name" class="sentry-page-tags__label">
<div class="sentry-page-tags__label-name">server name</div>
<div class="sentry-page-tags__label-value">
{{ payload.server_name }}
<div v-if="contextsRuntime.name" class="sentry-page-tags__label">
<div class="sentry-page-tags__label-name">runtime</div>
<div class="sentry-page-tags__label-value">
{{ contextsRuntime.name }} {{ contextsRuntime.version }}
</div>
</div>
<div v-if="payload.server_name" class="sentry-page-tags__label">
<div class="sentry-page-tags__label-name">server name</div>
<div class="sentry-page-tags__label-value">
{{ payload.server_name }}
</div>
</div>

<div v-if="payload.tags" v-for="(name,value) in payload.tags" class="sentry-page-tags__label">
<div class="sentry-page-tags__label-name">{{ value }}</div>
<div class="sentry-page-tags__label-value">
{{ name || ' - ' }}
</div>
</div>
</div>
</div>

<CodeSnippet
v-if="payload.tags"
class="mt-3"
language="json"
:code="payload.tags"
/>
</section>
</template>

Expand Down Expand Up @@ -136,6 +145,10 @@ const contextsOS = computed(() => {
@apply flex flex-row flex-wrap items-center text-purple-600 dark:text-purple-100 gap-3;
}

.sentry-page-tags__labels-wrapper {
@apply bg-gray-50 dark:bg-gray-900 p-4 rounded-lg;
}

.sentry-page-tags__label {
@apply flex border border-purple-300 rounded text-xs items-center;
}
Expand Down
1 change: 0 additions & 1 deletion src/screens/sentry/ui/sentry-page/sentry-page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ const mainException = computed(
class="sentry-page__main-exception-message"
v-html="mainException.value"
/>
<p class="sentry-page__main-date">{{ formattedTimestamp }}</p>
</header>

<header
Expand Down
Loading