Netflix / Netflix/mantis

Ensure JobActor has JobID as part of every emitted log line

Open
#384 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue
Dominant language
Java
Stars
1.5k
Forks
224
Avg merge
22h 46m
Merged PRs (30d)
1

Description

Context

We use the slf4j logger API to emit logs from within all the actors. All these actors have a unique way of identifying themselves. For instance, the JobActor represents an instance of a running Job with a unique JobID. Thus, it would be nice to ensure all the logs emitted from the JobActor contain this information. Today, this is done in an ad-hoc fashion. Some logs have the JobID, while others don't. It would be nice to develop a more structured way of solving this.

Goals

Look at the below line from JobActor.java to understand what the problem is.

LOGGER.info("Initializing Job {}", jobId);

We manually add the jobID in log line above. However, in other places, we fail to do this—for instance, look at the example below (also from JobActor.java).

LOGGER.info("Stored mantis job");

Instead, it would be nice to have a more structured way of solving this problem—something like the one below.

jobLogger.info("Whatever");

And the expectation is that jobLogger adds the jobID to every emitted logline by default.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading JobActor.java and comparing its slf4j LOGGER calls, including the examples for initializing and storing a Mantis job. Trace how the actor currently obtains its logger and identify all JobActor log paths that need consistent JobID context. Done means every emitted JobActor log includes the JobID without each message adding it manually.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, observability-sre
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.