@Override public void onException(Exception exception) { log.error("Detected exception while retrieving Windows Performance Counters from entity " + entity.getDisplayName(), exception); for (AttributeSensor attribute : sensorMap.values()) { entity.setAttribute(attribute, null); } } }
@Override public void onException(Exception exception) { log.error("Detected exception while retrieving Chef attributes from entity " + entity.getDisplayName(), exception); for (AttributeSensor attribute : chefAttributeSensors.values()) { if (!attribute.getName().startsWith(CHEF_ATTRIBUTE_PREFIX)) continue; entity.setAttribute(attribute, null); } } }
} catch(IllegalArgumentException e) { log.error("Entity {}: bad Chef attribute {} for sensor {}: {}", new Object[]{ entity.getDisplayName(), Joiner.on('.').join(prefixedPath), sensor.getName(), entity.getDisplayName(), Joiner.on('.').join(prefixedPath), sensor.getName(), } else { log.debug("Entity {}: no Chef attribute matching {}; setting sensor {} to null", new Object[]{ entity.getDisplayName(), chefAttributeName, sensor.getName()});