telefonicaid / fiware-cygnus

A connector in charge of persisting context data sources into other third-party databases and storage systems, creating a historical view of the context
https://fiware-cygnus.rtfd.io/
GNU Affero General Public License v3.0
64 stars 105 forks source link

Destination logs insert _ character #2108

Open cesarjorgemartinez opened 3 years ago

cesarjorgemartinez commented 3 years ago

Example:

time=2021-11-03T10:23:14.718Z | lvl=INFO | corr=XYZ; cbnotif=1 | trans=ABC | srv=N/A | subsrv=N/A | op=processNewBatches | comp=Cygnus | msg=com.telefonica.iot.cygnus.sinks.NGSISink[606] : Finishing internal transaction (DEF; cbnotif=1, FFF; cbnotif=1, ) Sink: com.telefonica.iot.cygnus.sinks.NGSIPostgisSink Destination: yyy_/_parking_onstreetparking

Must be: Destination: yyy/parking_onstreetparking

Doubt: For all sink types?

AlvaroVega commented 3 years ago

bug in a log ?

cesarjorgemartinez commented 3 years ago

I think, because not exist something as yyy_/_parking_onstreetparking

AlvaroVega commented 2 years ago

Printed by

https://github.com/telefonicaid/fiware-cygnus/blob/29eaf8368e5e0e71304856e65c26ecb7011640da/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/sinks/NGSISink.java#L421

and

https://github.com/telefonicaid/fiware-cygnus/blob/29eaf8368e5e0e71304856e65c26ecb7011640da/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/sinks/NGSISink.java#L614

But tablename is build at (i.e. for postgis) https://github.com/telefonicaid/fiware-cygnus/blob/29eaf8368e5e0e71304856e65c26ecb7011640da/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/sinks/NGSIPostgisSink.java#L610-L625 and depends on datamodel configured for that sink

smartcitydevops commented 2 years ago

The issue is still ongong in our prouction environment with 2.16.0 cygnus_version

AlvaroVega commented 2 years ago

Could you provide for this case https://github.com/telefonicaid/fiware-cygnus/issues/2108#issue-1043368887 what is the name of service, subservice, entity_id, entity_type, database name and so on (not real, but with examples) ?

smartcitydevops commented 2 years ago

There are several cases:

AlvaroVega commented 2 years ago

yyyyyyyyy is a subservice? zzzzzzzzz is a entity_id, or an entity_type?

AlvaroVega commented 2 years ago

For example in a log with " Sink: mysql-sink Destination: smartcity_/_thing:dispB_thing" and default data model (dm-by-entity) service: smartcity subservice: / enttiy_id: thing:dispB enttiy_type: thing And seems right to me

AlvaroVega commented 2 years ago

Summarizing character '' is used by cygnus in destination (and then in logs where destination appears) to contact depending n datamodel used the several atoms: ```__ _```

having in account that subservice contains always '/'.

So destination word in logs should be read in this way