mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-26 19:00:22 +03:00
Bugfix/metrics provider undefined error (#3489)
fix metrics provider undefined error
This commit is contained in:
@@ -494,7 +494,7 @@ export const utilBuildChatflow = async (req: Request, isInternal: boolean = fals
|
||||
flowGraph: getTelemetryFlowObj(nodes, edges)
|
||||
})
|
||||
|
||||
appServer.metricsProvider.incrementCounter(
|
||||
appServer.metricsProvider?.incrementCounter(
|
||||
isInternal ? FLOWISE_METRIC_COUNTERS.CHATFLOW_PREDICTION_INTERNAL : FLOWISE_METRIC_COUNTERS.CHATFLOW_PREDICTION_EXTERNAL,
|
||||
{ status: FLOWISE_COUNTER_STATUS.SUCCESS }
|
||||
)
|
||||
@@ -512,7 +512,7 @@ export const utilBuildChatflow = async (req: Request, isInternal: boolean = fals
|
||||
|
||||
return result
|
||||
} catch (e) {
|
||||
appServer.metricsProvider.incrementCounter(
|
||||
appServer.metricsProvider?.incrementCounter(
|
||||
isInternal ? FLOWISE_METRIC_COUNTERS.CHATFLOW_PREDICTION_INTERNAL : FLOWISE_METRIC_COUNTERS.CHATFLOW_PREDICTION_EXTERNAL,
|
||||
{ status: FLOWISE_COUNTER_STATUS.FAILURE }
|
||||
)
|
||||
@@ -608,7 +608,7 @@ const utilBuildAgentResponse = async (
|
||||
type: isInternal ? ChatType.INTERNAL : ChatType.EXTERNAL,
|
||||
flowGraph: getTelemetryFlowObj(nodes, edges)
|
||||
})
|
||||
appServer.metricsProvider.incrementCounter(
|
||||
appServer.metricsProvider?.incrementCounter(
|
||||
isInternal ? FLOWISE_METRIC_COUNTERS.AGENTFLOW_PREDICTION_INTERNAL : FLOWISE_METRIC_COUNTERS.AGENTFLOW_PREDICTION_EXTERNAL,
|
||||
{ status: FLOWISE_COUNTER_STATUS.SUCCESS }
|
||||
)
|
||||
@@ -658,7 +658,7 @@ const utilBuildAgentResponse = async (
|
||||
return undefined
|
||||
} catch (e) {
|
||||
logger.error('[server]: Error:', e)
|
||||
appServer.metricsProvider.incrementCounter(
|
||||
appServer.metricsProvider?.incrementCounter(
|
||||
isInternal ? FLOWISE_METRIC_COUNTERS.AGENTFLOW_PREDICTION_INTERNAL : FLOWISE_METRIC_COUNTERS.AGENTFLOW_PREDICTION_EXTERNAL,
|
||||
{ status: FLOWISE_COUNTER_STATUS.FAILURE }
|
||||
)
|
||||
|
||||
@@ -197,7 +197,7 @@ export const upsertVector = async (req: Request, isInternal: boolean = false) =>
|
||||
flowGraph: getTelemetryFlowObj(nodes, edges),
|
||||
stopNodeId
|
||||
})
|
||||
appServer.metricsProvider.incrementCounter(FLOWISE_METRIC_COUNTERS.VECTORSTORE_UPSERT, { status: FLOWISE_COUNTER_STATUS.SUCCESS })
|
||||
appServer.metricsProvider?.incrementCounter(FLOWISE_METRIC_COUNTERS.VECTORSTORE_UPSERT, { status: FLOWISE_COUNTER_STATUS.SUCCESS })
|
||||
|
||||
return upsertedResult['result'] ?? { result: 'Successfully Upserted' }
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user