Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asset-manager doesn't warn when assets can't be satisfied #3391

Open
FredrikWendt opened this issue Nov 10, 2019 · 0 comments
Open

asset-manager doesn't warn when assets can't be satisfied #3391

FredrikWendt opened this issue Nov 10, 2019 · 0 comments
Labels

Comments

@FredrikWendt
Copy link

@FredrikWendt FredrikWendt commented Nov 10, 2019

After adding an asset to the Sensu backend, and creating a check specifying that asset as a runtime_asset, when (if and only if) the agent's asset-manager fails to fetch said runtime_asset, the logging of this error should not be done on DEBUG level.

Is this a bug?
Yes, the agent has two primary tasks (kind of):

  1. execute checks to generate events
  2. get those events to the

Currently, when the agent fails to do number 1 (run checks), it should at least WARN when it can't carry out the primary task it's tasked to do.

This is related to #3191, but not identical. This ticket is about the current buggy behavior, and #3191 want's to expand the asset-manager's features.

Expected Behavior

If an agent is tasked with running a check, but the runtime_assets can't be satisfied, a WARNING or ERROR level logging statement appears, so an admin can easily detect the configuration issue.

Current Behavior

nov 10 10:12:18 lx1carbon sensu-agent[21551]: {"asset":"sensu-ruby-runtime","component":"asset-manager","entity":"lx1carbon","filter":["entity.system.os == 'linux'","entity.system.arch == 'amd64'","entity.system.platform_family == 'debian'"],"level":"debug","msg":"entity filtered, installing asset build","time":"2019-11-10T10:12:18+01:00"}

In order to detect these issues, an admin has to change the logging level on the agent to DEBUG, such as using log-level: "debug" in /etc/sensu/agent.yml.

Possible Solution

Change the asset-managers code that logs, from "level":"debug" to "level":"warning".

Steps to Reproduce (for bugs)

  1. Create an agent running on Ubuntu, with subscriptions: ["ubuntu"], and logging set to "debug" level.
  2. Add an asset only available on CentOS
  3. Create a check with runtime_assets: ["the asset from 2"] and subscriptions: ["ubuntu"]
  4. Watch the agent's log.

Context

n/a

Your Environment

Agent and sensuctl:

$ apt show sensu-go-agent
Package: sensu-go-agent
Version: 5.14.2-7022
Priority: optional
Section: Network
Maintainer: Sensu, Inc. <support@sensu.io>
Installed-Size: 23,0 MB
Homepage: https://sensu.io
Download-Size: 8 057 kB
APT-Manual-Installed: yes
APT-Sources: https://packagecloud.io/sensu/stable/ubuntu xenial/main amd64 Packages
Description: Sensu Go Agent

$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.6 LTS"

$ dpkg -S $(which sensuctl)
sensu-go-cli: /usr/bin/sensuctl

$ apt show sensu-go-cli
Package: sensu-go-cli
Version: 5.14.2-7022
Priority: optional
Section: Network
Maintainer: Sensu, Inc. <support@sensu.io>
Installed-Size: 21,0 MB
Homepage: https://sensu.io
Download-Size: 7 451 kB
APT-Manual-Installed: yes
APT-Sources: https://packagecloud.io/sensu/stable/ubuntu xenial/main amd64 Packages
Description: Sensu Go CLI tools

Sensu backend:

$ docker pull sensu/sensu
Using default tag: latest
latest: Pulling from sensu/sensu
Digest: sha256:de52abf622b702ee0b2d3776d6f58d6845610350404516d32adf4ff426855676
Status: Image is up to date for sensu/sensu:latest
docker.io/sensu/sensu:latest

$ docker exec -it sensu-wendt-vpn_backend_1 /bin/sh
/ # sensu-backend version
sensu-backend version 5.14.2#19d57bb, build 19d57bbc29aac477ea98491c4c05b6790bf18dea, built 2019-11-04T21:20:59Z
@echlebek echlebek added the triage label Nov 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.