Skip to content

Kubernetes service discovery for initContainers #5563

Closed

Description

@cyriltovena

Proposal

The current Kubernetes service discovery implementation totally disregard initContainers.

https://github.com/prometheus/prometheus/blob/master/discovery/kubernetes/pod.go#L216

This would be useful to have them scrape because:

  • they may contain troubleshooting information.
  • We could detect problems.
  • We might want to observe how long initialization took.

Originally the problem appeared from grafana/loki#575 while for metrics it is arguable that you might need this, for logs there is no question.

Alternatives could be to create a custom service discovery. /cc @gouthamve

Activity

  1. gouthamve commented on May 27, 2019

    @gouthamve
    Member

    If we do scrape them, how to deal with them if they die? Is that target going to be down forever? /cc @brancz?

  2. brancz commented on May 28, 2019

    @brancz
    Member

    Yes, init containers must complete before the "normal" containers are started. And yes they will be down forever once they complete, if not removed from discovery once they complete (which should be possible with discovery information from its status). Generally speaking though from the Prometheus perspective init containers can run for some time, and monitoring team would still be useful.

  3. locked and limited conversation to collaborators on Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions