fix: stop indexer-agent logs emitting duplicate JSON keys#1239
Merged
MoonBoi9001 merged 3 commits intoJun 23, 2026
Conversation
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
2f15506 to
a5b0b48
Compare
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>
tmigone
approved these changes
Jun 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
nametosubgraphNameat theGraphNodesites.nameand amsg), fixed here too.componentclash is already handled on this branch and is left untouched.🤖 Generated with Claude Code