dwbutler / logstash-logger

Ruby logger that writes logstash events
MIT License
455 stars 118 forks source link

Logstash HTTP Device #163

Open hle-skillz opened 3 years ago

hle-skillz commented 3 years ago

Fixes #135.

Rudimentary HTTP Device that relies on buffering (inherits Connectable) rather than persistent HTTP connections (no-op connect) for efficiency.

Existing framework code inconveniently deleted uri and type options: https://github.com/dwbutler/logstash-logger/blob/b8f5403c44150f10d15b01133f8b6d1e9eb31806/lib/logstash-logger/device.rb#L30-L35

so I had to use parameter name url to allow simple configuration relying on Net::HTTP to auto-detect SSL, otherwise this could've been a one-liner setup:

LogStashLogger.new uri: 'https://logstash.example.com'
codecov-commenter commented 3 years ago

Codecov Report

Merging #163 into master will decrease coverage by 0.13%. The diff coverage is 95.65%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #163      +/-   ##
==========================================
- Coverage   92.68%   92.54%   -0.14%     
==========================================
  Files          64       66       +2     
  Lines        1668     1691      +23     
==========================================
+ Hits         1546     1565      +19     
- Misses        122      126       +4     
Impacted Files Coverage Δ
lib/logstash-logger/device/http.rb 93.33% <93.33%> (ø)
lib/logstash-logger/device.rb 98.07% <100.00%> (+0.07%) :arrow_up:
spec/device/http_spec.rb 100.00% <100.00%> (ø)
lib/logstash-logger/device/kinesis.rb 88.88% <0.00%> (-5.56%) :arrow_down:
lib/logstash-logger/device/firehose.rb 88.88% <0.00%> (-5.56%) :arrow_down:
lib/logstash-logger/device/tcp.rb 94.11% <0.00%> (-1.97%) :arrow_down:

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 b8f5403...243745f. Read the comment docs.