Skip to content

fix: stop indexer-agent logs emitting duplicate JSON keys#1239

Merged
MoonBoi9001 merged 3 commits into
main-dipsfrom
mb9/fix-duplicate-json-keys-in-agent-logs
Jun 23, 2026
Merged

fix: stop indexer-agent logs emitting duplicate JSON keys#1239
MoonBoi9001 merged 3 commits into
main-dipsfrom
mb9/fix-duplicate-json-keys-in-agent-logs

Conversation

@MoonBoi9001

@MoonBoi9001 MoonBoi9001 commented Jun 22, 2026

Copy link
Copy Markdown
Member

TL;DR

The indexer-agent tags every log line with the service name, but a few lines reuse that same label to also carry a subgraph name, so the label appears twice and log tooling silently keeps only one copy. This gives the subgraph name its own label and adds a lint rule that blocks the whole class of duplicate-key mistakes going forward. Stacked on #1234 and targets that branch.

Motivation

The indexer-agent tags every log line with a label that names the service, so anyone reading the logs can tell where a line came from. A handful of lines about deploying and syncing subgraphs reuse that same label a second time to carry the name of a subgraph, so one line ends up with the label twice.

A label is supposed to appear once per line, and common log readers quietly keep only the second copy and throw the first away without warning. So tooling that sorts or groups logs by that label puts these lines in the wrong place, showing a subgraph name where the service name was expected. The wording a person reads is unaffected, but operators and the systems that watch these logs may draw on the wrong value.

Summary

  • Rename the clashing per-call log field from name to subgraphName at the GraphNode sites.
  • Apply the same rename to the matching call in the agent's reconciliation loop.
  • Keep the logged value identical; only the key name changes.
  • Add an eslint rule (agent, common, cli) banning pino reserved keys as per-call log fields.
  • The rule surfaced two more real collisions (a name and a msg), fixed here too.
  • An earlier component clash is already handled on this branch and is left untouched.

🤖 Generated with Claude Code

@github-project-automation github-project-automation Bot moved this to 🗃️ Inbox in Indexer Jun 22, 2026
@MoonBoi9001 MoonBoi9001 marked this pull request as ready for review June 23, 2026 01:29
@MoonBoi9001 MoonBoi9001 requested a review from tmigone June 23, 2026 01:29
MoonBoi9001 and others added 2 commits June 23, 2026 16:10
The agent's root logger stamps every line with name=IndexerAgent, yet some log calls also put
the subgraph's own name under that same name key, so one JSON line carried name twice. Strict
parsers keep only the last value and drop the first; the per-call field is now subgraphName.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KJmMVG736T3xefovirWryK
Add an eslint rule across the agent, common and cli packages banning pino's reserved keys
(name, level, time, pid, hostname, msg, v) as per-call log fields, which silently emit a
duplicate JSON key. It caught two more real collisions (a `name` and a `msg`), fixed here too.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KJmMVG736T3xefovirWryK
@MoonBoi9001 MoonBoi9001 changed the base branch from mb9/start-dips-sync-on-offchain-accept to main-dips June 23, 2026 04:11
@MoonBoi9001 MoonBoi9001 force-pushed the mb9/fix-duplicate-json-keys-in-agent-logs branch from 2f15506 to a5b0b48 Compare June 23, 2026 04:11
The ETH-balance monitor, freshness checkers, and network monitor each re-set `component` on a
child logger that already inherited it, emitting two `component` keys (invalid JSON).
Use a distinct `subComponent` key instead, and drop a duplicate `protocolNetwork`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-project-automation github-project-automation Bot moved this from 🗃️ Inbox to ✅ Approved in Indexer Jun 23, 2026
@MoonBoi9001 MoonBoi9001 merged commit 57397d9 into main-dips Jun 23, 2026
16 of 17 checks passed
@MoonBoi9001 MoonBoi9001 deleted the mb9/fix-duplicate-json-keys-in-agent-logs branch June 23, 2026 21:38
@github-project-automation github-project-automation Bot moved this from ✅ Approved to 🚗 Merged in Indexer Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: 🚗 Merged

Development

Successfully merging this pull request may close these issues.

2 participants