interop-otel/src.withTrace
withTrace<ComponentProps>(WrappedComponent, traceName): FC<ComponentProps & WithTraceProps>
Higher-order component that supplies the wrapped component with
a wrapped useTracer hook that is already scoped to the proper name of the component.
| Name | Type |
|---|---|
ComponentProps | extends IntrinsicAttributes |
| Name | Type | Description |
|---|---|---|
WrappedComponent | ComponentType<ComponentProps & Partial<WithTraceProps>> | The component to wrap with tracing |
traceName | string | Optional name name of the trace; if not provided, displayName of the component will be used. |
FC<ComponentProps & WithTraceProps>
A higher-order component that wraps the given component with tracing
See
useTracer for the hook that is used internally.