UNPKG

@juspay/neurolink

Version:

The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002

49 lines (48 loc) • 1.48 kB
/** * PostHog Exporter * Exports spans to PostHog product analytics platform * @see https://posthog.com/docs/api */ import type { ExporterHealthStatus, ExportResult, PostHogExporterConfig, SpanData } from "../../types/index.js"; import { BaseExporter } from "./baseExporter.js"; /** * PostHog exporter for product analytics and LLM event tracking * Supports capturing LLM interactions as events with properties */ export declare class PostHogExporter extends BaseExporter { private readonly apiKey; private readonly host; private readonly personalApiKey?; constructor(config: PostHogExporterConfig); initialize(): Promise<void>; /** * Get authorization headers */ private getHeaders; exportSpan(span: SpanData): Promise<ExportResult>; exportBatch(spans: SpanData[]): Promise<ExportResult>; flush(): Promise<void>; shutdown(): Promise<void>; healthCheck(): Promise<ExporterHealthStatus>; /** * Verify connectivity to PostHog API */ protected ping(): Promise<void>; /** * Convert span to PostHog event format */ private convertToPostHogEvent; /** * Get event name based on span type */ private getEventName; /** * Convert span status to string */ private getStatusString; /** * Extract custom properties from span attributes * Filters out standard attributes that are already handled */ private extractCustomProperties; }