Skip to content

Commit 3d1dcd4

Browse files
izadoesdevHugoRCD
andauthored
feat: add HyperDX drain adapter (#225)
Co-authored-by: Hugo Richard <hugo.richard@vercel.com>
1 parent 30b67e4 commit 3d1dcd4

File tree

19 files changed

+540
-8
lines changed

19 files changed

+540
-8
lines changed

.agents/skills/create-adapter/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Add a build entry in `packages/evlog/tsdown.config.ts` alongside the existing ad
7171
'adapters/{name}': 'src/adapters/{name}.ts',
7272
```
7373

74-
Place it after the last adapter entry (currently `sentry` at line 22).
74+
Place it after the last adapter entry (currently `hyperdx` in `tsdown.config.ts`).
7575

7676
## Step 3: Package Exports
7777

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"evlog": minor
3+
---
4+
5+
Add HyperDX drain adapter (`evlog/hyperdx`) for OTLP/HTTP ingest, with defaults aligned to [HyperDX OpenTelemetry documentation](https://hyperdx.io/docs/install/opentelemetry) (`https://in-otel.hyperdx.io`, `authorization` header). Includes docs site and `review-logging-patterns` skill updates.

AGENTS.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ evlog/
5454
│ │ ├── vite/ # Vite plugin (evlog/vite)
5555
│ │ ├── shared/ # Toolkit: building blocks for custom framework integrations (evlog/toolkit)
5656
│ │ ├── ai/ # AI SDK integration (evlog/ai)
57-
│ │ ├── adapters/ # Log drain adapters (Axiom, OTLP, PostHog, Sentry, Better Stack)
57+
│ │ ├── adapters/ # Log drain adapters (Axiom, OTLP, HyperDX, PostHog, Sentry, Better Stack)
5858
│ │ ├── enrichers/ # Built-in enrichers (UserAgent, Geo, RequestSize, TraceContext)
5959
│ │ └── runtime/ # Runtime code (client/, server/, utils/)
6060
│ └── test/ # Tests
@@ -321,6 +321,7 @@ evlog provides built-in adapters for popular observability platforms. Use the `e
321321
|---------|--------|-------------|
322322
| Axiom | `evlog/axiom` | Send logs to Axiom for querying and dashboards |
323323
| OTLP | `evlog/otlp` | OpenTelemetry Protocol for Grafana, Datadog, Honeycomb, etc. |
324+
| HyperDX | `evlog/hyperdx` | Send logs to HyperDX via OTLP/HTTP ([documented](https://hyperdx.io/docs/install/opentelemetry) endpoint and `authorization` header) |
324325
| PostHog | `evlog/posthog` | Send logs to PostHog Logs via OTLP for structured logging and observability |
325326
| Sentry | `evlog/sentry` | Send logs to Sentry Logs for structured logging and debugging |
326327
| Better Stack | `evlog/better-stack` | Send logs to Better Stack for log management and alerting |
@@ -351,6 +352,19 @@ export default defineNitroPlugin((nitroApp) => {
351352

352353
Set environment variable: `NUXT_OTLP_ENDPOINT`.
353354

355+
**Using HyperDX Adapter:**
356+
357+
```typescript
358+
// server/plugins/evlog-drain.ts
359+
import { createHyperDXDrain } from 'evlog/hyperdx'
360+
361+
export default defineNitroPlugin((nitroApp) => {
362+
nitroApp.hooks.hook('evlog:drain', createHyperDXDrain())
363+
})
364+
```
365+
366+
Set environment variable: `NUXT_HYPERDX_API_KEY` or `HYPERDX_API_KEY` (see [HyperDX OpenTelemetry](https://hyperdx.io/docs/install/opentelemetry)).
367+
354368
**Using PostHog Adapter:**
355369

356370
```typescript
Lines changed: 4 additions & 0 deletions
Loading

apps/docs/app/components/app/AppHeaderCenter.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ const landingItems = [
7373
description: 'Export via OTLP protocol',
7474
to: '/adapters/otlp'
7575
},
76+
{
77+
label: 'HyperDX',
78+
icon: 'i-custom-hyperdx',
79+
description: 'Send logs to HyperDX via OTLP',
80+
to: '/adapters/hyperdx'
81+
},
7682
{
7783
label: 'PostHog',
7884
icon: 'i-simple-icons-posthog',

apps/docs/app/components/features/FeatureAdapters.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,10 +384,12 @@ function setupCanvas() {
384384
</div>
385385
</div>
386386

387-
<div class="relative z-10 mt-3 flex items-center gap-3">
387+
<div class="relative z-10 mt-3 flex flex-wrap items-center justify-center gap-x-3 gap-y-1">
388388
<span class="font-mono text-[9px] text-zinc-600">+ File System</span>
389389
<span class="font-mono text-[9px] text-zinc-700">·</span>
390390
<span class="font-mono text-[9px] text-zinc-600">Custom drains</span>
391+
<span class="font-mono text-[9px] text-zinc-700">·</span>
392+
<span class="font-mono text-[9px] text-zinc-500">and more</span>
391393
</div>
392394
</div>
393395
</div>

apps/docs/content/2.frameworks/11.react-router.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ navigation:
1414

1515
The `evlog/react-router` middleware auto-creates a request-scoped logger accessible via `context.get(loggerContext)` or `useLogger()` and emits a wide event when the response completes.
1616

17-
::callout{icon="i-lucide-info" color="info"}
18-
React Router has three [modes](https://reactrouter.com/start/modes): **Framework**, **Data**, and **Declarative**. The `evlog/react-router` middleware requires the middleware API, which is available in **Framework** and **Data** modes only. Declarative mode does not support middleware — use [`evlog/browser`](/core-concepts/client-logging) for client-side logging instead.
17+
::callout{color="info" icon="i-lucide-info"}
18+
React Router has three [modes](https://reactrouter.com/start/modes): **Framework**, **Data**, and **Declarative**. The `evlog/react-router` middleware requires the middleware API, which is available in **Framework** and **Data** modes only. Declarative mode does not support middleware — use `evlog/browser` for client-side logging instead.
1919
::
2020

2121
::code-collapse
@@ -102,7 +102,7 @@ export async function loader({ context }: Route.LoaderArgs) {
102102
```
103103

104104
::callout{color="info" icon="i-custom-vite"}
105-
**Using Vite?** The [`evlog/vite`](/core-concepts/vite-plugin) [plugin](/core-concepts/vite-plugin) replaces the `initLogger()` call with compile-time auto-initialization, strips `log.debug()` from production builds, and injects source locations.
105+
**Using Vite?** The `evlog/vite` [plugin](/core-concepts/vite-plugin) replaces the `initLogger()` call with compile-time auto-initialization, strips `log.debug()` from production builds, and injects source locations.
106106
::
107107

108108
The `loggerContext` provides typed access to the evlog logger in any loader or action via `context.get(loggerContext)`.

apps/docs/content/4.adapters/1.overview.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ links:
1515
to: /adapters/otlp
1616
color: neutral
1717
variant: subtle
18+
- label: HyperDX
19+
icon: i-custom-hyperdx
20+
to: /adapters/hyperdx
21+
color: neutral
22+
variant: subtle
1823
- label: PostHog
1924
icon: i-simple-icons-posthog
2025
to: /adapters/posthog
@@ -111,6 +116,15 @@ initLogger({ drain: createAxiomDrain() })
111116
OpenTelemetry Protocol for Grafana, Datadog, Honeycomb, and more.
112117
:::
113118

119+
:::card
120+
---
121+
icon: i-custom-hyperdx
122+
title: HyperDX
123+
to: /adapters/hyperdx
124+
---
125+
Send logs to HyperDX via OTLP/HTTP using their documented ingest endpoint and API key.
126+
:::
127+
114128
:::card
115129
---
116130
icon: i-simple-icons-posthog
@@ -279,6 +293,9 @@ AXIOM_DATASET=my-logs
279293
# OTLP (NUXT_OTLP_* or OTEL_*)
280294
OTLP_ENDPOINT=https://otlp.example.com
281295

296+
# HyperDX (NUXT_HYPERDX_* or HYPERDX_*)
297+
HYPERDX_API_KEY=<YOUR_HYPERDX_API_KEY_HERE>
298+
282299
# PostHog (NUXT_POSTHOG_* or POSTHOG_*)
283300
POSTHOG_API_KEY=phc_xxx
284301

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)