Increment custom metric

Hello, I want to increment custom metric, but it doesn’t work.

On hook, I have add the file on after_bot_mount:

function hook(bp: typeof sdk, botId: string) {
  /** Your code starts below */

  const axios = require('axios')

  const flag = async () => {
    const countGraph = {
      name: 'Total Users ',
      type: 'count',
      description: 'Total number of users ',
      variables: ['user-type']
    }
    const axiosConfig = await bp.http.getAxiosConfigForBot(botId, { localUrl: true })

    await axios.post('/mod/analytics/graphs', countGraph, axiosConfig)
  }

  return flag()

}

On the flow, I have added a node with increment metrics with name parameters: user-type

But it doesn’t work

Hi @kevin21,

Custom analytics have also been deprecated; the actions are still available, but they don’t do anything anymore. If you have any suggestions for the analytics module, please post in the Product Feedback channel or open a feature request on GitHub.

Cheers!

@Maxime_Joannette Custom analytics are also deprecated on Entreprise Edition ? How can I monitor analytics without custom analytics ?

I’m not sure I understand your question, but if there are any custom needs for monitoring, you could use hooks to input data in the KVS, or fill a new table, and use any reporting tool available to Postgres.

if it’s deprecated , you should delete in your botpress documentation! :relieved: .
So , :arrow_up: means we can’t use custom analytics anymore?

Thank You

1 Like