Skip to content

Commit

Permalink
Moved debug errors to warnings (#1810)
Browse files Browse the repository at this point in the history
  • Loading branch information
brushknight authored Feb 13, 2024
1 parent 863f924 commit d05f4eb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions pkg/metrics/container_sampler.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ func GetContainerSamplers(cacheTTL time.Duration, dockerAPIVersion, dockerContai
containerdSampler := NewContainerdSampler(cacheTTL, dockerContainerdNamespace)
if containerdSampler.Enabled() {
containerSamplers = append(containerSamplers, containerdSampler)
clog.Debug("containerd sampler enabled")

clog.Info("containerd sampler enabled")
}

dockerSampler := NewDockerSampler(cacheTTL, dockerAPIVersion)
if dockerSampler.Enabled() {
containerSamplers = append(containerSamplers, dockerSampler)
clog.Debug("docker sampler enabled")

clog.Info("docker sampler enabled")
}

return containerSamplers
Expand Down
4 changes: 2 additions & 2 deletions pkg/metrics/containerd_sampler.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var (
cslog = log.WithComponent("ContainerdSampler") //nolint:gochecknoglobals

errContainerdSampler = errors.New("containerd sampler")
errInitializeContainerd = errors.New("unable to initialize containerd client")
errInitializeContainerd = errors.New("unable to initialize containerd client, could be not installed on the host")
errCannotGetPids = errors.New("unable to get pids for container")
errCannotGetTask = errors.New("unable to get task for container")
errCannotGetContainerInfo = errors.New("unable to get container info")
Expand Down Expand Up @@ -71,7 +71,7 @@ func (d *ContainerdSampler) Enabled() bool {

d.containerdClient, err = initializeContainerdClient()
if err != nil {
cslog.WithError(err).Debug(errInitializeContainerd.Error())
cslog.WithError(err).Warn(errInitializeContainerd.Error())

return false
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/metrics/docker_sampler.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (d *DockerSampler) Enabled() bool {

d.dockerClient, err = initializeDockerClient(d.apiVersion)
if err != nil {
dslog.WithError(err).Debug("Unable to initialize docker client.")
dslog.WithError(err).Warn("unable to initialize docker client, could be not installed on the host")

return false
}
Expand Down

0 comments on commit d05f4eb

Please sign in to comment.