Skip to content
Logixlysia
Esc
navigateopen⌘Jpreview
On this page

HyperDX

Ship logs to HyperDX as OTLP over HTTP

Send logs to HyperDX as standard OTLP JSON (ExportLogsServiceRequest). Works with HyperDX cloud and self-hosted collectors alike, and meta fields arrive as searchable log attributes.

Setup

  1. Copy the ingestion API key from your HyperDX team settings.
  2. Set the environment variable:
HYPERDX_API_KEY=your-ingestion-key
  1. Wire the transport:
import { Elysia } from 'elysia'
import logixlysia from 'logixlysia'
import { createHyperDXTransport } from 'logixlysia/hyperdx'

const app = new Elysia()
  .use(
    logixlysia({
      config: {
        transports: [createHyperDXTransport({ serviceName: 'my-api' })]
      }
    })
  )
  .get('/', () => 'ok')
  .listen(3000)
  1. Trigger a request and search the logs in the HyperDX UI.

Environment Variables

Variable Required Description
HYPERDX_API_KEY Yes Ingestion key, sent as the authorization header
HYPERDX_OTLP_ENDPOINT No OTLP HTTP base URL (default https://in-otel.hyperdx.io)
HYPERDX_SERVICE_NAME No Value of the service.name resource attribute
OTEL_SERVICE_NAME No Fallback for the service name

Options

const hyperdx = createHyperDXTransport({
  resourceAttributes: { 'deployment.environment': 'production' },
  serviceName: 'my-api'
})
Option Type Default Description
apiKey string HYPERDX_API_KEY Ingestion API key
endpoint string https://in-otel.hyperdx.io OTLP HTTP base URL — /v1/logs is appended
serviceName string logixlysia service.name resource attribute
resourceAttributes Record<string, string> Extra OTLP resource attributes

Plus the shared batching options: maxBatchSize, flushIntervalMs, timeout, retries — see the overview.

Payload

Logs post to {endpoint}/v1/logs as OTLP JSON. Levels map to OpenTelemetry severity numbers (DEBUG → 5, INFO → 9, WARNING → 13, ERROR → 17), and meta fields flatten into dot-notation attributes:

Attribute Example
request.method GET
request.url http://localhost:3000/users
status 200
durationMs 12.4
context.requestId 0d5e…

Pair this with logixlysia/otel to include context.trace_id / context.span_id and correlate logs with traces.

Self-Hosted Collectors

Pass the OTLP HTTP base URL only (port 4318 by default) — the adapter appends /v1/logs:

createHyperDXTransport({
  apiKey: 'local',
  endpoint: 'http://otel-collector:4318'
})

Troubleshooting

  • 401 — the API key is wrong; use the ingestion key, not a personal API key.
  • Nothing arrives — logs flush in batches (2 s by default); call flush() before short-lived processes exit.

Last updated on August 22, 2026

Was this page helpful?