Log sources are doubled (<svc>_<svc>) for every service's main action #162
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_proc#162
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom
Every service's captured logs are stored/listed under a doubled source name, e.g.:
They should read
hero_browser_server,hero_browser_admin,hero_components,slides, etc. This affects every service (the main action), and it breaks prefix/"All" filtering in admin log viewers (the UI ends up needing per-servicelog_sourceoverrides, e.g. hero_components mapshero_whiteboard→whiteboard).Root cause (chain, with line refs)
crates/hero_proc_server/src/service/define.rs:132— a service's main action is named identically to the service ("= service name by convention"):So service
hero_browser_servergets a main action also calledhero_browser_server.crates/hero_proc_server/src/supervisor/mod.rs:397— the supervised job'sactionis composed as<service>.<action>:For the main action that's
hero_browser_server.hero_browser_server.crates/hero_proc_server/src/logging/adapter.rsbuild_hero_src— collapses the dotted action into one underscored segment (to keep the hero_log src at exactly three dotted partscontext.src.jobid):hero_browser_server.hero_browser_server→hero_browser_server_hero_browser_server.Final src:
core.hero_browser_server_hero_browser_server.<pid>.(See the existing unit test
build_hero_src_collapses_dotted_action: action"hero_router.hero_router"→"core.hero_router_hero_router.11".)The log src is read in
supervisor/executor.rs(let src = job.action.clone(); let log_src = job_log_src(&ctx, &src, job_id);).Suggested fix (dedupe equal segments)
Either:
supervisor/mod.rs:397— don't repeat when the segments are equal:build_hero_src— collapse aX.Xmiddle segment toX.⚠️ Blast radius — must keep writer and reader in sync
The src string is the storage key. The reader path (
logging/filter.rsfilter_to_query+build_hero_srcon the query side) must produce the byte-identical src or log retrieval silently misses the directory. So:build_hero_src_collapses_dotted_actionand the filter dual).Because this touches every service's log lookup, it should be a deliberate, tested change rather than a drive-by.
Notes
<service>.<action>job-naming convention biting whenever the main action name equals the service name (always).hero_browser_serverto the oschema stack; the hero_components admin had previously worked around it with per-servicelog_sourceoverrides.