google cloud trace not working in express

I'm trying to implement google trace in my MERN project, hosted in google cloud platform.

I've followed the guide and the examples offered by Google, but I can't make it work in any way.

import gCloudTrace from '@google-cloud/trace-agent';
// initialize gcloud trace
if (process.env.NODE_ENV === 'production') {
  console.log(`Starting google cloud trace...`);
  const tracer = gCloudTrace.start();
  console.log(JSON.stringify(tracer,null,2));
};

import express from 'express';
import apiRoute  from './api.js';
import indexRoute from './index/indexRoute.js';

try {

  // setup
  const host = process.env.HOST || '0.0.0.0';
  const port = process.env.PORT || 5050;
  const app = express();

  // routes
  app.use('/', indexRoute);
  app.use('/api', checkGloblalSettings, apiRoute);

  // create and run HTTP server
  app.listen(port, host, () => {
    console.log(`EXPRESS SERVER HTTP BACKEND UP AND RUNNING ON ${host} : ${port}`);
  });

  } catch(error) {
    globalErrorHandler(error);
};

When I deploy (google app engine, flex env) everything works great, all route works but I can't find any trace in my project. I've double checked gcloud settings: Trace API is enabled, no need to create custom credentials.

Any suggestion?

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum