Commit Graph

16339 Commits

Author SHA1 Message Date
Drew Bailey
bb2a7f4338 address feedback, fix gauge metric name 2019-11-05 09:51:57 -05:00
Drew Bailey
4f618eb1e3 simplify assert message 2019-11-05 09:51:56 -05:00
Drew Bailey
dc977dc8e6 move forwarded monitor request into helper 2019-11-05 09:51:56 -05:00
Drew Bailey
676800f03a address feedback 2019-11-05 09:51:56 -05:00
Drew Bailey
8423ccf890 allow more time for streaming message
remove unused struct
2019-11-05 09:51:55 -05:00
Drew Bailey
f74bd99b2a monitor command takes no args
rm extra new line

fix lint errors

return after close

fix, simplify test
2019-11-05 09:51:55 -05:00
Drew Bailey
9a96c10d4c moving endpoints over to frames 2019-11-05 09:51:54 -05:00
Drew Bailey
f8eaf1f5af lock in sub select
rm redundant lock

wip to use framing

wip switch to stream frames
2019-11-05 09:51:54 -05:00
Drew Bailey
58117c03c4 fix deadlock issue, switch to frames envelope 2019-11-05 09:51:54 -05:00
Drew Bailey
873969cf41 return 400 if invalid log_json param is given
Addresses feedback around monitor implementation

subselect on stopCh to prevent blocking forever.

Set up a separate goroutine to check every 3 seconds for dropped
messages.

rename returned ch to avoid confusion
2019-11-05 09:51:53 -05:00
Drew Bailey
6bf8617d02 rename function, initialize log level better
underscores instead of dashes for query params
2019-11-05 09:51:53 -05:00
Drew Bailey
1176fc0227 address feedback, use agent_endpoint instead of monitor 2019-11-05 09:51:53 -05:00
Drew Bailey
a72bd5cf65 use channel instead of empty string to determine close 2019-11-05 09:51:52 -05:00
Drew Bailey
9bb606a0ae update go-hclog dep
remove duplicate lock
2019-11-05 09:51:52 -05:00
Drew Bailey
92d6a30f86 agent:read acl policy for monitor 2019-11-05 09:51:52 -05:00
Drew Bailey
c8d60dd6f9 only look up rpchandler for node if we have nodeid
fix some comments and nomad monitor -h output
2019-11-05 09:51:51 -05:00
Drew Bailey
cd60628b31 rpc acl tests for both monitor endpoints 2019-11-05 09:51:51 -05:00
Drew Bailey
735530ca4f client monitor endpoint tests 2019-11-05 09:51:50 -05:00
Drew Bailey
3c0082f132 use intercepting loggers for rpchandlers 2019-11-05 09:51:50 -05:00
Drew Bailey
2362008e74 new hclog with standardlogger intercept 2019-11-05 09:51:49 -05:00
Drew Bailey
e7589301ea enable json formatting, use queryoptions 2019-11-05 09:51:49 -05:00
Drew Bailey
8095b4868a New monitor pkg for shared monitor functionality
Adds new package that can be used by client and server RPC endpoints to
facilitate monitoring based off of a logger

clean up old code

small comment about write

rm old comment about minsize

rename to Monitor

Removes connection logic from monitor command

Keep connection logic in endpoints, use a channel to send results from
monitoring

use new multisink logger and interfaces

small test for dropped messages

update go-hclogger and update sink/intercept logger interfaces
2019-11-05 09:51:49 -05:00
Drew Bailey
890b8a43fb get local rpc endpoint working 2019-11-05 09:51:48 -05:00
Drew Bailey
12819975ee remove log_writer
prefix output with proper spacing

update gzip handler, adjust first byte flow to allow gzip handler bypass

wip, first stab at wiring up rpc endpoint
2019-11-05 09:51:48 -05:00
Drew Bailey
a828c92403 Display error when remote side ended monitor
multisink logger

remove usage of logwriter
2019-11-05 09:51:48 -05:00
Drew Bailey
74cfdf55bb Adds nomad monitor command
Adds nomad monitor command. Like consul monitor, this command allows you
to stream logs from a nomad agent in real time with a a specified log
level

add endpoint tests

Upgrade go-hclog to latest version

The current version of go-hclog pads log prefixes to equal lengths
so info becomes [INFO ] and debug becomes [DEBUG]. This breaks
hashicorp/logutils/level.go Check function. Upgrading to the latest
version removes this padding and fixes log filtering that uses logutils
Check
2019-11-05 09:51:47 -05:00
Drew Bailey
dc3286481a Add Agent Monitor to receive streaming logs
Queries /v1/agent/monitor and receives streaming logs from client
2019-11-05 09:51:47 -05:00
Drew Bailey
91c0184773 Adds AgentMonitor Endpoint
AgentMonitor is an endpoint to stream logs for a given agent. It allows
callers to pass in a supplied log level, which may be different than the
agents config allowing for temporary debugging with lower log levels.

Pass in logWriter when setting up Agent
2019-11-05 09:51:46 -05:00
Drew Bailey
5e03fec048 Update gziphandler to latest version
This version of gziphandler includes a fix that fixes GzipResponseWriter
to implement CloseNotifier

https://github.com/nytimes/gziphandler/pull/63
2019-11-05 09:51:46 -05:00
Michael Schurter
1848073a62 Merge pull request #6617 from hashicorp/docs-0.10.1
docs: bump website to Nomad 0.10.1
2019-11-04 12:46:39 -08:00
Michael Schurter
381cdb6526 docs: bump website to Nomad 0.10.1 2019-11-04 12:01:43 -08:00
Michael Schurter
bba4f4c495 Merge pull request #6616 from hashicorp/release-0101
Release 0101
2019-11-04 12:00:31 -08:00
Michael Schurter
fa96554ba9 Merge branch 'master' into release-0101 2019-11-04 11:57:12 -08:00
Michael Schurter
e45f28840b release: prep for 0.10.2-dev 2019-11-04 19:45:40 +00:00
Drew Bailey
d77e47d562 Merge pull request #6615 from hashicorp/6609-changelog
add bug 6609 to changelog
2019-11-04 14:34:27 -05:00
Michael Schurter
8aab33b63b Release v0.10.1 2019-11-04 19:29:55 +00:00
Drew Bailey
e02b4c131c add bug 6609 to changelog 2019-11-04 10:29:33 -05:00
Drew Bailey
b20fb9e7bb Merge pull request #6609 from hashicorp/b-alloc-status-consistency
Prevent nomad alloc status output inconsistency
2019-11-04 10:12:04 -05:00
Nomad Release bot
0d4e5d949f Generate files for 0.10.1 release 2019-11-01 21:57:51 +00:00
Michael Schurter
b74146ef82 docs: update changelog
Remove 0.10.1 release date until finalizing release
2019-11-01 14:34:18 -07:00
Michael Schurter
4dee31eec1 Merge pull request #6605 from hashicorp/b-allocres-panic
client: fix panic from 0.8 -> 0.10 upgrade
2019-11-01 14:33:19 -07:00
Michael Schurter
179b8f457e Merge pull request #6605 from hashicorp/b-allocres-panic
client: fix panic from 0.8 -> 0.10 upgrade
2019-11-01 12:58:59 -07:00
Tim Gross
9b4e22a836 docs: note bridge-nf-call-iptables requirement for Connect (#6607)
The Connect integration uses bridge networking and iptables to send
traffic between containers, but the RedHat family of Linux distros
sets some of the kernel tunables this requires to be optimized for VMs
rather than containers. We can document this behavior for now and
consider better operator feedback for pre-flight checking later.
2019-11-01 14:41:21 -04:00
Drew Bailey
6980ab0a81 Prevent nomad alloc status output inconsistency
Prevent random map ordering and sort alphabetically

better variable name
2019-11-01 14:01:32 -04:00
Michael Schurter
0fcb0d4016 client: fix panic from 0.8 -> 0.10 upgrade
makeAllocTaskServices did not do a nil check on AllocatedResources
which causes a panic when upgrading directly from 0.8 to 0.10. While
skipping 0.9 is not supported we intend to fix serious crashers caused
by such upgrades to prevent cluster outages.

I did a quick audit of the client package and everywhere else that
accesses AllocatedResources appears to be properly guarded by a nil
check.
2019-11-01 07:47:03 -07:00
Michael Schurter
cd16a7c177 docs: prep changelog for 0.10.1 release 2019-10-31 09:19:04 -07:00
Mahmood Ali
d64bffbf3b Merge pull request #6575 from hashicorp/b-gh-6571-missing-service-network
Fix some connect connect validation
2019-10-31 08:57:44 -07:00
Michael Schurter
7a5640874a Merge pull request #6541 from hashicorp/release-0100-net-panic
core: fix panic when AllocatedResources is nil
2019-10-31 08:49:01 -07:00
Michael Schurter
20bb9f04d5 Merge pull request #6541 from hashicorp/release-0100-net-panic
core: fix panic when AllocatedResources is nil
2019-10-31 08:46:34 -07:00
Lars Lehtonen
d0d18b2a85 client/allocwatcher: fix dropped test error (#6592) 2019-10-31 08:29:25 -04:00