noi-techpark / odh-mentor-otp

4 stars 8 forks source link

Removing Google Analytics #145

Closed RudiThoeni closed 1 year ago

RudiThoeni commented 1 year ago

Hi @stefanocudini

We want to remove Google Analytics from the frontend application.

Removing this 3 lines should do the work? https://github.com/noi-techpark/odh-mentor-otp/blob/main/journey/config.yml#L48 Or are there other places where google analytics is present.?

We noticed that on https://journey.opendatahub.bz.it/ there is only the script active ()

and on https://otp.opendatahub.bz.it/ there is also the function with the tracking code present.

stefanocudini commented 1 year ago

@RudiThoeni (I tried to send in simple PR but I can't find your develop branch anymore)

However yes the insertion of google analytics takes place only one part of config.yml

you could apply this small change to be sure the google script doesn't have to load https://github.com/openmove/odh-mentor-otp/commit/fe9e1c7f39d13438d5a7c7cffcaaff8185cc0e48

changes in config.yml or journey code require a rebuild of jouney docker image

RudiThoeni commented 1 year ago

@stefanocudini thx! we changed branch strategy now we have a "main" branch which is the development branch, and the prod branch is our release branch for production

RudiThoeni commented 1 year ago

@stefanocudini sorry i saw now your closed pull request (https://github.com/noi-techpark/odh-mentor-otp/pull/146) i see here 51 commits that are not integrated on our repo, should i reopen the PR and add this changes? I suppose yes?

Another question i deployed on the test entironment and i noticed the container for traffic is unhealthy and constantly restarting, i think this is due to this exception (se below) because of this call not returning stations https://mobility.api.opendatahub.bz.it/v2/tree/LinkStation/*/latest?limit=-1&distinct=true&select=tmeasurements&where=sactive.eq.true,or(and(tname.eq.%22Bluetooth%20Elapsed%20time%20%5C(test%5C)%22))

@rcavaliere I wondered if this call is wrong, or why the mobility api does not expose data here anymore ? (I suppose before it worked otherwise i would have noticed the containter not reaching a healthy state)

traffic_1     | Start Traffic OpenData Hub...
traffic_1     | Config:
traffic_1     |  {
traffic_1     |   server: { port: 8094, polling_interval: 20 },
traffic_1     |   endpoints: {
traffic_1     |     geometries: {
traffic_1     |       path: '/v2/flat,edge/LinkStation/?limit=-1&distinct=true&select=egeometry,ecode,etype&where=eactive.eq.true',
traffic_1     |       hostname: 'mobility.api.opendatahub.bz.it',
traffic_1     |       port: 443,
traffic_1     |       method: 'GET',
traffic_1     |       headers: [Object]
traffic_1     |     },
traffic_1     |     stations: {
traffic_1     |       path: '/v2/tree/LinkStation/*/latest?limit=-1&distinct=true&select=tmeasurements&where=sactive.eq.true,or(and(tname.eq.%22Bluetooth%20Elapsed%20time%20%5C(test%5C)%22))',
traffic_1     |       linkStationPeriod: 600,
traffic_1     |       hostname: 'mobility.api.opendatahub.bz.it',
traffic_1     |       port: 443,
traffic_1     |       method: 'GET',
traffic_1     |       headers: [Object]
traffic_1     |     }
traffic_1     |   }
traffic_1     | }
traffic_1     | [ 'get /traffic/stations.json', 'get /traffic/linkstations.json' ]
traffic_1     | listening at http://localhost:8094
traffic_1     | TRAFFIC geometries: statusCode: 200
traffic_1     | TRAFFIC stations: statusCode: 200
traffic_1     | /home/index.js:100
traffic_1     |                 let stations = tmp['data']['LinkStation']['stations'];
traffic_1     |                                                          ^
traffic_1     |
traffic_1     | TypeError: Cannot read property 'stations' of undefined
traffic_1     |     at IncomingMessage.<anonymous> (/home/index.js:100:58)
traffic_1     |     at IncomingMessage.emit (events.js:327:22)
traffic_1     |     at endReadableNT (internal/streams/readable.js:1327:12)
traffic_1     |     at processTicksAndRejections (internal/process/task_queues.js:80:21)
odh-mentor-otp_traffic_1 exited with code 1
rcavaliere commented 1 year ago

@RudiThoeni thanks for the notice. I think the problem is related to the fact that we have a major problem with the Bluetooth elaborations pipeline. I asked @dulvui to check this. Once this issue is solved, this should work again off-the-shelf

stefanocudini commented 1 year ago

@RudiThoeni I think it is better if you ignore my closed PR for now this is the 1 line change for the problem with google analytics: https://github.com/openmove/odh-mentor-otp/commit/fe9e1c7f39d13438d5a7c7cffcaaff8185cc0e48

RudiThoeni commented 1 year ago

ok alright ;) thx!

RudiThoeni commented 1 year ago

@RudiThoeni thanks for the notice. I think the problem is related to the fact that we have a major problem with the Bluetooth elaborations pipeline. I asked @dulvui to check this. Once this issue is solved, this should work again off-the-shelf

thank you, let's wait Simon return

RudiThoeni commented 1 year ago

@stefanocudini Now we have the situation that the container is constantly restarting, the error is causing the container to exit with statuscode 1. because LinkStation does not exist in the response.... Maybe we should fix it, very strange that this error causes the container to stop?

/home/index.js:100
                let stations = tmp['data']['LinkStation']['stations'];
                                                         ^

TypeError: Cannot read property 'stations' of undefined
    at IncomingMessage.<anonymous> (/home/index.js:100:58)
    at IncomingMessage.emit (events.js:327:22)
    at endReadableNT (internal/streams/readable.js:1327:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Start Traffic OpenData Hub...
stefanocudini commented 1 year ago

@RudiThoeni I hope to fix it as soon as possible.

It was caused by the continuous polling that is performed by our service towards the API which now not responding.

RudiThoeni commented 1 year ago

hi @stefanocudini in the meantime the api call was fixed to return data so i was able to deploy everything......... so low prio here, maybe we can continue on integrating matomo as described here https://github.com/noi-techpark/odh-mentor-otp/issues/148 thx