logstash-output-scalyr 0.1.9 → 0.1.14.beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/Gemfile +5 -0
- data/README.md +2 -2
- data/lib/logstash/outputs/scalyr.rb +265 -142
- data/lib/scalyr/common/client.rb +80 -57
- data/lib/scalyr/common/util.rb +7 -0
- data/lib/scalyr/constants.rb +2 -0
- data/logstash-output-scalyr.gemspec +1 -1
- data/spec/logstash/outputs/scalyr_integration_spec.rb +187 -8
- data/spec/logstash/outputs/scalyr_spec.rb +12 -6
- data/vendor/bundle/jruby/2.5.0/cache/addressable-2.7.0.gem +0 -0
- data/vendor/bundle/jruby/2.5.0/cache/crack-0.4.5.gem +0 -0
- data/vendor/bundle/jruby/2.5.0/cache/hashdiff-1.0.1.gem +0 -0
- data/vendor/bundle/jruby/2.5.0/cache/public_suffix-4.0.6.gem +0 -0
- data/vendor/bundle/jruby/2.5.0/cache/rexml-3.2.5.gem +0 -0
- data/vendor/bundle/jruby/2.5.0/cache/webmock-3.13.0.gem +0 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/CHANGELOG.md +235 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/Gemfile +32 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/LICENSE.txt +202 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/README.md +121 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/Rakefile +34 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/data/unicode.data +0 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable.rb +4 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable/idna.rb +27 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable/idna/native.rb +61 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable/idna/pure.rb +676 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable/template.rb +1045 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable/uri.rb +2529 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable/version.rb +32 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/addressable/idna_spec.rb +300 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/addressable/net_http_compat_spec.rb +30 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/addressable/rack_mount_compat_spec.rb +106 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/addressable/security_spec.rb +59 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/addressable/template_spec.rb +1451 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/addressable/uri_spec.rb +6603 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/spec_helper.rb +24 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/tasks/clobber.rake +4 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/tasks/gem.rake +93 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/tasks/git.rake +47 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/tasks/metrics.rake +24 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/tasks/rspec.rake +23 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/tasks/yard.rake +29 -0
- data/vendor/bundle/jruby/2.5.0/gems/crack-0.4.5/lib/crack.rb +7 -0
- data/vendor/bundle/jruby/2.5.0/gems/crack-0.4.5/lib/crack/json.rb +98 -0
- data/vendor/bundle/jruby/2.5.0/gems/crack-0.4.5/lib/crack/util.rb +17 -0
- data/vendor/bundle/jruby/2.5.0/gems/crack-0.4.5/lib/crack/version.rb +3 -0
- data/vendor/bundle/jruby/2.5.0/gems/crack-0.4.5/lib/crack/xml.rb +238 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/Gemfile +8 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/LICENSE +19 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/README.md +276 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/Rakefile +18 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/changelog.md +100 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/hashdiff.gemspec +39 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff.rb +10 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/compare_hashes.rb +69 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/diff.rb +177 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/lcs.rb +66 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/lcs_compare_arrays.rb +32 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/linear_compare_array.rb +159 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/patch.rb +88 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/util.rb +155 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/version.rb +5 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/best_diff_spec.rb +75 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/diff_array_spec.rb +60 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/diff_spec.rb +360 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/lcs_spec.rb +76 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/linear_compare_array_spec.rb +50 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/patch_spec.rb +185 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/readme_spec.rb +15 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/util_spec.rb +116 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/spec_helper.rb +15 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/2.0-Upgrade.md +52 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/CHANGELOG.md +406 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/Gemfile +15 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/LICENSE.txt +22 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/README.md +207 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/Rakefile +51 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/SECURITY.md +104 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/bin/console +15 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/codecov.yml +12 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/data/list.txt +13380 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/lib/public_suffix.rb +179 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/lib/public_suffix/domain.rb +235 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/lib/public_suffix/errors.rb +41 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/lib/public_suffix/list.rb +247 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/lib/public_suffix/rule.rb +350 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/lib/public_suffix/version.rb +13 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/public_suffix.gemspec +29 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/acceptance_test.rb +131 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/benchmarks/bm_find.rb +66 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/benchmarks/bm_find_all.rb +102 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/benchmarks/bm_names.rb +91 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/benchmarks/bm_select.rb +26 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/benchmarks/bm_select_incremental.rb +25 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/benchmarks/bm_valid.rb +101 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/profilers/domain_profiler.rb +12 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/profilers/find_profiler.rb +12 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/profilers/find_profiler_jp.rb +12 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/profilers/initialization_profiler.rb +11 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/profilers/list_profsize.rb +11 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/profilers/object_binsize.rb +57 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/psl_test.rb +52 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/test_helper.rb +18 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/tests.txt +98 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/unit/domain_test.rb +106 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/unit/errors_test.rb +25 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/unit/list_test.rb +241 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/unit/public_suffix_test.rb +188 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/unit/rule_test.rb +222 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/LICENSE.txt +22 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/NEWS.md +178 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/README.md +48 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/context.rdoc +143 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/rdoc/child.rdoc +87 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/rdoc/document.rdoc +276 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/rdoc/element.rdoc +602 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/rdoc/node.rdoc +97 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/rdoc/parent.rdoc +267 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/tocs/child_toc.rdoc +12 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/tocs/document_toc.rdoc +30 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/tocs/element_toc.rdoc +55 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/tocs/master_toc.rdoc +135 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/tocs/node_toc.rdoc +16 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/tocs/parent_toc.rdoc +25 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml.rb +3 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/attlistdecl.rb +63 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/attribute.rb +205 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/cdata.rb +68 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/child.rb +97 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/comment.rb +80 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/doctype.rb +311 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/document.rb +451 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/dtd/attlistdecl.rb +11 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/dtd/dtd.rb +47 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/dtd/elementdecl.rb +18 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/dtd/entitydecl.rb +57 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/dtd/notationdecl.rb +40 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/element.rb +2599 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/encoding.rb +51 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/entity.rb +171 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/formatters/default.rb +116 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/formatters/pretty.rb +142 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/formatters/transitive.rb +58 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/functions.rb +447 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/instruction.rb +79 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/light/node.rb +188 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/namespace.rb +59 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/node.rb +76 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/output.rb +30 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parent.rb +166 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parseexception.rb +52 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb +694 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/lightparser.rb +59 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/pullparser.rb +197 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/sax2parser.rb +273 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/streamparser.rb +61 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/treeparser.rb +101 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/ultralightparser.rb +57 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/xpathparser.rb +689 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/quickpath.rb +266 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/rexml.rb +37 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/sax2listener.rb +98 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/security.rb +28 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/source.rb +298 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/streamlistener.rb +93 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/text.rb +424 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/undefinednamespaceexception.rb +9 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/validation/relaxng.rb +539 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/validation/validation.rb +144 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/validation/validationexception.rb +10 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/xmldecl.rb +130 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/xmltokens.rb +85 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/xpath.rb +81 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/xpath_parser.rb +974 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/CHANGELOG.md +1894 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/Gemfile +9 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/LICENSE +20 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/README.md +1176 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/Rakefile +38 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock.rb +59 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/api.rb +109 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/assertion_failure.rb +11 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/callback_registry.rb +35 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/config.rb +18 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/cucumber.rb +10 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/deprecation.rb +9 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/errors.rb +17 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/async_http_client_adapter.rb +216 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/curb_adapter.rb +351 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/em_http_request_adapter.rb +231 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/excon_adapter.rb +165 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_lib_adapter.rb +7 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb +19 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_rb/client.rb +17 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_rb/request.rb +16 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_rb/response.rb +64 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_rb/streamer.rb +29 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_rb/webmock.rb +68 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_rb_adapter.rb +37 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/httpclient_adapter.rb +259 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/manticore_adapter.rb +145 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/net_http.rb +385 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/net_http_response.rb +34 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/patron_adapter.rb +130 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb +174 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/matchers/any_arg_matcher.rb +13 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/matchers/hash_argument_matcher.rb +21 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/matchers/hash_excluding_matcher.rb +15 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/matchers/hash_including_matcher.rb +17 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/minitest.rb +41 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rack_response.rb +69 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_body_diff.rb +64 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_execution_verifier.rb +77 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_pattern.rb +405 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_registry.rb +35 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_signature.rb +54 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_signature_snippet.rb +61 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_stub.rb +100 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/response.rb +159 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/responses_sequence.rb +40 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rspec.rb +42 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rspec/matchers.rb +27 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rspec/matchers/request_pattern_matcher.rb +78 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rspec/matchers/webmock_matcher.rb +67 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/stub_registry.rb +82 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/stub_request_snippet.rb +38 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/test_unit.rb +20 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/hash_counter.rb +39 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/hash_keys_stringifier.rb +25 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/hash_validator.rb +17 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/headers.rb +64 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/json.rb +67 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/query_mapper.rb +281 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/uri.rb +111 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/values_stringifier.rb +20 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/version_checker.rb +111 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/version.rb +3 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/webmock.rb +163 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/minitest/test_helper.rb +34 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/minitest/test_webmock.rb +9 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/minitest/webmock_spec.rb +60 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/async_http_client/async_http_client_spec.rb +375 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/async_http_client/async_http_client_spec_helper.rb +73 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/curb/curb_spec.rb +499 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/curb/curb_spec_helper.rb +147 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/em_http_request/em_http_request_spec.rb +462 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/em_http_request/em_http_request_spec_helper.rb +77 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/excon/excon_spec.rb +77 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/excon/excon_spec_helper.rb +52 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/http_rb/http_rb_spec.rb +93 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/http_rb/http_rb_spec_helper.rb +54 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/httpclient/httpclient_spec.rb +217 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/httpclient/httpclient_spec_helper.rb +57 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/manticore/manticore_spec.rb +107 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/manticore/manticore_spec_helper.rb +35 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/net_http/net_http_shared.rb +153 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/net_http/net_http_spec.rb +369 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/net_http/net_http_spec_helper.rb +64 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/net_http/real_net_http_spec.rb +20 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/patron/patron_spec.rb +125 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/patron/patron_spec_helper.rb +54 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/allowing_and_disabling_net_connect.rb +313 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/callbacks.rb +148 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/complex_cross_concern_behaviors.rb +36 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/enabling_and_disabling_webmock.rb +95 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/precedence_of_stubs.rb +15 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/request_expectations.rb +930 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/returning_declared_responses.rb +409 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/stubbing_requests.rb +678 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/typhoeus/typhoeus_hydra_spec.rb +135 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/typhoeus/typhoeus_hydra_spec_helper.rb +60 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/webmock_shared.rb +41 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/fixtures/test.txt +1 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/quality_spec.rb +84 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/spec_helper.rb +48 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/support/example_curl_output.txt +22 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/support/failures.rb +9 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/support/my_rack_app.rb +53 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/support/network_connection.rb +19 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/support/webmock_server.rb +70 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/api_spec.rb +175 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/errors_spec.rb +129 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/http_lib_adapters/http_lib_adapter_registry_spec.rb +17 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/http_lib_adapters/http_lib_adapter_spec.rb +12 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/matchers/hash_excluding_matcher_spec.rb +61 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/matchers/hash_including_matcher_spec.rb +87 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/rack_response_spec.rb +112 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_body_diff_spec.rb +90 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_execution_verifier_spec.rb +208 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_pattern_spec.rb +736 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_registry_spec.rb +95 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_signature_snippet_spec.rb +89 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_signature_spec.rb +155 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_stub_spec.rb +199 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/response_spec.rb +286 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/stub_registry_spec.rb +103 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/stub_request_snippet_spec.rb +115 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/hash_counter_spec.rb +39 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/hash_keys_stringifier_spec.rb +27 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/headers_spec.rb +28 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/json_spec.rb +33 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/query_mapper_spec.rb +157 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/uri_spec.rb +371 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/version_checker_spec.rb +65 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/webmock_spec.rb +60 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/test/http_request.rb +24 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/test/shared_test.rb +108 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/test/test_helper.rb +23 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/test/test_webmock.rb +12 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/webmock.gemspec +54 -0
- data/vendor/bundle/jruby/2.5.0/specifications/addressable-2.7.0.gemspec +39 -0
- data/vendor/bundle/jruby/2.5.0/specifications/crack-0.4.5.gemspec +32 -0
- data/vendor/bundle/jruby/2.5.0/specifications/hashdiff-1.0.1.gemspec +46 -0
- data/vendor/bundle/jruby/2.5.0/specifications/public_suffix-4.0.6.gemspec +24 -0
- data/vendor/bundle/jruby/2.5.0/specifications/rexml-3.2.5.gemspec +42 -0
- data/vendor/bundle/jruby/2.5.0/specifications/webmock-3.13.0.gemspec +85 -0
- metadata +311 -4
data/lib/scalyr/common/client.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require "scalyr/constants"
|
2
|
+
|
1
3
|
module Scalyr; module Common; module Client
|
2
4
|
|
3
5
|
#---------------------------------------------------------------------------------------------------------------------
|
@@ -5,13 +7,14 @@ module Scalyr; module Common; module Client
|
|
5
7
|
#---------------------------------------------------------------------------------------------------------------------
|
6
8
|
class ServerError < StandardError
|
7
9
|
|
8
|
-
attr_reader :code, :url, :body
|
10
|
+
attr_reader :code, :url, :body, :e_class
|
9
11
|
|
10
|
-
def initialize(msg=nil, code=nil, url=nil, body=nil)
|
12
|
+
def initialize(msg=nil, code=nil, url=nil, body=nil, e_class="Scalyr::Common::Client::ServerError")
|
11
13
|
super(msg)
|
12
14
|
@code = code.to_i
|
13
15
|
@url = url
|
14
16
|
@body = body
|
17
|
+
@e_class = e_class
|
15
18
|
end
|
16
19
|
|
17
20
|
def is_commonly_retried?
|
@@ -31,13 +34,14 @@ end
|
|
31
34
|
#---------------------------------------------------------------------------------------------------------------------
|
32
35
|
class ClientError < StandardError
|
33
36
|
|
34
|
-
attr_reader :code, :url, :body
|
37
|
+
attr_reader :code, :url, :body, :e_class
|
35
38
|
|
36
|
-
def initialize(msg=nil, url=nil)
|
39
|
+
def initialize(msg=nil, url=nil, e_class="Scalyr::Common::Client::ClientError")
|
37
40
|
super(msg)
|
38
41
|
@code = nil # currently no way to get this from Net::HTTP::Persistent::Error
|
39
42
|
@url = url
|
40
43
|
@body = nil
|
44
|
+
@e_class = e_class
|
41
45
|
end
|
42
46
|
|
43
47
|
def is_commonly_retried?
|
@@ -52,8 +56,9 @@ end
|
|
52
56
|
class ClientSession
|
53
57
|
|
54
58
|
def initialize(logger, add_events_uri, compression_type, compression_level,
|
55
|
-
ssl_verify_peer, ssl_ca_bundle_path,
|
56
|
-
record_stats_for_status, flush_quantile_estimates_on_status_send
|
59
|
+
ssl_verify_peer, ssl_ca_bundle_path, append_builtin_cert,
|
60
|
+
record_stats_for_status, flush_quantile_estimates_on_status_send,
|
61
|
+
connect_timeout, socket_timeout, request_timeout, pool_max, pool_max_per_route)
|
57
62
|
@logger = logger
|
58
63
|
@add_events_uri = add_events_uri # typically /addEvents
|
59
64
|
@compression_type = compression_type
|
@@ -61,9 +66,13 @@ class ClientSession
|
|
61
66
|
@ssl_verify_peer = ssl_verify_peer
|
62
67
|
@ssl_ca_bundle_path = ssl_ca_bundle_path
|
63
68
|
@append_builtin_cert = append_builtin_cert
|
64
|
-
@ssl_verify_depth = ssl_verify_depth
|
65
69
|
@record_stats_for_status = record_stats_for_status
|
66
70
|
@flush_quantile_estimates_on_status_send = flush_quantile_estimates_on_status_send
|
71
|
+
@connect_timeout = connect_timeout
|
72
|
+
@socket_timeout = socket_timeout
|
73
|
+
@request_timeout = request_timeout
|
74
|
+
@pool_max = pool_max
|
75
|
+
@pool_max_per_route = pool_max_per_route
|
67
76
|
|
68
77
|
# A cert to use by default to avoid issues caused by the OpenSSL library not validating certs according to standard
|
69
78
|
@cert_string = "" \
|
@@ -126,11 +135,29 @@ class ClientSession
|
|
126
135
|
:compression_type => @compression_type,
|
127
136
|
:compression_level => @compression_level,
|
128
137
|
}
|
138
|
+
end # def initialize
|
129
139
|
|
130
|
-
|
140
|
+
def client_config
|
141
|
+
# TODO: Eventually expose some more of these as config options, though nothing here really needs tuning normally
|
142
|
+
# besides SSL
|
143
|
+
c = {
|
144
|
+
connect_timeout: @connect_timeout,
|
145
|
+
socket_timeout: @socket_timeout,
|
146
|
+
request_timeout: @request_timeout,
|
147
|
+
follow_redirects: true,
|
148
|
+
automatic_retries: 1,
|
149
|
+
retry_non_idempotent: false,
|
150
|
+
check_connection_timeout: 200,
|
151
|
+
pool_max: @pool_max,
|
152
|
+
pool_max_per_route: @pool_max_per_route,
|
153
|
+
cookies: true,
|
154
|
+
keepalive: true,
|
155
|
+
ssl: {}
|
156
|
+
}
|
131
157
|
|
132
158
|
# verify peers to prevent potential MITM attacks
|
133
159
|
if @ssl_verify_peer
|
160
|
+
c[:ssl][:verify] = :strict
|
134
161
|
@ca_cert = Tempfile.new("ca_cert")
|
135
162
|
if File.file?(@ssl_ca_bundle_path)
|
136
163
|
@ca_cert.write(File.read(@ssl_ca_bundle_path))
|
@@ -142,13 +169,17 @@ class ClientSession
|
|
142
169
|
end
|
143
170
|
end
|
144
171
|
@ca_cert.flush
|
145
|
-
|
146
|
-
@http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
147
|
-
@http.verify_depth = @ssl_verify_depth
|
172
|
+
c[:ssl][:ca_file] = @ca_cert.path
|
148
173
|
else
|
149
|
-
|
174
|
+
c[:ssl][:verify] = :disable
|
150
175
|
end
|
151
|
-
|
176
|
+
|
177
|
+
c
|
178
|
+
end
|
179
|
+
|
180
|
+
def client
|
181
|
+
@client ||= Manticore::Client.new(client_config)
|
182
|
+
end
|
152
183
|
|
153
184
|
# Convenience method to create a fresh quantile estimator
|
154
185
|
def get_new_latency_stats
|
@@ -163,63 +194,54 @@ class ClientSession
|
|
163
194
|
|
164
195
|
# Get a clone of current statistics hash and calculate percentiles
|
165
196
|
def get_stats
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
@
|
183
|
-
|
197
|
+
@stats_lock.synchronize do
|
198
|
+
current_stats = @stats.clone
|
199
|
+
|
200
|
+
current_stats[:request_latency_p50] = @latency_stats[:request_latency_secs].query(0.5)
|
201
|
+
current_stats[:request_latency_p90] = @latency_stats[:request_latency_secs].query(0.9)
|
202
|
+
current_stats[:request_latency_p99] = @latency_stats[:request_latency_secs].query(0.99)
|
203
|
+
current_stats[:serialization_duration_secs_p50] = @latency_stats[:serialization_duration_secs].query(0.5)
|
204
|
+
current_stats[:serialization_duration_secs_p90] = @latency_stats[:serialization_duration_secs].query(0.9)
|
205
|
+
current_stats[:serialization_duration_secs_p99] = @latency_stats[:serialization_duration_secs].query(0.99)
|
206
|
+
current_stats[:compression_duration_secs_p50] = @latency_stats[:compression_duration_secs].query(0.5)
|
207
|
+
current_stats[:compression_duration_secs_p90] = @latency_stats[:compression_duration_secs].query(0.9)
|
208
|
+
current_stats[:compression_duration_secs_p99] = @latency_stats[:compression_duration_secs].query(0.99)
|
209
|
+
current_stats[:bytes_sent_p50] = @latency_stats[:bytes_sent].query(0.5)
|
210
|
+
current_stats[:bytes_sent_p90] = @latency_stats[:bytes_sent].query(0.9)
|
211
|
+
current_stats[:bytes_sent_p99] = @latency_stats[:bytes_sent].query(0.99)
|
212
|
+
|
213
|
+
if @flush_quantile_estimates_on_status_send
|
214
|
+
@logger.debug "Recreating / reseting quantile estimator classes for plugin metrics"
|
215
|
+
@latency_stats = get_new_latency_stats
|
216
|
+
end
|
217
|
+
current_stats
|
184
218
|
end
|
185
|
-
current_stats
|
186
219
|
end
|
187
220
|
|
188
221
|
|
189
222
|
|
190
223
|
# Upload data to Scalyr. Assumes that the body size complies with Scalyr limits
|
191
224
|
def post_add_events(body, is_status, body_serialization_duration = 0)
|
192
|
-
|
225
|
+
post_body, post_headers, compression_duration = prepare_post_object @add_events_uri.path, body
|
193
226
|
fail_count = 1 # putative assume failure
|
194
227
|
start_time = Time.now
|
195
228
|
uncompressed_bytes_sent = 0
|
196
229
|
compressed_bytes_sent = 0
|
197
230
|
bytes_received = 0
|
198
231
|
begin
|
199
|
-
response =
|
232
|
+
response = client.send(:post, @add_events_uri, body: post_body, headers: post_headers)
|
200
233
|
handle_response(response)
|
201
234
|
|
202
235
|
fail_count -= 1 # success means we negate the putative failure
|
203
236
|
uncompressed_bytes_sent = (body.bytesize + @add_events_uri.path.bytesize)
|
204
|
-
compressed_bytes_sent = (
|
237
|
+
compressed_bytes_sent = (post_body.bytesize + @add_events_uri.path.bytesize)
|
205
238
|
bytes_received = response.body.bytesize # echee: double check
|
206
239
|
# echee TODO add more statistics
|
207
240
|
|
208
|
-
rescue
|
209
|
-
if @ssl_verify_peer and @ssl_ca_bundle_path.nil? and !File.file?(@ca_cert.path)
|
210
|
-
@ca_cert = Tempfile.new("ca_cert")
|
211
|
-
@ca_cert.write(@cert_string)
|
212
|
-
@ca_cert.flush
|
213
|
-
@http.ca_file = @ca_cert.path
|
214
|
-
raise ClientError.new("Packaged certificate appears to have been deleted, writing a new one.", @add_events_uri)
|
215
|
-
else
|
216
|
-
raise e
|
217
|
-
end
|
218
|
-
|
219
|
-
rescue Net::HTTP::Persistent::Error => e
|
241
|
+
rescue Manticore::ManticoreException => e
|
220
242
|
# The underlying persistent-connection library automatically retries when there are network-related errors.
|
221
243
|
# Eventually, it will give up and raise this generic error, at which time, we convert it to a ClientError
|
222
|
-
raise ClientError.new(e.message, @add_events_uri)
|
244
|
+
raise ClientError.new(e.message, @add_events_uri, e.class.name)
|
223
245
|
|
224
246
|
ensure
|
225
247
|
if @record_stats_for_status or !is_status
|
@@ -245,7 +267,6 @@ class ClientSession
|
|
245
267
|
|
246
268
|
|
247
269
|
def close
|
248
|
-
@http.shutdown
|
249
270
|
end # def close
|
250
271
|
|
251
272
|
|
@@ -273,18 +294,20 @@ class ClientSession
|
|
273
294
|
compression_duration = end_time - start_time
|
274
295
|
end
|
275
296
|
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
297
|
+
version = sprintf('output-logstash-scalyr %s' % [PLUGIN_VERSION])
|
298
|
+
post_headers = {
|
299
|
+
'Content-Type': 'application/json',
|
300
|
+
'User-Agent': version + ';' + RUBY_VERSION + ';' + RUBY_PLATFORM
|
301
|
+
}
|
280
302
|
|
303
|
+
post_body = nil
|
281
304
|
if not encoding.nil?
|
282
|
-
|
283
|
-
|
305
|
+
post_headers['Content-Encoding'] = encoding
|
306
|
+
post_body = compressed_body
|
284
307
|
else
|
285
|
-
|
308
|
+
post_body = body
|
286
309
|
end
|
287
|
-
return
|
310
|
+
return post_body, post_headers, compression_duration
|
288
311
|
end # def prepare_post_object
|
289
312
|
|
290
313
|
|
data/lib/scalyr/common/util.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-output-scalyr'
|
3
|
-
s.version = '0.1.
|
3
|
+
s.version = '0.1.14.beta'
|
4
4
|
s.licenses = ['Apache-2.0']
|
5
5
|
s.summary = "Scalyr output plugin for Logstash"
|
6
6
|
s.description = "Sends log data collected by Logstash to Scalyr (https://www.scalyr.com)"
|
@@ -4,27 +4,68 @@ require "logstash/outputs/scalyr"
|
|
4
4
|
require "logstash/codecs/plain"
|
5
5
|
require "logstash/event"
|
6
6
|
require "json"
|
7
|
+
require 'webmock/rspec'
|
8
|
+
WebMock.allow_net_connect!
|
7
9
|
|
8
10
|
describe LogStash::Outputs::Scalyr do
|
11
|
+
let(:sample_events) {
|
12
|
+
events = []
|
13
|
+
for i in 1..3 do
|
14
|
+
e = LogStash::Event.new
|
15
|
+
e.set('source_host', "my host #{i}")
|
16
|
+
e.set('source_file', "my file #{i}")
|
17
|
+
e.set('seq', i)
|
18
|
+
e.set('nested', {'a'=>1, 'b'=>[3,4,5]})
|
19
|
+
e.set('tags', ['t1', 't2', 't3'])
|
20
|
+
events.push(e)
|
21
|
+
end
|
22
|
+
events
|
23
|
+
}
|
9
24
|
|
10
25
|
describe "#ssl_tests" do
|
11
26
|
context "with default SSL configuration" do
|
12
27
|
it "throws a ServerError due to fake api key" do
|
13
|
-
expect {
|
14
28
|
plugin = LogStash::Outputs::Scalyr.new({'api_write_token' => '1234'})
|
15
29
|
plugin.register
|
30
|
+
plugin.instance_variable_set(:@running, false)
|
31
|
+
allow(plugin.instance_variable_get(:@logger)).to receive(:error)
|
16
32
|
plugin.multi_receive(sample_events)
|
17
|
-
|
33
|
+
expect(plugin.instance_variable_get(:@logger)).to have_received(:error).with("Error uploading to Scalyr (will backoff-retry)",
|
34
|
+
{
|
35
|
+
:error_class=>"Scalyr::Common::Client::ServerError",
|
36
|
+
:batch_num=>1,
|
37
|
+
:code=>401,
|
38
|
+
:message=>"error/client/badParam",
|
39
|
+
:payload_size=>781,
|
40
|
+
:record_count=>3,
|
41
|
+
:total_batches=>1,
|
42
|
+
:url=>"https://agent.scalyr.com/addEvents",
|
43
|
+
:will_retry_in_seconds=>2,
|
44
|
+
:body=>"{\n \"message\": \"Couldn't decode API token ...234.\",\n \"status\": \"error/client/badParam\"\n}"
|
45
|
+
}
|
46
|
+
)
|
18
47
|
end
|
19
48
|
end
|
20
49
|
|
21
50
|
context "when pointing at a location without any valid certs and not using builtin" do
|
22
51
|
it "throws an SSLError" do
|
23
|
-
expect {
|
24
52
|
plugin = LogStash::Outputs::Scalyr.new({'api_write_token' => '1234', 'ssl_ca_bundle_path' => '/fakepath/nocerts', 'append_builtin_cert' => false})
|
25
53
|
plugin.register
|
54
|
+
plugin.instance_variable_set(:@running, false)
|
55
|
+
allow(plugin.instance_variable_get(:@logger)).to receive(:error)
|
26
56
|
plugin.multi_receive(sample_events)
|
27
|
-
|
57
|
+
expect(plugin.instance_variable_get(:@logger)).to have_received(:error).with("Error uploading to Scalyr (will backoff-retry)",
|
58
|
+
{
|
59
|
+
:error_class=>"Manticore::UnknownException",
|
60
|
+
:batch_num=>1,
|
61
|
+
:message=>"Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty",
|
62
|
+
:payload_size=>781,
|
63
|
+
:record_count=>3,
|
64
|
+
:total_batches=>1,
|
65
|
+
:url=>"https://agent.scalyr.com/addEvents",
|
66
|
+
:will_retry_in_seconds=>2
|
67
|
+
}
|
68
|
+
)
|
28
69
|
end
|
29
70
|
end
|
30
71
|
|
@@ -34,11 +75,23 @@ describe LogStash::Outputs::Scalyr do
|
|
34
75
|
`sudo mv #{OpenSSL::X509::DEFAULT_CERT_DIR} /tmp/system_certs`
|
35
76
|
|
36
77
|
begin
|
37
|
-
expect {
|
38
78
|
plugin = LogStash::Outputs::Scalyr.new({'api_write_token' => '1234', 'append_builtin_cert' => false})
|
39
79
|
plugin.register
|
80
|
+
plugin.instance_variable_set(:@running, false)
|
81
|
+
allow(plugin.instance_variable_get(:@logger)).to receive(:error)
|
40
82
|
plugin.multi_receive(sample_events)
|
41
|
-
|
83
|
+
expect(plugin.instance_variable_get(:@logger)).to have_received(:error).with("Error uploading to Scalyr (will backoff-retry)",
|
84
|
+
{
|
85
|
+
:error_class=>"Manticore::UnknownException",
|
86
|
+
:batch_num=>1,
|
87
|
+
:message=>"Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty",
|
88
|
+
:payload_size=>781,
|
89
|
+
:record_count=>3,
|
90
|
+
:total_batches=>1,
|
91
|
+
:url=>"https://agent.scalyr.com/addEvents",
|
92
|
+
:will_retry_in_seconds=>2
|
93
|
+
}
|
94
|
+
)
|
42
95
|
end
|
43
96
|
ensure
|
44
97
|
`sudo mv /tmp/system_certs #{OpenSSL::X509::DEFAULT_CERT_DIR}`
|
@@ -61,11 +114,23 @@ describe LogStash::Outputs::Scalyr do
|
|
61
114
|
`echo "#{etc_hosts_entry}" | sudo tee -a /etc/hosts`
|
62
115
|
|
63
116
|
begin
|
64
|
-
expect {
|
65
117
|
plugin = LogStash::Outputs::Scalyr.new({'api_write_token' => '1234', 'scalyr_server' => 'https://invalid.mitm.should.fail.test.agent.scalyr.com:443'})
|
66
118
|
plugin.register
|
119
|
+
plugin.instance_variable_set(:@running, false)
|
120
|
+
allow(plugin.instance_variable_get(:@logger)).to receive(:error)
|
67
121
|
plugin.multi_receive(sample_events)
|
68
|
-
|
122
|
+
expect(plugin.instance_variable_get(:@logger)).to have_received(:error).with("Error uploading to Scalyr (will backoff-retry)",
|
123
|
+
{
|
124
|
+
:error_class=>"Manticore::UnknownException",
|
125
|
+
:batch_num=>1,
|
126
|
+
:message=>"Host name 'invalid.mitm.should.fail.test.agent.scalyr.com' does not match the certificate subject provided by the peer (CN=*.scalyr.com)",
|
127
|
+
:payload_size=>781,
|
128
|
+
:record_count=>3,
|
129
|
+
:total_batches=>1,
|
130
|
+
:url=>"https://invalid.mitm.should.fail.test.agent.scalyr.com/addEvents",
|
131
|
+
:will_retry_in_seconds=>2
|
132
|
+
}
|
133
|
+
)
|
69
134
|
ensure
|
70
135
|
# Clean up the hosts file
|
71
136
|
`sudo truncate -s 0 /etc/hosts`
|
@@ -73,5 +138,119 @@ describe LogStash::Outputs::Scalyr do
|
|
73
138
|
end
|
74
139
|
end
|
75
140
|
end
|
141
|
+
|
142
|
+
context "when an error occurs with retries at 5" do
|
143
|
+
it "exits after 5 retries and emits a log" do
|
144
|
+
plugin = LogStash::Outputs::Scalyr.new({'retry_initial_interval' => 0.1, 'api_write_token' => '1234', 'ssl_ca_bundle_path' => '/fakepath/nocerts', 'append_builtin_cert' => false})
|
145
|
+
plugin.register
|
146
|
+
allow(plugin.instance_variable_get(:@logger)).to receive(:error)
|
147
|
+
plugin.multi_receive(sample_events)
|
148
|
+
expect(plugin.instance_variable_get(:@logger)).to have_received(:error).with("Failed to send 3 events after 5 tries.", anything
|
149
|
+
)
|
150
|
+
end
|
151
|
+
end
|
76
152
|
end
|
153
|
+
|
154
|
+
describe "response_handling_tests" do
|
155
|
+
context "when receiving a 503 response" do
|
156
|
+
it "don't throw an error but do log one to debug" do
|
157
|
+
stub_request(:post, "https://agent.scalyr.com/addEvents").
|
158
|
+
to_return(status: 503, body: "stubbed response", headers: {})
|
159
|
+
|
160
|
+
plugin = LogStash::Outputs::Scalyr.new({'api_write_token' => '1234', 'ssl_ca_bundle_path' => '/fakepath/nocerts', 'append_builtin_cert' => false})
|
161
|
+
plugin.register
|
162
|
+
plugin.instance_variable_set(:@running, false)
|
163
|
+
|
164
|
+
allow(plugin.instance_variable_get(:@logger)).to receive(:debug)
|
165
|
+
plugin.multi_receive(sample_events)
|
166
|
+
expect(plugin.instance_variable_get(:@logger)).to have_received(:debug).with("Error uploading to Scalyr (will backoff-retry)",
|
167
|
+
{
|
168
|
+
:error_class=>"Scalyr::Common::Client::ServerError",
|
169
|
+
:batch_num=>1,
|
170
|
+
:code=>503,
|
171
|
+
:message=>"Invalid JSON response from server",
|
172
|
+
:payload_size=>781,
|
173
|
+
:record_count=>3,
|
174
|
+
:total_batches=>1,
|
175
|
+
:url=>"https://agent.scalyr.com/addEvents",
|
176
|
+
:will_retry_in_seconds=>2,
|
177
|
+
:body=>"stubbed response"
|
178
|
+
}
|
179
|
+
)
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
context "when receiving a 500 response" do
|
184
|
+
it "don't throw an error but do log one to error" do
|
185
|
+
stub_request(:post, "https://agent.scalyr.com/addEvents").
|
186
|
+
to_return(status: 500, body: "stubbed response", headers: {})
|
187
|
+
|
188
|
+
plugin = LogStash::Outputs::Scalyr.new({'api_write_token' => '1234', 'ssl_ca_bundle_path' => '/fakepath/nocerts', 'append_builtin_cert' => false})
|
189
|
+
plugin.register
|
190
|
+
plugin.instance_variable_set(:@running, false)
|
191
|
+
|
192
|
+
allow(plugin.instance_variable_get(:@logger)).to receive(:error)
|
193
|
+
plugin.multi_receive(sample_events)
|
194
|
+
expect(plugin.instance_variable_get(:@logger)).to have_received(:error).with("Error uploading to Scalyr (will backoff-retry)",
|
195
|
+
{
|
196
|
+
:error_class=>"Scalyr::Common::Client::ServerError",
|
197
|
+
:batch_num=>1,
|
198
|
+
:code=>500,
|
199
|
+
:message=>"Invalid JSON response from server",
|
200
|
+
:payload_size=>781,
|
201
|
+
:record_count=>3,
|
202
|
+
:total_batches=>1,
|
203
|
+
:url=>"https://agent.scalyr.com/addEvents",
|
204
|
+
:will_retry_in_seconds=>2,
|
205
|
+
:body=>"stubbed response"
|
206
|
+
}
|
207
|
+
)
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
context "when receiving a long non-json response" do
|
212
|
+
it "don't throw an error but do log one to error" do
|
213
|
+
stub_request(:post, "https://agent.scalyr.com/addEvents").
|
214
|
+
to_return(status: 500, body: "0123456789" * 52, headers: {})
|
215
|
+
|
216
|
+
plugin = LogStash::Outputs::Scalyr.new({'api_write_token' => '1234', 'ssl_ca_bundle_path' => '/fakepath/nocerts', 'append_builtin_cert' => false})
|
217
|
+
plugin.register
|
218
|
+
plugin.instance_variable_set(:@running, false)
|
219
|
+
|
220
|
+
allow(plugin.instance_variable_get(:@logger)).to receive(:error)
|
221
|
+
plugin.multi_receive(sample_events)
|
222
|
+
expect(plugin.instance_variable_get(:@logger)).to have_received(:error).with("Error uploading to Scalyr (will backoff-retry)",
|
223
|
+
{
|
224
|
+
:error_class=>"Scalyr::Common::Client::ServerError",
|
225
|
+
:batch_num=>1,
|
226
|
+
:code=>500,
|
227
|
+
:message=>"Invalid JSON response from server",
|
228
|
+
:payload_size=>781,
|
229
|
+
:record_count=>3,
|
230
|
+
:total_batches=>1,
|
231
|
+
:url=>"https://agent.scalyr.com/addEvents",
|
232
|
+
:will_retry_in_seconds=>2,
|
233
|
+
:body=>("0123456789" * 50) + "012345678..."
|
234
|
+
}
|
235
|
+
)
|
236
|
+
end
|
237
|
+
end
|
238
|
+
|
239
|
+
context 'when DLQ is enabled' do
|
240
|
+
let(:dlq_writer) { double('DLQ writer') }
|
241
|
+
it 'should send the event to the DLQ' do
|
242
|
+
stub_request(:post, "https://agent.scalyr.com/addEvents").
|
243
|
+
to_return(status: 500, body: "stubbed response", headers: {})
|
244
|
+
|
245
|
+
plugin = LogStash::Outputs::Scalyr.new({'api_write_token' => '1234', 'ssl_ca_bundle_path' => '/fakepath/nocerts', 'append_builtin_cert' => false})
|
246
|
+
plugin.register
|
247
|
+
plugin.instance_variable_set(:@running, false)
|
248
|
+
plugin.instance_variable_set('@dlq_writer', dlq_writer)
|
249
|
+
|
250
|
+
expect(dlq_writer).to receive(:write).exactly(3).times.with(anything, anything)
|
251
|
+
plugin.multi_receive(sample_events)
|
252
|
+
end
|
253
|
+
end
|
254
|
+
end
|
255
|
+
|
77
256
|
end
|