UNPKG

@fiberplane/hono-otel

Version:

Hono middleware to forward OpenTelemetry traces to a local instance of @fiberplane/studio

23 lines (22 loc) 1.08 kB
import { type FpHonoEnv } from "../utils/index.js"; import type { FpConfig, FpConfigOptions } from "./types.js"; /** * Determines the "mode" of the application based on the provided configuration and environment variables. * Precendence is given to the user-provided config, then the env vars. * The default value is "local" if the otelEndpoint includes "localhost", * otherwise it is "production". */ export declare function getMode(otelEndpoint: string | null, userConfig: FpConfigOptions | undefined, env: FpHonoEnv): "local" | "production"; /** * Get the OTLP endpoint from the environment variables. */ export declare function getOtelEndpoint(env: FpHonoEnv): string | null; /** * Get the bearer token for the OTLP endpoint from the environment variables. */ export declare function getOtelToken(env: FpHonoEnv): string | null; /** * Get the library's log level from the environment variables. */ export declare function getLogLevel(config: FpConfig, env: FpHonoEnv): string | null; export declare function getServiceName(env: FpHonoEnv, fallback: string): string;