CartoDB / Windshaft-cartodb

Windshaft tailored for CARTO
BSD 3-Clause "New" or "Revised" License
72 stars 58 forks source link

Track mapconfig id / template id in logs #1135

Open simon-contreras-deel opened 5 years ago

simon-contreras-deel commented 5 years ago

Related to https://github.com/CartoDB/support/issues/2177

simon-contreras-deel commented 5 years ago

The idea is to add more info to follow all the mapconfig flow:

Makes sense?

dgaubert commented 5 years ago

know where the map config was created or instantiated know where a template was created and instantiated

Do you mean the Maps API instance? If so, we already have that info. See: event_source_node field.

know the relation between template and map-config

That's more interesting. 🤔

simon-contreras-deel commented 5 years ago

Let me explain better:

With all this info, we can know the lifecycle of a mapconfig / template. The idea is to get more info to investigate lost mapconfigs.

I know I have added template id / mapconfig id in some places where we already have it (for example in the template update or delete where we get them from the URL) but I want to have a consistent place to have the info.

dgaubert commented 5 years ago

Yeah, I know what you want to accomplish here. 😄

Apart from the links that I shared above, which give you most of what you need to be able to add it in the log entry, you'll have to add a new header with the template id (X-Template-Id) when the template is created. Once you have it you need to use those headers to add them in the log entry.

See: https://github.com/CartoDB/Windshaft-cartodb/blob/master/lib/api/template/admin-template-controller.js#L135-L144