veryfront/observability

Import

ts
import {
  addSpanEvent,
  captureApplicationError,
  createChildSpan,
  createFileLogSubscriber,
  createOpenTelemetryServiceTracer,
  endSpan,
} from "veryfront/observability";

Examples

ts
import { withSpan } from "veryfront/observability";

const result = await withSpan("load-data", async () => {
  return await fetch("https://example.com/data");
});

Exports

Components

NameDescriptionSource
ApplicationErrorReporterInitializerNameContract name used when an application composes a reporter through extensions.source
SpanKindsource
SpanNamesRender span names.source
SpanStatusCodesource

Functions

NameDescriptionSource
addSpanEventEvent emitted for add span.source
captureApplicationErrorsource
createChildSpanCreate child span.source
createFileLogSubscriberCreate file log subscriber.source
createOpenTelemetryServiceTracerCreate open telemetry service tracer.source
endSpanEnd an active tracing span.source
extractContextContext for extract.source
flushApplicationErrorssource
getActiveContextContext for get active.source
getTraceContextReturn the active trace context, if available.source
injectContextContext for inject.source
instrumentInstrument an async operation.source
instrumentBatchInstrument a batch operation.source
instrumentErrorHandlerHandler for instrument error.source
instrumentFetchCreate a fetch implementation instrumented with observability spans.source
instrumentHttpHandlerHandler for instrument HTTP.source
instrumentReactRenderInstrument a React render operation.source
instrumentSyncInstrument a synchronous operation.source
isAutoInstrumentEnabledCheck whether auto instrumentation is enabled.source
isMetricsEnabledCheck whether metrics collection is enabled.source
isOTLPEnabledCheck whether OTLP export is enabled.source
isReservedSharedRuntimeTelemetryEnvKeysource
isTracingDegradedsource
isTracingEnabledCheck whether tracing is enabled.source
markRequestProfilePhasesource
parseCompileErrorError shape for parse compile.source
parseMaxSizeParses max size.source
profilePhasesource
profileSyncPhasesource
recordApiRequestsource
recordApiRetrysource
recordBuildRecord build.source
recordBundleRecord bundle.source
recordCacheGetRecord cache get.source
recordCacheInvalidateRecord cache invalidate.source
recordCacheSetRecord cache set.source
recordContentCacheHitRecord a content cache hit at the specified layersource
recordContentNetworkFetchRecord a content network fetch with timingsource
recordCorsRejectionRecord CORS rejection.source
recordDataFetchRecord data fetch.source
recordDataFetchErrorError shape for record data fetch.source
recordErrorCountsource
recordHttpRequestRequest payload for record HTTP.source
recordHttpRequestCompleteRecord HTTP request complete.source
recordRenderRecord render.source
recordRenderErrorError shape for record render.source
recordRSCErrorError shape for record rscerror.source
recordRSCRenderRecord RSC render.source
recordRSCRequestRequest payload for record rscrequest.source
recordRSCStreamRecord RSC stream.source
recordSecurityHeadersRecord security headers.source
setActiveSpanAttributesAdd sanitized attributes to the active span, if available.source
setCacheSizeSets cache size.source
setSpanAttributesSets span attributes.source
startSpanStarts span.source
withActiveSpanApplies active span.source
withSpanApplies span.source
withSpanSyncApplies span sync.source

Classes

NameDescriptionSource
ErrorCollectorImplement error collector.source
FileLogSubscriberImplement file log subscriber.source
LogBufferImplement log buffer.source

Types

NameDescriptionSource
ApplicationErrorContextSanitized context attached when a runtime reports an application error.source
ApplicationErrorReporterProvider-neutral application error capture and flush interface.source
ApplicationErrorReporterInitializationContextRuntime context passed to an explicitly selected reporter initializer.source
ApplicationErrorReporterInitializerApplication-composition contract for an error-reporting implementation.source
ApplicationErrorReporterLifecycleActive application-error reporter ownership.source
ApplicationErrorReporterSessionReporter and cleanup ownership returned by an application-selected initializer.source
AttributeValuesource
AutoInstrumentConfigConfiguration used by auto instrument.source
Contextsource
Countersource
CreateOpenTelemetryServiceTracerOptionsOptions accepted by create open telemetry service tracer.source
DevErrorError shape for dev.source
ErrorFilterPublic API contract for error filter.source
ErrorSubscriberPublic API contract for error subscriber.source
ErrorTypePublic API contract for error type.source
FileLogConfigConfiguration used by file log.source
Histogramsource
LogBufferFilterFilter options for reading buffered log entries.source
LogEntryEntry shape for log.source
LogLevelPublic API contract for log level.source
LogSubscriberPublic API contract for log subscriber.source
Metersource
MetricsConfigConfiguration used by metrics.source
ModuleServeStatussource
ObservableGaugesource
OpenTelemetryContextApiPublic API contract for open telemetry context API.source
OpenTelemetryServiceTracerPublic API contract for open telemetry service tracer.source
OpenTelemetrySpanPublic API contract for open telemetry span.source
OpenTelemetrySpanContextContext for open telemetry span.source
OpenTelemetryTraceApiPublic API contract for open telemetry trace API.source
OpenTelemetryTracerPublic API contract for open telemetry tracer.source
OTLPConfigConfiguration used by otlpconfig.source
RequestProfileRecordsource
ServiceTracerPublic API contract for service tracer.source
ServiceTracerAttributeInputInput payload for service tracer attribute.source
ServiceTracerAttributesPublic API contract for service tracer attributes.source
ServiceTracerAttributeValuePublic API contract for service tracer attribute value.source
ServiceTracerSpanPublic API contract for service tracer span.source
ServiceTracerSpanContextContext for service tracer span.source
ServiceTracerStartSpanOptionsOptions accepted by service tracer start span.source
Spansource
SpanKindsource
SpanOptionsOptions accepted by span.source
SpanStatusCodesource
TracingConfigConfiguration used by tracing.source

Constants

NameDescriptionSource
metricssource
traceRead-only tracing facade for the public veryfront/observability surface.source

Deep imports

These import paths group focused functionality under this module. Each is a separate barrel; import only what you need.

veryfront/observability/otlp-setup

*********************** OpenTelemetry OTLP Setup Thin wrapper that delegates to the ext-observability-opentelemetry extension via the TracingExporter contract. When the extension is not installed, all span operations silently no-op. Reads configuration from environment variables: - OTEL_TRACES_ENABLED: "true" to enable tracing - OTEL_SERVICE_NAME: Service name for traces - OTEL_EXPORTER_OTLP_ENDPOINT: OTLP endpoint - OTEL_EXPORTER_OTLP_HEADERS: Auth headers ************************

ts
import {
  activeSpanLink,
  addActiveSpanEvent,
  addSpanEvent,
} from "veryfront/observability/otlp-setup";

Functions

NameDescriptionSource
activeSpanLinkA link to the span that is active right now, for a span about to be rooted away from it.source
addActiveSpanEventRecords an event on the currently active span, if there is one.source
addSpanEventAdds an event to a span.source
endServerSpanEnd an active server tracing span.source
extractContextContext for extract.source
getActiveTraceparentThe active span's identity as a traceparent, for storing somewhere durable.source
getTraceContextsource
initializeOTLPInitialize OTLP tracing export.source
initializeOTLPWithApisInitialize OTLP tracing with explicit API adapters.source
injectContextContext for inject.source
isOTLPEnabledCheck whether OTLP export is enabled.source
markSpanCompletedMarks verified domain completion without replacing an observed execution failure.source
markSpanFailedMarks a span as failed with a stable error code.source
setActiveSpanAttributesSets active span attributes.source
setActiveSpanErrorStatusMarks the active span as failed.source
setSpanAttributesSets span attributes.source
shutdownOTLPShut down OTLP tracing export.source
startServerSpanStarts server span.source
traceparentLinkBuild a span link from a traceparent read back out of durable storage.source
withContextContext for with.source
withSpanApplies span.source
withSpanSyncApplies span sync.source

Types

NameDescriptionSource
OTLPConfigConfiguration used by otlpconfig.source
WithSpanOptionssource