instana 1.9.0 → 1.9.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 19b57b244ae34d84adf8c974296e60f2030c61876a351a8f10418b06051ae7bf
4
- data.tar.gz: 56509b6350e8de9b280747674084f510ef2b2240cedc4d7a3592504a5eb05f76
3
+ metadata.gz: 4e778abc3a02b507d19a21a97a2f675492c8f3b0a9b330819681dec32fe5408f
4
+ data.tar.gz: 7229ba517c01e1957b3e68263ec80e3f6c1641e2d786a66072c657fda81d84a6
5
5
  SHA512:
6
- metadata.gz: 2c05dcf132296ba2d9c6ebca5769590d104c40aa678d8607ab2d381b96be78f68d85b783c8dc3ffeafce1353da8e0b74c013a997fdadedf82cc6311ca62c9e67
7
- data.tar.gz: 7119c1e50c4f379a169dde1994e48754a5d6be3304f6cf2a8da00fd692a17eea1d1122b979e15498612eec1774104a4863cc381f6e9d274406cb61efafddf9d9
6
+ metadata.gz: b0d1509d303d98ac8750a9adf09df794056cdf2ca12631ba079a681b9d7c0a346c14a81b78cd09b95684959f25adecc2a41dbbcb0075704ebcd22d6a85227942
7
+ data.tar.gz: a8c0d8dab39ae7e2ce27e677855c9ed477f95fb7845a46d8a3edc56c442919d6387477d911ae5918bbd9d67a62871814d711ef7bc9f5703cb0dabcadde9cbd85
@@ -6,12 +6,13 @@ cache:
6
6
  - vendor/bundle
7
7
 
8
8
  rvm:
9
- - 2.4.3
10
- - 2.1.10
9
+ - 2.5
10
+ - 2.4
11
11
 
12
12
  before_install:
13
- - gem update --system
14
- - gem update bundler
13
+ # Re: https://docs.travis-ci.com/user/languages/ruby/#dependency-management
14
+ - gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
15
+ - gem install bundler -v '< 2'
15
16
  - gem --version
16
17
 
17
18
  before_script:
@@ -30,16 +31,12 @@ gemfile:
30
31
  - gemfiles/libraries.gemfile
31
32
  - gemfiles/rails50.gemfile
32
33
  - gemfiles/rails42.gemfile
33
- - gemfiles/rails32.gemfile
34
34
 
35
35
  matrix:
36
36
  exclude:
37
37
  # Rails 5.0+ requires Ruby 2.2.2 or higher
38
38
  - rvm: 2.1.10
39
39
  gemfile: gemfiles/rails50.gemfile
40
- # Rails 3.2 doesn't work on Ruby 2.4.1
41
- - rvm: 2.4.3
42
- gemfile: gemfiles/rails32.gemfile
43
40
 
44
41
  notifications:
45
42
  slack:
data/Gemfile CHANGED
@@ -10,7 +10,7 @@ group :development, :test do
10
10
 
11
11
  # Rack v2 dropped support for Ruby 2.2 and higher.
12
12
  if RUBY_VERSION < '2.2'
13
- gem 'rack', '< 2.0'
13
+ gem 'rack', '~> 1.6'
14
14
  end
15
15
  gem 'rack-test'
16
16
 
@@ -19,6 +19,10 @@ module Instana
19
19
  kvs[:http][:host] = env['SERVER_NAME']
20
20
  end
21
21
 
22
+ if ENV.key?('INSTANA_SERVICE_NAME')
23
+ kvs[:service] = ENV['INSTANA_SERVICE_NAME']
24
+ end
25
+
22
26
  if ::Instana.agent.extra_headers
23
27
  for custom_header in ::Instana.agent.extra_headers
24
28
  # Headers are available in this format: HTTP_X_CAPTURE_THIS
@@ -68,15 +68,19 @@ module Instana
68
68
 
69
69
  def perform_with_instana(job)
70
70
  kvs = {}
71
+ kvs[:'resque-worker'] = {}
71
72
 
72
73
  begin
73
- kvs[:job] = job.payload['class'].to_s
74
- kvs[:queue] = job.queue
74
+ if ENV.key?('INSTANA_SERVICE_NAME')
75
+ kvs[:service] = ENV['INSTANA_SERVICE_NAME']
76
+ end
77
+ kvs[:'resque-worker'][:job] = job.payload['class'].to_s
78
+ kvs[:'resque-worker'][:queue] = job.queue
75
79
  rescue => e
76
80
  ::Instana.logger.debug "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}" if Instana::Config[:verbose]
77
81
  end
78
82
 
79
- Instana.tracer.start_or_continue_trace(:'resque-worker', { :'resque-worker' => kvs }) do
83
+ Instana.tracer.start_or_continue_trace(:'resque-worker', kvs) do
80
84
  perform_without_instana(job)
81
85
  end
82
86
  end
@@ -15,6 +15,10 @@ module Instana
15
15
  kv_payload[:'sidekiq-worker'][:'redis-url'] = "#{opts[:host]}:#{opts[:port]}"
16
16
  end
17
17
 
18
+ if ENV.key?('INSTANA_SERVICE_NAME')
19
+ kv_payload[:service] = ENV['INSTANA_SERVICE_NAME']
20
+ end
21
+
18
22
  context = {}
19
23
  if msg.key?('X-Instana-T')
20
24
  trace_id = msg.delete('X-Instana-T')
@@ -1,4 +1,4 @@
1
1
  module Instana
2
- VERSION = "1.9.0"
2
+ VERSION = "1.9.1"
3
3
  VERSION_FULL = "instana-#{VERSION}"
4
4
  end
@@ -47,6 +47,24 @@ class RackTest < Minitest::Test
47
47
  refute_nil first_span[:stack].first[:f].match(/instana\/instrumentation\/rack.rb/)
48
48
  end
49
49
 
50
+ def test_basic_get_with_custom_service_name
51
+ ENV['INSTANA_SERVICE_NAME'] = 'WalterBishop'
52
+
53
+ clear_all!
54
+ get '/mrlobster'
55
+ assert last_response.ok?
56
+
57
+ spans = ::Instana.processor.queued_spans
58
+
59
+ # Span validation
60
+ assert_equal 1, spans.count
61
+
62
+ first_span = spans.first
63
+ assert_equal 'WalterBishop', first_span[:data][:service]
64
+
65
+ ENV.delete('INSTANA_SERVICE_NAME')
66
+ end
67
+
50
68
  def test_basic_post
51
69
  clear_all!
52
70
  post '/mrlobster'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: instana
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 1.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Giacomo Lombardo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-24 00:00:00.000000000 Z
11
+ date: 2019-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -322,49 +322,49 @@ signing_key:
322
322
  specification_version: 4
323
323
  summary: Ruby Distributed Tracing & Metrics Sensor for Instana
324
324
  test_files:
325
- - test/agent/agent_test.rb
326
- - test/apps/cuba.rb
327
- - test/apps/grpc_server.rb
328
- - test/apps/roda.rb
329
- - test/apps/sinatra.rb
330
- - test/benchmarks/bench_id_generation.rb
331
- - test/benchmarks/bench_opentracing.rb
332
325
  - test/config_test.rb
333
- - test/frameworks/cuba_test.rb
334
- - test/frameworks/rack_test.rb
335
- - test/frameworks/rails/actioncontroller_test.rb
336
- - test/frameworks/rails/actionview3_test.rb
337
- - test/frameworks/rails/actionview4_test.rb
338
- - test/frameworks/rails/actionview5_test.rb
339
- - test/frameworks/rails/activerecord3_test.rb
340
- - test/frameworks/rails/activerecord4_test.rb
341
- - test/frameworks/rails/activerecord5_test.rb
342
- - test/frameworks/roda_test.rb
343
- - test/frameworks/sinatra_test.rb
344
- - test/instana_test.rb
326
+ - test/tracing/id_management_test.rb
327
+ - test/tracing/tracer_test.rb
328
+ - test/tracing/custom_test.rb
329
+ - test/tracing/opentracing_test.rb
330
+ - test/tracing/trace_test.rb
331
+ - test/tracing/tracer_async_test.rb
332
+ - test/agent/agent_test.rb
333
+ - test/models/block.rb
334
+ - test/instrumentation/sidekiq-client_test.rb
335
+ - test/instrumentation/resque_test.rb
336
+ - test/instrumentation/sidekiq-worker_test.rb
337
+ - test/instrumentation/redis_test.rb
338
+ - test/instrumentation/rest-client_test.rb
345
339
  - test/instrumentation/dalli_test.rb
346
340
  - test/instrumentation/excon_test.rb
347
341
  - test/instrumentation/grpc_test.rb
348
342
  - test/instrumentation/net-http_test.rb
349
- - test/instrumentation/redis_test.rb
350
- - test/instrumentation/resque_test.rb
351
- - test/instrumentation/rest-client_test.rb
352
- - test/instrumentation/sidekiq-client_test.rb
353
- - test/instrumentation/sidekiq-worker_test.rb
343
+ - test/benchmarks/bench_opentracing.rb
344
+ - test/benchmarks/bench_id_generation.rb
345
+ - test/test_helper.rb
346
+ - test/jobs/sidekiq_job_2.rb
354
347
  - test/jobs/resque_error_job.rb
355
- - test/jobs/resque_fast_job.rb
356
348
  - test/jobs/sidekiq_job_1.rb
357
- - test/jobs/sidekiq_job_2.rb
358
- - test/models/block.rb
359
- - test/servers/grpc_50051.rb
360
- - test/servers/helpers/sidekiq_worker_initializer.rb
349
+ - test/jobs/resque_fast_job.rb
350
+ - test/frameworks/cuba_test.rb
351
+ - test/frameworks/rack_test.rb
352
+ - test/frameworks/roda_test.rb
353
+ - test/frameworks/sinatra_test.rb
354
+ - test/frameworks/rails/actionview4_test.rb
355
+ - test/frameworks/rails/activerecord3_test.rb
356
+ - test/frameworks/rails/actioncontroller_test.rb
357
+ - test/frameworks/rails/actionview5_test.rb
358
+ - test/frameworks/rails/actionview3_test.rb
359
+ - test/frameworks/rails/activerecord5_test.rb
360
+ - test/frameworks/rails/activerecord4_test.rb
361
+ - test/apps/sinatra.rb
362
+ - test/apps/roda.rb
363
+ - test/apps/cuba.rb
364
+ - test/apps/grpc_server.rb
361
365
  - test/servers/rackapp_6511.rb
362
- - test/servers/rails_3205.rb
363
366
  - test/servers/sidekiq/worker.rb
364
- - test/test_helper.rb
365
- - test/tracing/custom_test.rb
366
- - test/tracing/id_management_test.rb
367
- - test/tracing/opentracing_test.rb
368
- - test/tracing/trace_test.rb
369
- - test/tracing/tracer_async_test.rb
370
- - test/tracing/tracer_test.rb
367
+ - test/servers/grpc_50051.rb
368
+ - test/servers/rails_3205.rb
369
+ - test/servers/helpers/sidekiq_worker_initializer.rb
370
+ - test/instana_test.rb