Skip to content

log as info mongo query used to get silent entities#873

Merged
fgalan merged 6 commits intomasterfrom
task/log_info_query_mongo_silent_entities
Feb 13, 2026
Merged

log as info mongo query used to get silent entities#873
fgalan merged 6 commits intomasterfrom
task/log_info_query_mongo_silent_entities

Conversation

@AlvaroVega
Copy link
Member

@AlvaroVega AlvaroVega commented Feb 13, 2026

issue #872

This way will print something like.

time=2026-02-13T09:07:48.929Z | lvl=INFO | corr=n/a | trans=n/a | op=entitiesStore | comp=perseo-fe | srv=n/a | subsrv=n/a | msg=findSilentEntities service smartcity pipeline: [{"$match":{"_id.servicePath":"/","_id.id":"disp1","_id.type":"thing"}},{"$addFields":{"currentTime":{"$divide":[1770973668929,1000]},"maxTimeDetection":{"$convert":{"input":{"$ifNull":["$attrs.maxTimeDetection.value","2678400"]},"to":"double","onError":"2678400","onNull":"2678400"}},"reportInterval":{"$convert":{"input":{"$ifNull":["$attrs.undefined.value","200"]},"to":"double","onError":"200","onNull":"200"}}}},{"$match":{"$expr":{"$and":[{"$lt":["$attrs.temperature.modDate",{"$subtract":["$currentTime","$reportInterval"]}]},{"$gt":["$attrs.temperature.modDate",{"$subtract":["$currentTime","$maxTimeDetection"]}]},{"$gt":["$attrs.temperature.modDate",0]}]}}}]

@AlvaroVega
Copy link
Member Author

AlvaroVega commented Feb 13, 2026

This PR will also logs like:

time=2026-02-13T10:43:44.375Z | lvl=INFO | corr=n/a | trans=n/a | op=entitiesStore | comp=perseo-fe | srv=n/a | subsrv=n/a | msg= findSilentEntitiesByMongo has found 1 entities in (hr): 8.704077 ms service=smartcity subservice=/ ids=["disp1"]

@AlvaroVega AlvaroVega marked this pull request as ready for review February 13, 2026 10:56
@AlvaroVega AlvaroVega requested a review from fgalan February 13, 2026 10:56
Copy link
Member

@fgalan fgalan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fgalan fgalan merged commit a630871 into master Feb 13, 2026
12 of 15 checks passed
@fgalan fgalan deleted the task/log_info_query_mongo_silent_entities branch February 13, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants