docker-archive / deploykit

A toolkit for creating and managing declarative, self-healing infrastructure.
Apache License 2.0
2.25k stars 262 forks source link

Cleanup index error logging in ingress and enroller #832

Closed kaufers closed 6 years ago

kaufers commented 6 years ago

Currently, the entire instance.Description object is logged, this includes all of the instance.Properties which is quite big (do to a long userdata boot script).

Instead of printing out the entire object, this commit updates the error message to print out the instance.ID, and the instance.Tags (which is enough to identity the instance).

The error messages pretty clearly show the reason for the parse error, there is no need to print out the entire instance.Properties. Some example errors are:

template: file://localhost/infrakit_files/:1:41: executing \"file://localhost/infrakit_files/\" at <$x.ipv4_address_priv...>: map has no entry for key \"ipv4_address_private\"
template: file://localhost/infrakit_files/:1:45: executing \"file://localhost/infrakit_files/\" at <$x.id>: map has no entry for key \"id\"
kaufers commented 6 years ago

An example of the updated message:

EROR[01-11|17:28:14] cannot index entry                       module=controller/ingress instance.ID=instance-1515691603 instance.tags="map[infrakit-link-created:2018-01-11t17:26:43z infrakit.config_sha:fbjqqkmhtgi5noj5flvnre5o4cvcipq2 infrakit.group:workers name:instance-1515691603 swarm-id:l677dpzr9hghuxis2nk25soxc infrakit-link:a18mvwb0tda932wk infrakit-link-context:swarm::l677dpzr9hghuxis2nk25soxc::worker]" err="template: file://localhost/infrakit_files/:1:41: executing \"file://localhost/infrakit_files/\" at <$x.ipv4_address_priv...>: map has no entry for key \"ipv4_address_private\"" meta="{Identity:<nil> Name:d4ic-lb Tags:map[project:d4ic user:d4ic-user]}"
codecov[bot] commented 6 years ago

Codecov Report

Merging #832 into master will increase coverage by 0.02%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #832      +/-   ##
==========================================
+ Coverage    48.2%   48.23%   +0.02%     
==========================================
  Files          89       89              
  Lines        7974     7974              
==========================================
+ Hits         3844     3846       +2     
+ Misses       3772     3771       -1     
+ Partials      358      357       -1
Impacted Files Coverage Δ
pkg/types/spec.go 60.17% <0%> (+1.76%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6288320...11155e6. Read the comment docs.