PURISTA API / @purista/hono-http-server / HonoServiceClass
Class: HonoServiceClass<Bindings, Variables>
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:86
A service which creates a Hono server, adds the command endpoints of given services. The webserver needs to be started programmatically, after the .start method.
Minimal example:
Example
import { serve } from '@hono/node-server'
import { DefaultEventBridge } from '@purista/core'
import { honoV1Service } from '@purista/hono-http-server'
// create and init our eventbridge
const eventBridge = new DefaultEventBridge()
await eventBridge.start()
// add your service
const pingService = await pingV1Service.getInstance(eventBridge)
await pingService.start()
const honoService = await honoV1Service.getInstance(eventBridge, {
serviceConfig: {
services: [pingService]
}
})
await honoService.start()
const _serverInstance = serve({
fetch: honoService.app.fetch,
port: 3000,
})Extends
Type Parameters
Bindings
Bindings extends BindingsBase = BindingsBase
Variables
Variables extends VariablesBase = VariablesBase
Constructors
Constructor
new HonoServiceClass<
Bindings,Variables>(config):HonoServiceClass<Bindings,Variables>
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:104
Parameters
config
ServiceConstructorInput<ServiceClassTypes<{ apiMountPath: string; enableDynamicRoutes: boolean; enableHealth: boolean; healthFunction?: any; healthPath: string; logLevel: "error" | "info" | "warn" | "debug" | "trace" | "fatal"; openApi?: { components?: any; enabled: boolean; externalDocs?: { description?: string; url: string; }; info: { contact?: { email?: string; name?: string; url?: string; }; description: string; license?: { name: string; url?: string; }; termsOfService?: string; title: string; version: string; }; openapi: string; paths?: Record<string, Record<string, any>>; security?: any[]; servers?: object[]; tags?: object[]; }; protectHandler?: any; services: Service<ServiceClassTypes>[]; traceHeaderField: string; }, EmptyObject>>
Returns
HonoServiceClass<Bindings, Variables>
Overrides
Properties
activeStreamSessions
protectedactiveStreamSessions:Map<string, {cancelled:boolean;cancelReason?:string;onCancel: (reason?) =>void[]; }>
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:65
Inherited from
app
app:
Hono<{Bindings:Bindings;Variables:Variables; },BlankSchema,"/">
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:93
The Hono instance
commandDefinitionList
commandDefinitionList:
CommandDefinitionListResolved<any>
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:76
Inherited from
commands
protectedcommands:Map<string,CommandDefinition<any,any,any,any,any,any,any,any,any,any,EmptyObject,any,any,any,any,any,any>>
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:61
Inherited from
config
config:
object
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:79
apiMountPath
apiMountPath:
string
enableDynamicRoutes
enableDynamicRoutes:
boolean
enableHealth
enableHealth:
boolean
healthFunction?
optionalhealthFunction:any
healthPath
healthPath:
string
logLevel
logLevel:
"error"|"info"|"warn"|"debug"|"trace"|"fatal"
openApi?
optionalopenApi:object
openApi.components?
optionalcomponents:any
openApi.enabled
enabled:
boolean
openApi.externalDocs?
optionalexternalDocs:object
openApi.externalDocs.description?
optionaldescription:string
openApi.externalDocs.url
url:
string
openApi.info
info:
object=InfoObjectSchema
openApi.info.contact?
optionalcontact:object
openApi.info.contact.email?
optionalemail:string
openApi.info.contact.name?
optionalname:string
openApi.info.contact.url?
optionalurl:string
openApi.info.description
description:
string
openApi.info.license?
optionallicense:object
openApi.info.license.name
name:
string
openApi.info.license.url?
optionalurl:string
openApi.info.termsOfService?
optionaltermsOfService:string
openApi.info.title
title:
string
openApi.info.version
version:
string
openApi.openapi
openapi:
string
openApi.paths?
optionalpaths:Record<string,Record<string,any>>
openApi.security?
optionalsecurity:any[]
openApi.servers?
optionalservers:object[]
openApi.tags?
optionaltags:object[]
protectHandler?
optionalprotectHandler:any
services
services:
Service<ServiceClassTypes>[]
traceHeaderField
traceHeaderField:
string
Inherited from
configSchema
protectedconfigSchema:Schema|undefined
Defined in: core/dist/commonjs/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:31
Inherited from
configStore
protectedconfigStore:ConfigStore
Defined in: core/dist/commonjs/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:29
Inherited from
eventBridge
protectedeventBridge:EventBridge
Defined in: core/dist/commonjs/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:24
Inherited from
info
readonlyinfo:ServiceInfoType
Defined in: core/dist/commonjs/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:23
Inherited from
isStarted
isStarted:
boolean
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:81
Inherited from
logger
logger:
Logger
Defined in: core/dist/commonjs/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:25
Inherited from
openApi
openApi:
OpenApiBuilder
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:98
The OpenApiBuilder instance
queueDefinitionList
protectedqueueDefinitionList:QueueDefinitionListResolved<any>
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:63
Inherited from
queueWorkerDefinitionList
protectedqueueWorkerDefinitionList:QueueWorkerDefinitionListResolved<any>
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:64
Inherited from
Service.queueWorkerDefinitionList
resources
resources:
EmptyObject
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:80
Inherited from
secretStore
protectedsecretStore:SecretStore
Defined in: core/dist/commonjs/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:28
Inherited from
spanProcessor
spanProcessor:
SpanProcessor|undefined
Defined in: core/dist/commonjs/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:26
Inherited from
stateStore
protectedstateStore:StateStore
Defined in: core/dist/commonjs/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:30
Inherited from
streamDefinitionList
streamDefinitionList:
StreamDefinitionListResolved<any>
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:78
Inherited from
streams
protectedstreams:Map<string,StreamDefinition<any,any,any,any,any,any,any,EmptyObject,any,any,any,any,any,any>>
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:62
Inherited from
subscriptionDefinitionList
subscriptionDefinitionList:
SubscriptionDefinitionListResolved<any>
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:77
Inherited from
Service.subscriptionDefinitionList
subscriptions
protectedsubscriptions:Map<string,SubscriptionDefinition<any,any,any,any,any,any,any,any,EmptyObject,any,any,any,any,any,any>>
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:60
Inherited from
traceProvider
traceProvider:
NodeTracerProvider
Defined in: core/dist/commonjs/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:27
Inherited from
Accessors
name
Get Signature
get name():
string
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:83
Returns
string
Inherited from
serviceInfo
Get Signature
get serviceInfo():
ServiceInfoType
Defined in: core/dist/commonjs/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:45
Get service info
Returns
Inherited from
Methods
addEndpoint()
addEndpoint(
metadata,service):void
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:332
Adds a single service command endpoint to the Hono router
Parameters
metadata
Command metadata produced by the builder
service
Address of the service hosting the command
Returns
void
destroy()
destroy():
Promise<void>
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:611
Stop and destroy the current service
Returns
Promise<void>
Overrides
emit()
emit<
K>(eventName,parameter?):void
Defined in: core/dist/commonjs/core/types/GenericEventEmitter.d.ts:16
Type Parameters
K
K extends EventKey<ServiceEvents>
Parameters
eventName
K
parameter?
Returns
void
Inherited from
executeCommand()
executeCommand(
message):Promise<Readonly<Omit<{contentEncoding:"utf-8";contentType:"application/json";correlationId:string;eventName?:string;id:string;isHandledError:boolean;messageType:CommandErrorResponse;otp?:string;payload: {data?:unknown;message:string;status:StatusCode; };principalId?:string;receiver: {instanceId:string;serviceName:string;serviceTarget:string;serviceVersion:string; };sender: {instanceId:string;serviceName:string;serviceTarget:string;serviceVersion:string; };tenantId?:string;timestamp:number;traceId?:string; },"instanceId">> | {contentEncoding:string;contentType:string;correlationId:string;eventName?:string;id:string;messageType:CommandSuccessResponse;otp:string;payload:unknown;principalId?:string;receiver: {instanceId:string;serviceName:string;serviceTarget:string;serviceVersion:string; };sender: {instanceId:string;serviceName:string;serviceTarget:string;serviceVersion:string; };tenantId?:string;timestamp:number;traceId?:string; }>
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:140
Called when a command is received by the service
Parameters
message
Readonly<Command>
Command envelope to execute
Returns
Promise<Readonly<Omit<{ contentEncoding: "utf-8"; contentType: "application/json"; correlationId: string; eventName?: string; id: string; isHandledError: boolean; messageType: CommandErrorResponse; otp?: string; payload: { data?: unknown; message: string; status: StatusCode; }; principalId?: string; receiver: { instanceId: string; serviceName: string; serviceTarget: string; serviceVersion: string; }; sender: { instanceId: string; serviceName: string; serviceTarget: string; serviceVersion: string; }; tenantId?: string; timestamp: number; traceId?: string; }, "instanceId">> | { contentEncoding: string; contentType: string; correlationId: string; eventName?: string; id: string; messageType: CommandSuccessResponse; otp: string; payload: unknown; principalId?: string; receiver: { instanceId: string; serviceName: string; serviceTarget: string; serviceVersion: string; }; sender: { instanceId: string; serviceName: string; serviceTarget: string; serviceVersion: string; }; tenantId?: string; timestamp: number; traceId?: string; }>
Inherited from
executeStream()
executeStream(
message):Promise<void>
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:184
Parameters
message
Readonly<StreamMessage>
Returns
Promise<void>
Inherited from
executeSubscription()
executeSubscription(
message,subscriptionName):Promise<Omit<{contentEncoding:string;contentType:string;correlationId?:string;eventName:string;id:string;messageType:CustomMessage;otp?:string;payload?:unknown;principalId?:string;receiver?:EBMessageAddress;sender: {instanceId:string;serviceName:string;serviceTarget:string;serviceVersion:string; };tenantId?:string;timestamp:number;traceId?:string; },"id"|"timestamp"> |undefined>
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:186
Parameters
message
Readonly<EBMessage>
subscriptionName
string
Returns
Promise<Omit<{ contentEncoding: string; contentType: string; correlationId?: string; eventName: string; id: string; messageType: CustomMessage; otp?: string; payload?: unknown; principalId?: string; receiver?: EBMessageAddress; sender: { instanceId: string; serviceName: string; serviceTarget: string; serviceVersion: string; }; tenantId?: string; timestamp: number; traceId?: string; }, "id" | "timestamp"> | undefined>
Inherited from
getAgentInvokeFunction()
protectedgetAgentInvokeFunction<Invokes>(serviceTarget,traceId?,principalId?,tenantId?,agentInvokes?): <InvokeResponseType,PayloadType,ParameterType>(receiver,payload,parameter) =>AgentInvocation<InvokeResponseType>
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:100
Type Parameters
Invokes
Invokes extends AgentInvokeList
Parameters
serviceTarget
string
traceId?
string
principalId?
string
tenantId?
string
agentInvokes?
Invokes
Returns
<
InvokeResponseType,PayloadType,ParameterType>(receiver,payload,parameter):AgentInvocation<InvokeResponseType>
Type Parameters
InvokeResponseType
InvokeResponseType = { history: any[]; message: any; }
PayloadType
PayloadType = {[x: string]: unknown; attachments: any[]; conversationId?: string; history: any[]; message: string; }
ParameterType
ParameterType = EmptyObject
Parameters
receiver
payload
PayloadType
parameter
ParameterType
Returns
AgentInvocation<InvokeResponseType>
Inherited from
Service.getAgentInvokeFunction
getConsumeStreamFunction()
protectedgetConsumeStreamFunction<StreamInvokes>(serviceTarget,traceId?,principalId?,tenantId?,streamInvokes?):OpenStreamFunction
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:132
Type Parameters
StreamInvokes
StreamInvokes extends StreamInvokeList
Parameters
serviceTarget
string
traceId?
string
principalId?
string
tenantId?
string
streamInvokes?
StreamInvokes
Returns
Inherited from
Service.getConsumeStreamFunction
getContextFunctions()
getContextFunctions(
logger,queueNamespace?):ContextBase
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:134
Parameters
logger
queueNamespace?
Returns
Inherited from
getEmitFunction()
protectedgetEmitFunction<EmitList>(serviceTarget,traceId?,principalId?,tenantId?,emitList?): <K,Payload>(eventName,eventPayload?,contentType?,contentEncoding?) =>Promise<void>
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:133
Type Parameters
EmitList
EmitList extends Record<string, Schema> = EmptyObject
Parameters
serviceTarget
string
traceId?
string
principalId?
string
tenantId?
string
emitList?
EmitList
Returns
<
K,Payload>(eventName,eventPayload?,contentType?,contentEncoding?):Promise<void>
Type Parameters
K
K extends string | number | symbol
Payload
Payload = EmitList[K]
Parameters
eventName
K
eventPayload?
Payload
contentType?
string
contentEncoding?
string
Returns
Promise<void>
Inherited from
getInvokeFunction()
protectedgetInvokeFunction<Invokes>(serviceTarget,traceId?,principalId?,tenantId?,invokes?): <Payload,Parameter>(receiver,invokePayload,invokeparameter,contentType?,contentEncoding?) =>Promise<any>
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:99
Type Parameters
Invokes
Invokes extends InvokeList
Parameters
serviceTarget
string
traceId?
string
principalId?
string
tenantId?
string
invokes?
Invokes
Returns
<
Payload,Parameter>(receiver,invokePayload,invokeparameter,contentType?,contentEncoding?):Promise<any>
Type Parameters
Payload
Payload
Parameter
Parameter extends EmptyObject
Parameters
receiver
invokePayload
Payload
invokeparameter
Parameter
contentType?
string
contentEncoding?
string
Returns
Promise<any>
Inherited from
getQueueNamespace()
protectedgetQueueNamespace(queueInvokes?,traceId?,principalId?,tenantId?):object
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:110
Parameters
queueInvokes?
traceId?
string
principalId?
string
tenantId?
string
Returns
object
enqueue
enqueue:
QueueInvokeFunction&QueueInvokeClientMap<QueueInvokeList>
scheduleAt
scheduleAt:
QueueScheduleFunction&QueueScheduleProxy<QueueInvokeClientMap<QueueInvokeList>>
Inherited from
getServiceHealth()
getServiceHealth():
Promise<ServiceHealthState>
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:183
Returns
Promise<ServiceHealthState>
Inherited from
getTracer()
getTracer(
name?,version?):Tracer
Defined in: core/dist/commonjs/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:51
Returns open telemetry tracer of this service
Parameters
name?
string
version?
string
Returns
Tracer
Tracer
Inherited from
initializeEventbridgeConnect()
protectedinitializeEventbridgeConnect(commandDefinitionList,subscriptions,streams):Promise<void>
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:91
Connect service to event bridge to receive commands and command responses
Parameters
commandDefinitionList
CommandDefinitionListResolved<any>
subscriptions
SubscriptionDefinitionListResolved<any>
streams
StreamDefinitionListResolved<any>
Returns
Promise<void>
Inherited from
Service.initializeEventbridgeConnect
initializeQueues()
protectedinitializeQueues():Promise<void>
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:92
Returns
Promise<void>
Inherited from
invoke()
invoke<
T>(input,endpoint):Promise<T>
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:534
Type Parameters
T
T
Parameters
input
Omit<Command, "id" | "messageType" | "timestamp" | "correlationId" | "sender">
endpoint
string
Returns
Promise<T>
off()
off<
K>(eventName,fn):void
Defined in: core/dist/commonjs/core/types/GenericEventEmitter.d.ts:15
Type Parameters
K
K extends EventKey<ServiceEvents>
Parameters
eventName
K
fn
EventReceiver<ServiceEvents[K]>
Returns
void
Inherited from
on()
on<
K>(eventName,fn):void
Defined in: core/dist/commonjs/core/types/GenericEventEmitter.d.ts:14
Type Parameters
K
K extends EventKey<ServiceEvents>
Parameters
eventName
K
fn
EventReceiver<ServiceEvents[K]>
Returns
void
Inherited from
openStream()
openStream(
input,endpoint):Promise<StreamHandle<unknown,unknown>>
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:549
Parameters
input
Omit<Command, "id" | "messageType" | "timestamp" | "correlationId" | "sender">
endpoint
string
Returns
Promise<StreamHandle<unknown, unknown>>
prepareDestroy()
prepareDestroy():
object
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:604
Helper function to be used in gracefulShutdown. It prevents to handle new requests during shut down. Incoming requests are rejected with 503 Service Unavailable.
Returns
destroy()
destroy: () =>
Promise<void>
Set the service unavailable The webserver will return 503 Service Unavailable
Returns
Promise<void>
name
name:
string
Example
gracefulShutdown(logger, [
honoService.prepareDestroy(),
eventbridge,
...services,
honoService
])registerCommand()
registerCommand(
commandDefinition):Promise<void>
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:176
Parameters
commandDefinition
CommandDefinition<any, any, any, any, any, any, any, any, any, any, EmptyObject, any, any, any>
Returns
Promise<void>
Inherited from
registerService()
registerService(...
services):HonoServiceClass<Bindings,Variables>
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:311
Register a service instance. Must be called before .start. Adds the endpoints of the service commands to the Hono router
Parameters
services
...Service<ServiceClassTypes>[]
Returns
HonoServiceClass<Bindings, Variables>
registerStream()
registerStream(
streamDefinition):Promise<void>
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:185
Parameters
streamDefinition
StreamDefinition<any, any, any, any, any, any, any, EmptyObject, any, any, any, any, any, any>
Returns
Promise<void>
Inherited from
registerSubscription()
registerSubscription(
subscriptionDefinition):Promise<void>
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:187
Parameters
subscriptionDefinition
SubscriptionDefinition<any, any, any, any, any, any, any, any, EmptyObject, any, any, any>
Returns
Promise<void>
Inherited from
removeAllListeners()
removeAllListeners():
void
Defined in: core/dist/commonjs/core/types/GenericEventEmitter.d.ts:17
Returns
void
Inherited from
sendServiceInfo()
protectedsendServiceInfo(infoType,target?,payload?):Promise<Readonly<EBMessage>>
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:98
Broadcast service info message
Parameters
infoType
type of info message
target?
string
function name is need in messages like InfoServiceFunctionAdded
payload?
Record<string, unknown>
Returns
Promise<Readonly<EBMessage>>
Inherited from
setHealthFunction()
setHealthFunction(
fn):HonoServiceClass<Bindings,Variables>
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:141
Set a custom health function
Parameters
fn
HealthFunction<HonoServiceClass<Bindings, Variables>>
Returns
HonoServiceClass<Bindings, Variables>
setHonoTypes()
setHonoTypes<
E>():HonoServiceClass<Bindings&E["Bindings"],Variables&E["Variables"]>
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:128
Set the Hono types for Variables and Bindings.
Type Parameters
E
E extends object = { Bindings: EmptyObject; Variables: EmptyObject; }
Returns
HonoServiceClass<Bindings & E["Bindings"], Variables & E["Variables"]>
The service instance with propper types
setProtectMiddleware()
setProtectMiddleware(
fn):HonoServiceClass<Bindings,Variables>
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:161
Set the middleware which will be executed on all endpoints which are marked as secured/protected. It can also be used to enhance input information.
Parameters
fn
EndpointProtectMiddleware<HonoServiceClass<Bindings, Variables>, Bindings, Variables>
Returns
HonoServiceClass<Bindings, Variables>
Example
honoService.setProtectHandler(async function (c, next) {
const auth = basicAuth({ username: 'user', password: 'password' })
c.set('additionalParameter', { userId: '123' })
return auth(c, next)
})setServiceAvailable()
setServiceAvailable():
Promise<void>
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:584
Set the service available Request will be processed.
Returns
Promise<void>
setServiceUnavailable()
setServiceUnavailable():
Promise<void>
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:576
Set the service unavailable The webserver will return 503 Service Unavailable
Returns
Promise<void>
start()
start():
Promise<void>
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:166
It connects to the event bridge and subscribes to the topics that are in the subscription list.
Returns
Promise<void>
Overrides
startActiveSpan()
startActiveSpan<
F>(name,opts,context,fn):Promise<F>
Defined in: core/dist/commonjs/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:60
Start a child span for opentelemetry tracking
Type Parameters
F
F
Parameters
name
string
name of span
opts
SpanOptions
span options
context
optional context
Context | undefined
fn
(span) => Promise<F>
function to be executed within the span
Returns
Promise<F>
return value of fn
Inherited from
startQueueWorkers()
protectedstartQueueWorkers():void
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:177
Returns
void
Inherited from
stopQueueWorkers()
protectedstopQueueWorkers():Promise<void>
Defined in: core/dist/commonjs/core/Service/Service.impl.d.ts:178
Returns
Promise<void>
Inherited from
wrapInSpan()
wrapInSpan<
F>(name,opts,fn,context?):Promise<F>
Defined in: core/dist/commonjs/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:76
Start span for opentelemetry tracking on same level. The created span will not become the "active" span within opentelemetry!
This means during logging and similar the spanId of parent span is logged.
Use wrapInSpan for marking points in flow of one bigger function, but not to trace the program flow itself
Type Parameters
F
F
Parameters
name
string
name of span
opts
SpanOptions
span options
fn
(span) => Promise<F>
function te be executed in the span
context?
Context
span context
Returns
Promise<F>
return value of fn
