Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Generate requested line numbers for runtime container log output

Aperta
#304 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go
Ambito
api, backend

Direzione di ricerca

Start with pkg/io/timestamp_aware_reader.go and trace how the container log streamer configures it in internal/logs/containerlogs/container_logstreamer.go; compare the Docker and Podman capture paths in their orchestrators. Check existing capture and formatting behavior for timestamp-only input and tail/skip selection. Done means runtime line numbering works with or without timestamps, preserves original positions, stays consistent across endpoints, and avoids duplicate prefixes on already-numbered captures.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

Container /log?line_numbers=true responses do not generate line numbers for timestamp-only runtime output. This is a pre-existing V1 limitation also present in the V2 runtime-capture implementation under development in #295; it is being tracked separately to avoid expanding that PR.

Code context

The Docker/Podman capture path requests runtime timestamps and writes the resulting output directly to capture files:

CaptureContainerLogs(..., containers.StreamContainerLogsOptions{
    Follow: true,
    Timestamps: true,
})

The response reader uses:

usvc_io.NewTimestampAwareReader(source, usvc_io.TimestampAwareReaderOptions{
    Timestamps: opts.Timestamps,
    LineNumbers: opts.LineNumbers,
    // ...
})

TimestampAwareReader preserves or removes existing prefixes; it does not generate missing numbering. Relevant code: internal/logs/containerlogs/container_logstreamer.go, internal/docker/cli_orchestrator.go, internal/podman/cli_orchestrator.go, and pkg/io/timestamp_aware_reader.go. V2's analogous implementation is internal/logs/v2containerlogs/container_logstreamer.go in #295.

Reproduction and evidence

A focused streamer probe supplied actual runtime-style input:

2026-10-16T12:00:00.000Z raw-runtime-output

With line_numbers=true and timestamps disabled, the response was raw-runtime-output, rather than 1 raw-runtime-output. This is a controlled reproduction, not a reported production incident. Simulated capture that already includes numbering can mask the defect.

Expected behavior

Honor requested line numbers for runtime stdout/stderr while preserving runtime timestamps and original line positions across tail/skip/limit selections. Keep physical and logical endpoints consistent when consuming the same capture. Existing numbered startup captures must not acquire duplicate prefixes.

Scope and validation

Investigate the existing shared capture/formatting mechanisms before selecting a fix; do not introduce a separate per-source implementation. Cover timestamp-only runtime input, numbering with and without timestamps, and original numbering after tail/skip. This issue does not request changes to runtime lifecycle or watcher dispatch.

Lingua principale
Go
Stelle
192
Fork
27
Merge medio
2g 9h
PR unite (30g)
16

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/dcp

Tutte le issue di microsoft/dcp

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.