@fiberplane/hono-otel
Version:
Hono middleware to forward OpenTelemetry traces to a local instance of @fiberplane/studio
16 lines (15 loc) • 531 B
JavaScript
import { context } from "@opentelemetry/api";
/**
* Unique symbol used to store/retrieve the FPX config on the active context.
*/
export const FPX_CONFIG_KEY = Symbol("fpx-config");
/**
* Retrieves the FPX configuration from the current active context, or returns the default configuration.
*/
export function getFpResolvedConfig() {
const config = context.active().getValue(FPX_CONFIG_KEY);
return config;
}
export function setFpResolvedConfig(context, config) {
return context.setValue(FPX_CONFIG_KEY, config);
}