Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/
import type { Attribute } from "@/types/javaagent";
import { ChevronDown } from "lucide-react";

interface AttributeTableProps {
attributes: Attribute[];
Expand All @@ -25,40 +26,48 @@ export function AttributeTable({ attributes }: AttributeTableProps) {
}

return (
<div className="border-border/30 overflow-x-auto rounded-lg border">
<table aria-label="Attributes" className="w-full min-w-[260px] border-collapse">
<thead>
<tr className="bg-white/5">
<th
scope="col"
className="text-muted-foreground p-2 text-left text-[10px] font-bold tracking-widest uppercase sm:p-3"
>
Key
</th>
<th
scope="col"
className="text-muted-foreground p-2 text-left text-[10px] font-bold tracking-widest uppercase sm:p-3"
>
Type
</th>
</tr>
</thead>
<tbody>
{attributes.map((attr, index) => (
<tr
key={attr.name}
className={`attribute-row ${index % 2 === 1 ? "bg-white/[0.03]" : ""}`}
>
<td className="p-2 font-mono text-xs sm:p-4 sm:text-sm">{attr.name}</td>
<td className="p-2 sm:p-4">
<span className="border-border/30 bg-card/80 text-muted-foreground inline-block w-fit rounded border px-2 py-1 text-xs font-bold tracking-wider uppercase">
{attr.type}
</span>
</td>
<details className="group border-border/30 bg-card/50 overflow-hidden rounded-lg border open:bg-transparent">
Comment thread
hussainjamal760 marked this conversation as resolved.
Outdated
<summary className="hover:bg-card/80 flex cursor-pointer items-center justify-between p-3 text-sm font-medium transition-colors">
<span className="text-muted-foreground text-xs font-black tracking-[0.2em] uppercase">
View {attributes.length} Attribute{attributes.length === 1 ? "" : "s"}
</span>
<ChevronDown className="text-muted-foreground h-4 w-4 transition-transform group-open:rotate-180" />
</summary>
<div className="border-border/30 overflow-x-auto border-t">
<table aria-label="Attributes" className="w-full min-w-[260px] border-collapse">
<thead>
<tr className="bg-white/5">
<th
scope="col"
className="text-muted-foreground p-2 text-left text-[10px] font-bold tracking-widest uppercase sm:p-3"
>
Key
</th>
<th
scope="col"
className="text-muted-foreground p-2 text-left text-[10px] font-bold tracking-widest uppercase sm:p-3"
>
Type
</th>
</tr>
))}
</tbody>
</table>
</div>
</thead>
<tbody>
{attributes.map((attr, index) => (
<tr
key={attr.name}
className={`attribute-row ${index % 2 === 1 ? "bg-white/[0.03]" : ""}`}
>
<td className="p-2 font-mono text-xs sm:p-4 sm:text-sm">{attr.name}</td>
<td className="p-2 sm:p-4">
<span className="border-border/30 bg-card/80 text-muted-foreground inline-block w-fit rounded border px-2 py-1 text-xs font-bold tracking-wider uppercase">
{attr.type}
</span>
</td>
</tr>
))}
</tbody>
</table>
</div>
</details>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,7 @@ export function TelemetrySection({ telemetry }: TelemetrySectionProps) {

{/* Attributes section */}
{metric.attributes && metric.attributes.length > 0 && (
<div className="space-y-4">
<h4 className="text-muted-foreground text-xs font-black tracking-[0.2em] uppercase">
Attributes
</h4>
<div className="pt-2">
<AttributeTable attributes={metric.attributes} />
</div>
)}
Expand Down Expand Up @@ -128,10 +125,7 @@ export function TelemetrySection({ telemetry }: TelemetrySectionProps) {

{/* Attributes section */}
{span.attributes && span.attributes.length > 0 && (
<div className="space-y-4">
<h4 className="text-muted-foreground text-xs font-black tracking-[0.2em] uppercase">
Attributes
</h4>
<div className="pt-2">
<AttributeTable attributes={span.attributes} />
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ import {
getSemanticConventionInfo,
getFeatureInfo,
} from "./utils/format";
import { getBadgeInfo } from "./utils/badge-info";
import { TelemetryBadges } from "./components/instrumentation-badges";
import { TelemetrySection } from "./components/telemetry-section";
import { TelemetryComparisonSection } from "./components/telemetry-comparison/telemetry-comparison-section";
import { VersionSelector } from "./components/version-selector";
Expand Down Expand Up @@ -156,6 +158,7 @@ export function InstrumentationDetailPage() {
const displayName = getInstrumentationDisplayName(instrumentation);
const showRawName =
instrumentation.display_name && instrumentation.display_name !== instrumentation.name;
const badgeInfo = getBadgeInfo(instrumentation);

return (
<PageContainer>
Expand Down Expand Up @@ -217,6 +220,7 @@ export function InstrumentationDetailPage() {
? "Disabled by Default"
: "Enabled by Default"}
</GlowBadge>
<TelemetryBadges badges={badgeInfo} />
</div>
</div>

Expand Down Expand Up @@ -275,6 +279,81 @@ export function InstrumentationDetailPage() {

<TabsContent value="details" className="mt-0 p-4 sm:p-6">
<div className="space-y-8">
{/* Value Proposition Summary */}
{(badgeInfo.hasMetrics || badgeInfo.hasSpans) && (
<div>
<SectionHeader>Telemetry Overview</SectionHeader>
<div className="grid gap-4 md:grid-cols-2">
{badgeInfo.hasSpans && (
<DetailCard withHoverEffect>
<div className="flex items-start gap-3">
<Activity
className="text-info mt-0.5 h-5 w-5 flex-shrink-0"
aria-hidden="true"
/>
<div className="flex-1 space-y-1">
<h3 className="text-foreground text-sm font-semibold">
Traces & Spans
</h3>
<p className="text-muted-foreground text-sm">
Follows individual requests step-by-step. Use this to see exactly
where time is spent and where errors happen.
Comment thread
hussainjamal760 marked this conversation as resolved.
Outdated
</p>
{instrumentation.telemetry &&
instrumentation.telemetry[0] &&
instrumentation.telemetry[0].spans && (
<div className="mt-2 flex flex-wrap gap-1">
{instrumentation.telemetry[0].spans.map((span, idx) => (
<GlowBadge key={idx} variant="info" className="text-[10px]">
{span.span_kind}
</GlowBadge>
))}
</div>
)}
</div>
</div>
</DetailCard>
)}

{badgeInfo.hasMetrics && (
<DetailCard withHoverEffect>
<div className="flex items-start gap-3">
<Activity
className="text-success mt-0.5 h-5 w-5 flex-shrink-0"
aria-hidden="true"
/>
<div className="flex-1 space-y-1">
<h3 className="text-foreground text-sm font-semibold">
Performance Metrics
Comment thread
hussainjamal760 marked this conversation as resolved.
Outdated
</h3>
<p className="text-muted-foreground text-sm">
Gives you the big picture of system health, like total request
Comment thread
hussainjamal760 marked this conversation as resolved.
counts, error rates, and average speeds over time.
</p>
{instrumentation.telemetry &&
instrumentation.telemetry[0] &&
instrumentation.telemetry[0].metrics && (
<div className="mt-2 flex flex-wrap gap-1">
{instrumentation.telemetry[0].metrics.map((metric, idx) => (
<span
key={idx}
className="bg-success/10 text-success border-success/20 truncate rounded border px-1.5 py-0.5 font-mono text-[10px]"
title={metric.name}
>
{metric.name.length > 50
? metric.name.substring(0, 50) + "..."
: metric.name}
</span>
))}
</div>
)}
</div>
</div>
</DetailCard>
)}
</div>
</div>
)}
{((instrumentation.features && instrumentation.features.length > 0) ||
(instrumentation.semantic_conventions &&
instrumentation.semantic_conventions.length > 0)) && (
Expand Down