Skip to content

Improve logging in vinyl-agent container startup #8

@jensens

Description

@jensens

Problem

Debugging startup issues is very difficult because:

  1. vinyl-agent produces zero logs when stuck in waitForPort() — it silently waits up to 60s with no output, making it impossible to tell if the binary started, what it's waiting for, or why it can't connect.

  2. varnish container produces minimal logs — only "Child launched OK" and mlock warnings. No information about which flags were used, which ports are listening, or whether the admin CLI is enabled.

  3. Operator logs show connection errors but don't indicate whether the issue is networking, the agent not running, or varnish not having admin CLI enabled.

Suggested improvements

vinyl-agent (cmd/agent/main.go)

  • Log at startup: agent version, listen address, admin address
  • Log each waitForPort attempt: "waiting for varnish admin on 127.0.0.1:6082 (attempt 3/30)"
  • Log when admin port becomes available: "varnish admin ready"
  • Log when secret is read successfully
  • Log when HTTP server starts listening: "vinyl-agent listening on :9090"

Operator (internal/controller/)

  • When VCL push fails, log the pod's container statuses (running/waiting/terminated)
  • Log the agent image being used when creating StatefulSet
  • Log the varnish args being set

varnish container

  • Consider adding an init log showing the effective varnishd command line

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions