How to connect Grafana from Backend of an Application

Dear Expert,

I am currently doing POC by using Faro SDK for initialization and Using Faro SDK API call for sending the events and logs to Grafana.
The part of the below code is in Web Application side. So, runs in browser.
We are using OtelCollector instead of Alloy.

As per our security standard, we can’t call Faro initialization URL[Grafana will be running in our internal cluster] from browser side. We need to connect OtelCollector somehow from backend of our application and its corresponding API to send event to Grafana.
Our backend is based on Typescript and NodeJs. We can expose new REST Apis in platform side, which will execute code in backend.

Can expert suggest, how we can achieve it, as I can understand Grafana Faro interact with frontend application not for backend side?

Our requirement is to track all the button pressed and page/frame load events in our application.


faro = faroObject.initializeFaro({
url: ‘http://:/collect’,
apiKey: ‘api_key’,
app: {
name: ‘launchpad’,
version: ‘1.0.0’,
},
isolate: true,
});
faro.api.pushLog(['Hello Faro Log reached]);


Your suggestion and help would be really appreciable.

Regards
Rajib

That’s not correct. Grafana is not a signal storage. You need to store logs in log storage, e. g. Loki and traces in trace storage, e. g. Tempo.

Hi jangaraj,

Thanks for your input. Let me explain bit more.

We are using Loki only for logs and event. Our flow of data currently is as below:

Launchpad [Our Web application]-> Faro-SDK → Our OTEL Collector in main/worker clusters → “OTEL Gateway” → Loki

With this flow, we are able to see the logs and events in Loki from Grafana.

Currently, we have initialized Faro and called SDK API from frontend of Launchpad. Which runs in Browser.

Which looks as security threat as from browser direct ping is going to OTEL Collector in cluster.

Thought is going in our side, if Grafana Faro initialization and Faro SDK calls can be done from backend side of the Launchpad.

In that case, ping to OTEL Collector in cluster will go from server, which is internal.

Is there any way we can achieve it?

Regards

Rajib

The whole point of Faro is that is running in the frontend - browser.

How Faro can measure webvitals metrics, when it will be running on the backend side?

We have REST APIs, through which Frontend interacts with Backend. We are also seeking ideas, if some way, our requirement can be achieved with Grafana.