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
- 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
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.

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
