Toggle menu

Pulse

Setting Up Live Service Mode

Live Service Mode lets you add Pulse monitoring to your integration. For example, you may be writing an end point which calls a third party API. Adding Pulse as a service wrapper around that call adds real-time monitoring that can be viewed on the Pulse dashboard.

pollService End Point

The Pulse service exposes a goss.pulse.pollService end point. It requires a "serviceId" to be provided and then it can be called with one of the following:

  • url - string. Performs a get request at the supplied URL
  • endpoint - string. Fully qualified namespace. Calls this.invokeEP with the end point name
  • func - An anonymous asynchronous function with optional parameters (funcParams)
  • axiosOptions - An Axios "options" payload. If no timeout is included, the found serviceId config (if present) will be used else the default will be leveraged

Once used, it will also handle adding all of the stats to the serviceId provided as per the heartbeat pattern.

Axios Example

Pass through an existing axios "options" object and retrieve the response:

Before:

        const serviceId = "exampleService";
        const axiosOptions = { "url": "https://www.google.com", "method": "get" };
        const result = await axios(axiosOptions);
        return  {
            "status": result.status,
            "data": result.data
        };

After:

        const serviceId = "exampleService";
        const axiosOptions = { "url": "https://www.google.com", "method": "get" };
        const result = ((await this.invokeEP("goss.pulse.pollService", { serviceId, axiosOptions })).pollResult || {});
        return  {
            "status": result.status,
            "data": result.data
        };

Function Example

Pass through an anonymous async function (params optional):

Before:

    return await main(params);

After:

    const serviceId = "exampleService";
    return ((await this.invokeEP("goss.pulse.pollService", { serviceId, "func": main, "funcParams": params })).pollResult || {}).raw;

Or:

    const serviceId = "exampleService";
    const func = async () => main(params);
    return ((await this.invokeEP("goss.pulse.pollService", { serviceId, func })).pollResult || {}).raw;

Raw Response

In the second example above you'll see .raw being returned. this is to avoid "error" like behaviours. If an "error" response payload comes back and is deemed truthy (true, "true", 1, "hello", {}, [] etc) then it will throw an error instead of passing the data back unmodified.

.raw only applies to generic "functions". Its not needed for axios or "generics" as they simply return the core data points in .pollResult.

Dashboard

One Pulse has been added, follow the steps in Pulse - Configuring Heartbeat Mode to add the live monitoring to the dashboard.

Once monitoring events have been recorded, your live service ID will show up in the "Missing Configs" list.

Missing Configs

Press "Configure" then complete the form. Don't enter a URL or end point to monitor - the dashboard will display data recorded by your calls to goss.pulse.pollService.

Last modified on 11 May 2026