draganm / missing-container-metrics

Prometheus exporter for container metrics cAdvisor won't give you
MIT License
171 stars 31 forks source link

container xxx not found in namespace k8s.io #15

Closed fransguelinckx closed 2 years ago

fransguelinckx commented 2 years ago

Hi, I'm seeing a lot of these logs in the output of missing-container-metrics pods. The do expose some go metrics, but not container_restarts, container_ooms or container_last_exit_code. Am I doing something wrong? Thanks in advance!

{"level":"warn","ts":1638978244.646691,"caller":"containerd/event_handler.go:108","msg":"while getting container info","version":"v0.21.0","error":"container \"f8e217dcebd318d4f6f37c8601d80bddc1cb40edb7a3262bff2df729a7a892e0\" in namespace \"k8s.io\": not found","errorVerbose":"not found
github.com/containerd/containerd/errdefs.init
    /go/pkg/mod/github.com/containerd/containerd@v1.4.4/errdefs/errors.go:45
    runtime.doInit
    /usr/local/go/src/runtime/proc.go:6265
    runtime.doInit
    /usr/local/go/src/runtime/proc.go:6242
    runtime.doInit
    /usr/local/go/src/runtime/proc.go:6242
    runtime.doInit
    /usr/local/go/src/runtime/proc.go:6242
    runtime.doInit
    /usr/local/go/src/runtime/proc.go:6242
    runtime.main
    /usr/local/go/src/runtime/proc.go:208
    runtime.goexit
    /usr/local/go/src/runtime/asm_amd64.s:1371
    container \"f8e217dcebd318d4f6f37c8601d80bddc1cb40edb7a3262bff2df729a7a892e0\" in namespace \"k8s.io\"
    github.com/containerd/containerd/errdefs.FromGRPC
    /go/pkg/mod/github.com/containerd/containerd@v1.4.4/errdefs/grpc.go:107
    github.com/containerd/containerd.(*remoteContainers).Get
    /go/pkg/mod/github.com/containerd/containerd@v1.4.4/containerstore.go:50
    github.com/draganm/missing-container-metrics/containerd.HandleContainerd.func1
    /missing-container-metrics/containerd/handle_containerd.go:29
    github.com/draganm/missing-container-metrics/containerd.(*eventHandler).getOrCreateContainer
    /missing-container-metrics/containerd/event_handler.go:106
    github.com/draganm/missing-container-metrics/containerd.(*eventHandler).handle
    /missing-container-metrics/containerd/event_handler.go:156
    github.com/draganm/missing-container-metrics/containerd.HandleContainerd
    /missing-container-metrics/containerd/handle_containerd.go:62
    main.main.func1.2
    /missing-container-metrics/main.go:64
    runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1371","container_id":"f8e217dcebd318d4f6f37c8601d80bddc1cb40edb7a3262bff2df729a7a892e0"}
fransguelinckx commented 2 years ago

My mistake, misconfigured containerd when it should have been docker 😳