instana 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.travis.yml +4 -0
- data/Gemfile +24 -0
- data/README.md +36 -0
- data/Rakefile +19 -0
- data/bin/console +7 -0
- data/bin/setup +8 -0
- data/instana.gemspec +32 -0
- data/lib/instana/agent.rb +33 -0
- data/lib/instana/version.rb +3 -0
- data/lib/instana.rb +13 -0
- metadata +96 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3f3d64bbe7f2c17bc7f3a8edef1fc213630e3222
|
4
|
+
data.tar.gz: 7e4893a2f0293c35d5266a1834bd87e4abb43fa4
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 89f46b204de6db443381ef29c475d44ce0872f021ba7f33b539d4f1179aae398f3fa1c26dc44b9e815d4eb15addb650f86081a4fda91e12b9f9387aeb7fba3c7
|
7
|
+
data.tar.gz: 99cb68bf6a623b7ae0fda9347959d48609988d30dd4388d4245a489496123f78cb005c5d40ec2cf2fb515420d021724fe8ee24bebf5243d270c723212b34af90
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
group :development, :test do
|
4
|
+
gem 'rake'
|
5
|
+
gem 'minitest'
|
6
|
+
gem 'minitest-reporters', '< 1.0.18'
|
7
|
+
gem 'minitest-debugger', :require => false
|
8
|
+
gem 'rack-test'
|
9
|
+
end
|
10
|
+
|
11
|
+
group :development do
|
12
|
+
gem 'ruby-debug', :platforms => [:mri_18, :jruby]
|
13
|
+
gem 'debugger', :platform => :mri_19
|
14
|
+
gem 'byebug', :platforms => [:mri_20, :mri_21, :mri_22, :mri_23]
|
15
|
+
if RUBY_VERSION > '1.8.7'
|
16
|
+
gem 'pry'
|
17
|
+
gem 'pry-byebug', :platforms => [:mri_20, :mri_21, :mri_22, :mri_23]
|
18
|
+
else
|
19
|
+
gem 'pry', '0.9.12.4'
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# instana.gemspec
|
24
|
+
gemspec
|
data/README.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# Instana
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/instana`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'instana'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install instana
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/instana.
|
36
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require "rake/testtask"
|
3
|
+
|
4
|
+
Rake::TestTask.new(:test) do |t|
|
5
|
+
t.libs << "test"
|
6
|
+
t.libs << "lib"
|
7
|
+
t.test_files = FileList['test/**/*_test.rb']
|
8
|
+
end
|
9
|
+
|
10
|
+
task :environment do
|
11
|
+
Bundler.require(:default, :development)
|
12
|
+
end
|
13
|
+
|
14
|
+
task :console => :environment do
|
15
|
+
ARGV.clear
|
16
|
+
Pry.start
|
17
|
+
end
|
18
|
+
|
19
|
+
task :default => :spec
|
data/bin/console
ADDED
data/bin/setup
ADDED
data/instana.gemspec
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'instana/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "instana"
|
8
|
+
spec.version = Instana::VERSION
|
9
|
+
spec.authors = ["Peter Giacomo Lombardo"]
|
10
|
+
spec.email = ["pglombardo@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Placeholder Ruby sensor gem for Instana}
|
13
|
+
spec.description = %q{Will Provide Ruby sensor instrumentation for Instana.}
|
14
|
+
spec.homepage = "https://www.instana.com/"
|
15
|
+
|
16
|
+
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
17
|
+
# delete this section to allow pushing this gem to any host.
|
18
|
+
#if spec.respond_to?(:metadata)
|
19
|
+
# spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
20
|
+
#else
|
21
|
+
# raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
22
|
+
#end
|
23
|
+
|
24
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
25
|
+
spec.bindir = "exe"
|
26
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
|
+
spec.require_paths = ["lib"]
|
28
|
+
|
29
|
+
spec.add_development_dependency "bundler", "~> 1.11"
|
30
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
31
|
+
spec.add_development_dependency "minitest", "~> 5.0"
|
32
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require 'uri'
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
module Instana
|
6
|
+
class Agent
|
7
|
+
def initiialize
|
8
|
+
@request_timeout = 5000
|
9
|
+
@host = '127.0.0.1'
|
10
|
+
@port = 42699
|
11
|
+
@server_header = 'Instana Agent'
|
12
|
+
@agentuuid = nil
|
13
|
+
end
|
14
|
+
|
15
|
+
def announce_sensor
|
16
|
+
uri = URI.parse("http://#{@host}:#{@port}/com.instana.plugin.ruby.discovery")
|
17
|
+
payload = {}
|
18
|
+
payload[:pid] = Process.pid
|
19
|
+
payload[:name] = $0
|
20
|
+
|
21
|
+
req = Net::HTTP::Put.new(uri)
|
22
|
+
req['Accept'] = 'application/json'
|
23
|
+
req['Content-Type'] = 'application/json'
|
24
|
+
req.body = payload.to_json
|
25
|
+
|
26
|
+
response = nil
|
27
|
+
Net::HTTP.start(uri.hostname, uri.port) do |http|
|
28
|
+
response = http.request(req)
|
29
|
+
end
|
30
|
+
puts response
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/instana.rb
ADDED
metadata
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: instana
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Peter Giacomo Lombardo
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-10-16 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.11'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.11'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '5.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '5.0'
|
55
|
+
description: Will Provide Ruby sensor instrumentation for Instana.
|
56
|
+
email:
|
57
|
+
- pglombardo@gmail.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- ".travis.yml"
|
64
|
+
- Gemfile
|
65
|
+
- README.md
|
66
|
+
- Rakefile
|
67
|
+
- bin/console
|
68
|
+
- bin/setup
|
69
|
+
- instana.gemspec
|
70
|
+
- lib/instana.rb
|
71
|
+
- lib/instana/agent.rb
|
72
|
+
- lib/instana/version.rb
|
73
|
+
homepage: https://www.instana.com/
|
74
|
+
licenses: []
|
75
|
+
metadata: {}
|
76
|
+
post_install_message:
|
77
|
+
rdoc_options: []
|
78
|
+
require_paths:
|
79
|
+
- lib
|
80
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '0'
|
85
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
requirements: []
|
91
|
+
rubyforge_project:
|
92
|
+
rubygems_version: 2.5.1
|
93
|
+
signing_key:
|
94
|
+
specification_version: 4
|
95
|
+
summary: Placeholder Ruby sensor gem for Instana
|
96
|
+
test_files: []
|