stackdriver 0.15.1 → 0.15.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5cfbd8e9c77b8bbf44cdf81627beac4757b9a6b9bd9a9a1e9473f11c970e5bf0
4
- data.tar.gz: 18f4cd6661281242f2ecee3f09b08c0f0c74c524ab95db38df418e2d37ae672d
3
+ metadata.gz: a80e07c15259fe692a9a3f046d8b5dffad1cd2973846bb24dded9fe23d81ab0b
4
+ data.tar.gz: 98dbd5983c35a5f071a7fb175a82f7a5efb58b3ca878ef6082f4309b880396ee
5
5
  SHA512:
6
- metadata.gz: 8726fdb0d699adcc0fa92dbd3a8b47e7d7ec5e70695bf151b4be752f48dca3e89c286ae33ae64f165566a00c8bc8c84696a58910710ccc4f18b3bb25ab7c02f6
7
- data.tar.gz: 5a2df83be3070c12adc01791fa74f22ba17b003dd9e0df69260e7c9a5bd2784e62f98af0aba1335058edbed781ba147f8af25fe5699b14627fb2b373577f2252
6
+ metadata.gz: 55c0dbf52776c67e912d4cd6bb67e57f9137fc8dfb4d20ad83e5d2303d051f0c54bdba50ee499394b79c86a166456fc8ef24f109aa8ca4d2ad8e4ffba1a25258
7
+ data.tar.gz: 300c58e8b8a2d3dd5a58509e2215f73f0df3f4447add3cb889db572e8421dc4a934875d90a0f9003f5f29c07d7bc67e6a89bd36fc56ec637969fc332eb6fc5a1
data/CHANGELOG.md ADDED
@@ -0,0 +1,100 @@
1
+ # Release History
2
+
3
+ ### 0.15.2 / 2018-09-12
4
+
5
+ * Add missing documentation files to package.
6
+
7
+ ### 0.15.1 / 2018-09-10
8
+
9
+ * Update documentation.
10
+
11
+ ### 0.15.0 / 2018-05-24
12
+
13
+ * Debugger 0.32.0
14
+ * Trace 0.33.0
15
+
16
+ ### 0.14.0 / 2018-02-27
17
+
18
+ * Debugger 0.31.0
19
+ * Use Google Cloud Shared Configuration.
20
+ * Fix for mutation detection using Ruby 2.5.
21
+ * Support disabling mutation detection in debugger evaluation.
22
+ * Error Reporting 0.30.0
23
+ * Use Google Cloud Shared Configuration.
24
+ * Logging 1.5.0
25
+ * Use Google Cloud Shared Configuration.
26
+ * Deprecated Logging Sink attributes.
27
+ * Trace 0.31.0
28
+ * Use Google Cloud Shared Configuration.
29
+ * Update authentication documentation.
30
+
31
+ ### 0.13.0 / 2017-12-19
32
+
33
+ * Trace 0.30.0 release.
34
+
35
+ ### 0.12.0 / 2017-12-19
36
+
37
+ * Debugger 0.30.0 release.
38
+ * Error Reporting 0.29.0 release.
39
+ * Logging 1.4.0 release.
40
+ * Trace 0.29.0 release.
41
+
42
+ ### 0.11.0 / 2017-11-14
43
+
44
+ * Debugger 0.29.0 release.
45
+ * Error Reporting 0.28.0 release.
46
+ * Logging 1.3.0 release.
47
+ * Trace 0.28.0 release.
48
+
49
+ ### 0.10.0 / 2017-09-08
50
+
51
+ * Error Reporting 0.27.0 release.
52
+
53
+ ### 0.9.0 / 2017-08-25
54
+
55
+ * Debugger 0.28.0 release.
56
+
57
+ ### 0.8.0 / 2017-08-07
58
+
59
+ * Debugger 0.27.0 release.
60
+ * Trace 0.27.0 release.
61
+
62
+ ### 0.7.0 / 2017-07-11
63
+
64
+ * Debugger 0.26.0 release.
65
+ * Error Reporting 0.26.0 release.
66
+ * Logging 1.2.0 release.
67
+ * Trace 0.26.0 release.
68
+
69
+ ### 0.6.0 / 2017-05-25
70
+
71
+ * Debugger 0.25.0 release.
72
+ * Error Reporting 0.25.0 release.
73
+ * Logging 1.1.0 release.
74
+ * Trace 0.25.0 release.
75
+ * Remove `google-cloud-monitoring` from this umbrella gem.
76
+
77
+ ### 0.5.0 / 2017-03-31
78
+
79
+ * Logging 1.0 release
80
+ * Updated dependencies on all other gems
81
+
82
+ ### 0.4.1 / 2017-02-27
83
+
84
+ * Set version constraints on the gem dependencies for individual stackdriver services. Current versions are:
85
+ * **google-cloud-logging** `~> 0.24.0`
86
+ * **google-cloud-error_reporting** `~> 0.23.1`
87
+ * **google-cloud-monitoring** `~> 0.23.0`
88
+ * **google-cloud-trace** `~> 0.23.0`
89
+
90
+ ### 0.4.0 / 2016-12-22
91
+
92
+ * Now provides Stackdriver Trace instrumentation by including google-cloud-trace.
93
+
94
+ ### 0.3.0 / 2016-11-07
95
+
96
+ This gem is an umbrella gem that serves as the single drop-in gem for users interested in using the Stackdriver services from their Ruby applications.
97
+
98
+ The initial release of stackdriver gem includes the following Stackdriver gems to be used in Ruby applications:
99
+ * google-cloud-logging
100
+ * google-cloud-error_reporting
@@ -0,0 +1,40 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of
4
+ fostering an open and welcoming community, we pledge to respect all people who
5
+ contribute through reporting issues, posting feature requests, updating
6
+ documentation, submitting pull requests or patches, and other activities.
7
+
8
+ We are committed to making participation in this project a harassment-free
9
+ experience for everyone, regardless of level of experience, gender, gender
10
+ identity and expression, sexual orientation, disability, personal appearance,
11
+ body size, race, ethnicity, age, religion, or nationality.
12
+
13
+ Examples of unacceptable behavior by participants include:
14
+
15
+ * The use of sexualized language or imagery
16
+ * Personal attacks
17
+ * Trolling or insulting/derogatory comments
18
+ * Public or private harassment
19
+ * Publishing other's private information, such as physical or electronic
20
+ addresses, without explicit permission
21
+ * Other unethical or unprofessional conduct.
22
+
23
+ Project maintainers have the right and responsibility to remove, edit, or reject
24
+ comments, commits, code, wiki edits, issues, and other contributions that are
25
+ not aligned to this Code of Conduct. By adopting this Code of Conduct, project
26
+ maintainers commit themselves to fairly and consistently applying these
27
+ principles to every aspect of managing this project. Project maintainers who do
28
+ not follow or enforce the Code of Conduct may be permanently removed from the
29
+ project team.
30
+
31
+ This code of conduct applies both within project spaces and in public spaces
32
+ when an individual is representing the project or its community.
33
+
34
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
35
+ reported by opening an issue or contacting one or more of the project
36
+ maintainers.
37
+
38
+ This Code of Conduct is adapted from the [Contributor
39
+ Covenant](http://contributor-covenant.org), version 1.2.0, available at
40
+ [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,128 @@
1
+ # Contributing to Google Cloud Stackdriver
2
+
3
+ 1. **Sign one of the contributor license agreements below.**
4
+ 2. Fork the repo, develop and test your code changes.
5
+ 3. Send a pull request.
6
+
7
+ ## Contributor License Agreements
8
+
9
+ Before we can accept your pull requests you'll need to sign a Contributor
10
+ License Agreement (CLA):
11
+
12
+ - **If you are an individual writing original source code** and **you own the
13
+ intellectual property**, then you'll need to sign an [individual
14
+ CLA](https://developers.google.com/open-source/cla/individual).
15
+ - **If you work for a company that wants to allow you to contribute your work**,
16
+ then you'll need to sign a [corporate
17
+ CLA](https://developers.google.com/open-source/cla/corporate).
18
+
19
+ You can sign these electronically (just scroll to the bottom). After that, we'll
20
+ be able to accept your pull requests.
21
+
22
+ ## Setup
23
+
24
+ In order to use the stackdriver console and run the project's tests,
25
+ there is a small amount of setup:
26
+
27
+ 1. Install Ruby. stackdriver requires Ruby 2.3+. You may choose to
28
+ manage your Ruby and gem installations with [RVM](https://rvm.io/),
29
+ [rbenv](https://github.com/rbenv/rbenv), or
30
+ [chruby](https://github.com/postmodern/chruby).
31
+
32
+ 2. Install [Bundler](http://bundler.io/).
33
+
34
+ ```sh
35
+ $ gem install bundler
36
+ ```
37
+
38
+ 3. Install the top-level project dependencies.
39
+
40
+ ```sh
41
+ $ bundle install
42
+ ```
43
+
44
+ 4. Install the Stackdriver dependencies.
45
+
46
+ ```sh
47
+ $ cd stackdriver/
48
+ $ bundle exec rake bundleupdate
49
+ ```
50
+
51
+ ## Stackdriver Tests
52
+
53
+ Tests are very important part of stackdriver. All contributions
54
+ should include tests that ensure the contributed code behaves as expected.
55
+
56
+ To run the unit tests, documentation tests, and code style checks together for a
57
+ package:
58
+
59
+ ``` sh
60
+ $ cd stackdriver/
61
+ $ bundle exec rake ci
62
+ ```
63
+
64
+ To run the command above, plus all acceptance tests, use `rake ci:acceptance` or
65
+ its handy alias, `rake ci:a`.
66
+
67
+ ### Stackdriver Unit Tests
68
+
69
+
70
+ The project uses the [minitest](https://github.com/seattlerb/minitest) library,
71
+ including [specs](https://github.com/seattlerb/minitest#specs),
72
+ [mocks](https://github.com/seattlerb/minitest#mocks) and
73
+ [minitest-autotest](https://github.com/seattlerb/minitest-autotest).
74
+
75
+ To run the Stackdriver unit tests:
76
+
77
+ ``` sh
78
+ $ cd stackdriver/
79
+ $ bundle exec rake test
80
+ ```
81
+
82
+ ### Stackdriver Documentation Tests
83
+
84
+ The project tests the code examples in the gem's
85
+ [YARD](https://github.com/lsegal/yard)-based documentation.
86
+
87
+ The example testing functions in a way that is very similar to unit testing, and
88
+ in fact the library providing it,
89
+ [yard-doctest](https://github.com/p0deje/yard-doctest), is based on the
90
+ project's unit test library, [minitest](https://github.com/seattlerb/minitest).
91
+
92
+ To run the Stackdriver documentation tests:
93
+
94
+ ``` sh
95
+ $ cd stackdriver/
96
+ $ bundle exec rake doctest
97
+ ```
98
+
99
+ If you add, remove or modify documentation examples when working on a pull
100
+ request, you may need to update the setup for the tests. The stubs and mocks
101
+ required to run the tests are located in `support/doctest_helper.rb`. Please
102
+ note that much of the setup is matched by the title of the
103
+ [`@example`](http://www.rubydoc.info/gems/yard/file/docs/Tags.md#example) tag.
104
+ If you alter an example's title, you may encounter breaking tests.
105
+
106
+ ## Coding Style
107
+
108
+ Please follow the established coding style in the library. The style is is
109
+ largely based on [The Ruby Style
110
+ Guide](https://github.com/bbatsov/ruby-style-guide) with a few exceptions based
111
+ on seattle-style:
112
+
113
+ * Avoid parenthesis when possible, including in method definitions.
114
+ * Always use double quotes strings. ([Option
115
+ B](https://github.com/bbatsov/ruby-style-guide#strings))
116
+
117
+ You can check your code against these rules by running Rubocop like so:
118
+
119
+ ```sh
120
+ $ cd stackdriver/
121
+ $ bundle exec rake rubocop
122
+ ```
123
+
124
+ ## Code of Conduct
125
+
126
+ Please note that this project is released with a Contributor Code of Conduct. By
127
+ participating in this project you agree to abide by its terms. See
128
+ {file:CODE_OF_CONDUCT.md Code of Conduct} for more information.
@@ -0,0 +1,116 @@
1
+ # Stackdriver Instrumentation Configuration
2
+
3
+ Stackdriver instrumentation libraries are fully integrated with Rails
4
+ configuration interface. You can provide all the configuration parameters in
5
+ your `config/environments/*.rb` files:
6
+
7
+ ```ruby
8
+ Rails.application.configure do |config|
9
+ # Shared project_id and keyfile
10
+ config.google_cloud.project_id = "my-project"
11
+ config.google_cloud.keyfile = "/path/to/key.json"
12
+
13
+ # Library specific configurations
14
+ config.google_cloud.error_reporting.project_id = "error-reporting-project"
15
+ config.google_cloud.logging.log_name = "my-app-logname"
16
+ config.google_cloud.trace.capture_stack = true
17
+ end
18
+ ```
19
+
20
+ Other Rack-based applications can also configure all the Stackdriver
21
+ instrumentation libraries through a similar configuration interface in Ruby:
22
+
23
+ ```ruby
24
+ Google::Cloud.configure do |config|
25
+ # Shared project_id and keyfile
26
+ config.project_id = "my-project"
27
+ config.keyfile = "/path/to/key.json"
28
+
29
+ # Library specific configurations
30
+ config.error_reporting.project_id = "error-reporting-project"
31
+ config.logging.log_name = "my-app-log"
32
+ config.trace.capture_stack = true
33
+ end
34
+ ```
35
+
36
+ Individual libraries can be configured separately:
37
+
38
+ ```ruby
39
+ # Error Reporting specific configurations
40
+ Google::Cloud::ErrorReporting.configure do |config|
41
+ config.project_id = "error-reporting-project"
42
+ config.service_name = "my-service"
43
+ end
44
+
45
+ # Debugger specific configurations
46
+ Google::Cloud::Debugger.configure do |config|
47
+ config.project_id = "debugger-project"
48
+ config.service_name = "my-service"
49
+ config.allow_mutating_methods = true
50
+ end
51
+
52
+ # Logging specific configurations
53
+ Google::Cloud::Logging.configure do |config|
54
+ config.project_id = "error-reporting-project"
55
+ config.log_name = "my-app-log"
56
+ config.google_cloud.labels = {
57
+ "my-static-label" => "static-label-value",
58
+ "my-dynamic-label" => ->(rack_env) { rack_env["HTTP_X_MY_HEADER"] }
59
+ }
60
+ end
61
+
62
+ # Trace specific configurations
63
+ Google::Cloud::Trace.configure do |config|
64
+ config.project_id = "error-reporting-project"
65
+ config.capture_stack = true
66
+ end
67
+ ```
68
+
69
+ ## Configuration Options
70
+
71
+ #### Shared
72
+
73
+ * `project_id`: [`String`] Shared Google Cloud Platform Project identifier. Self discovered on GCP.
74
+ * `credentials`: [`String`] Path to shared service account JSON keyfile. Self discovered on GCP.
75
+ * `use_error_reporting`: [`Boolean`] Explicitly enable or disable Error Reporting features. Default: `Rails.env.production?`
76
+ * `use_debugger`: [`Boolean`] Explicitly enable or disable Debugger features. Default: `Rails.env.production?`
77
+ * `use_logging`: [`Boolean`] Explicitly enable or disable Logging features. Default: `Rails.env.production?`
78
+ * `use_trace`: [`Boolean`] Explicitly enable or disable Trace features. Default: `Rails.env.production?`
79
+
80
+ #### Error Reporting
81
+
82
+ * `error_reporting.project_id`: [`String`] Google Cloud Platform Project identifier just for Error Reporting. Self discovered on GCP.
83
+ * `error_reporting.credentials`: [`String`] Path to service account JSON keyfile. Self discovered on GCP.
84
+ * `error_reporting.service_name`: [`String`] Identifier to running service. Self discovered on GCP. Default: `"ruby"`
85
+ * `error_reporting.service_version`: [`String`] Version identifier to running service. Self discovered on GCP.
86
+ * `error_reporting.ignore_classes`: [`Array`] An Array of Exception classes to ignore. Default: `[]`
87
+
88
+ #### Debugger
89
+
90
+ * `debugger.project_id`: [`String`] Google Cloud Platform Project identifier just for Debugger. Self discovered on GCP.
91
+ * `debugger.credentials`: [`String`] Path to service account JSON keyfile. Self discovered on GCP.
92
+ * `debugger.service_name`: [`String`] Identifier to running service. Self discovered on GCP. Default: `"ruby-app"`
93
+ * `debugger.service_version`: [`String`] Version identifier to running service. Self discovered on GCP.
94
+ * `debugger.root`: [`String`] The root directory of the debuggee application in absolute file path form. Default: `Rack::Directory#root` if the application framework is rack-based,i.e. Ruby on Rails, Sinatra. Otherwise use current working directory.
95
+ * `debugger.allow_mutating_methods`: [`boolean`] Whether to allow expressions to call methods that could mutate program state. Default is `false`.
96
+ * `debugger.evaluation_time_limit`: [`Numeric`] The time limit in seconds for evaluating expressions. Default is `0.05`.
97
+
98
+ #### Logging
99
+
100
+ * `logging.project_id`: [`String`] Google Cloud Platform Project identifier just for Logging. Self discovered on GCP.
101
+ * `logging.credentials`: [`String`] Path to service account JSON keyfile. Self discovered on GCP.
102
+ * `logging.log_name`: [`String`] Name of the application log file. Default: `"ruby_app_log"`
103
+ * `logging.log_name_map`: [`Hash`] Map specific request routes to other log. Default: `{ "/_ah/health" => "ruby_health_check_log" }`
104
+ * `logging.monitored_resource.type`: [`String`] Resource type name. See [full list](https://cloud.google.com/logging/docs/api/v2/resource-list). Self discovered on GCP.
105
+ * `logging.monitored_resource.labels`: [`Hash`] Resource labels. See [full list](https://cloud.google.com/logging/docs/api/v2/resource-list). Self discovered on GCP.
106
+ * `logging.labels`: [`Hash`] User defined labels. A `Hash` of label names to string label values or callables/`Proc` which are functions of the Rack environment.
107
+
108
+ #### Trace
109
+
110
+ * `trace.project_id`: [`String`] Google Cloud Platform Project identifier just for Trace. Self discovered on GCP.
111
+ * `trace.credentials`: [`String`] Path to service account JSON keyfile. Self discovered on GCP.
112
+ * `trace.capture_stack`: [`Boolean`] Whether to capture stack traces for each span. Default: `false`
113
+ * `trace.sampler`: [`Proc`] A sampler Proc makes the decision whether to record a trace for each request. Default: `Google::Cloud::Trace::TimeSampler`
114
+ * `trace.span_id_generator`: [`Proc`] A generator Proc that generates the name String for new TraceRecord. Default: `random numbers`
115
+ * `trace.notifications`: [`Array`] An array of ActiveSupport notification types to include in traces. Rails-only option. Default: `Google::Cloud::Trace::Railtie::DEFAULT_NOTIFICATIONS`
116
+ * `trace.max_data_length`: [`Integer`] The maximum length of span properties recorded with ActiveSupport notification events. Rails-only option. Default: `Google::Cloud::Trace::Notifications::DEFAULT_MAX_DATA_LENGTH`
data/OVERVIEW.md ADDED
@@ -0,0 +1,31 @@
1
+ # Stackdriver
2
+
3
+ The stackdriver gem instruments a Ruby web application for Stackdriver
4
+ diagnostics. When loaded, it integrates with Rails, Sinatra, or other Rack-based
5
+ web frameworks to collect application diagnostic and monitoring information for
6
+ your application.
7
+
8
+ Specifically, this gem is a convenience package that loads the following gems:
9
+
10
+ - [google-cloud-debugger](https://googlecloudplatform.github.io/google-cloud-ruby/docs/google-cloud-debugger)
11
+ - [google-cloud-error_reporting](https://googlecloudplatform.github.io/google-cloud-ruby/docs/google-cloud-error_reporting)
12
+ - [google-cloud-logging](https://googlecloudplatform.github.io/google-cloud-ruby/docs/google-cloud-logging)
13
+ - [google-cloud-trace](https://googlecloudplatform.github.io/google-cloud-ruby/docs/google-cloud-trace)
14
+
15
+ On top of that, stackdriver gem automatically activates the following
16
+ instrumentation features:
17
+
18
+ - [google-cloud-debugger instrumentation](https://googlecloudplatform.github.io/google-cloud-ruby/docs/google-cloud-debugger/latest/file.INSTRUMENTATION)
19
+ - [google-cloud-error_reporting strumentation](https://googlecloudplatform.github.io/google-cloud-ruby/docs/google-cloud-error_reporting/latest/file.INSTRUMENTATION)
20
+ - [google-cloud-logging instrumentation](https://googlecloudplatform.github.io/google-cloud-ruby/docs/google-cloud-logging/latest/file.INSTRUMENTATION)
21
+ - [google-cloud-trace instrumentation](https://googlecloudplatform.github.io/google-cloud-ruby/docs/google-cloud-trace/latest/file.INSTRUMENTATION)
22
+
23
+ ## Usage
24
+
25
+ Instead of requiring multiple Stackdriver client library gems and explicitly
26
+ load each built-in Railtie classes, now users can achieve all these through
27
+ requiring this single **stackdriver** umbrella gem.
28
+
29
+ ```ruby
30
+ require "stackdriver"
31
+ ```
@@ -14,5 +14,5 @@
14
14
 
15
15
 
16
16
  module Stackdriver
17
- VERSION = "0.15.1".freeze
17
+ VERSION = "0.15.2".freeze
18
18
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stackdriver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.1
4
+ version: 0.15.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Heng Xiong
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-10 00:00:00.000000000 Z
11
+ date: 2018-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-cloud-debugger
@@ -228,8 +228,12 @@ extensions: []
228
228
  extra_rdoc_files: []
229
229
  files:
230
230
  - ".yardopts"
231
+ - CHANGELOG.md
232
+ - CODE_OF_CONDUCT.md
233
+ - CONTRIBUTING.md
234
+ - INSTRUMENTATION_CONFIGURATION.md
231
235
  - LICENSE
232
- - README.md
236
+ - OVERVIEW.md
233
237
  - lib/stackdriver.rb
234
238
  - lib/stackdriver/version.rb
235
239
  homepage: https://github.com/GoogleCloudPlatform/google-cloud-ruby/tree/master/stackdriver
data/README.md DELETED
@@ -1,148 +0,0 @@
1
- # stackdriver
2
-
3
- This gem instruments a Ruby web application for Stackdriver diagnostics. When
4
- loaded, it integrates with Rails, Sinatra, or other Rack-based web frameworks
5
- to collect application diagnostic and monitoring information for your
6
- application.
7
-
8
- Specifically, this gem is a convenience package that loads and automatically
9
- activates the instrumentation features of the following gems:
10
-
11
- * [google-cloud-debugger](../google-cloud-debugger) which enables remote
12
- debugging using [Stackdriver Debugger](https://cloud.google.com/debugger/)
13
- * [google-cloud-error_reporting](../google-cloud-error_reporting) which
14
- reports unhandled exceptions and other errors to
15
- [Stackdriver Error Reporting](https://cloud.google.com/error-reporting/)
16
- * [google-cloud-logging](../google-cloud-logging) which collects application
17
- logs in [Stackdriver logging](https://cloud.google.com/logging/)
18
- * [google-cloud-trace](../google-cloud-trace) which reports distributed
19
- latency traces to [Stackdriver Trace](https://cloud.google.com/trace/)
20
-
21
- ## Quick Start
22
-
23
- ### Install the gem
24
-
25
- Add the `stackdriver` gem to your Gemfile:
26
-
27
- ```ruby
28
- gem "stackdriver"
29
- ```
30
-
31
- ### Instrument your code
32
-
33
- #### Using Ruby on Rails
34
-
35
- If you are running Ruby on Rails, the `stackdriver` gem will automatically
36
- install Railties that will instrument your application for basic diagnostics.
37
- In most applications, the gem will initialize itself, and you will not need to
38
- write any additional code.
39
-
40
- If your Rails application has removed the `Bundler.require` line in the
41
- `application.rb` initialization file, then you might need to require the gem
42
- explicitly with:
43
-
44
- ```ruby
45
- # In application.rb
46
- require "stackdriver"
47
- ```
48
-
49
- #### Other Rack-based frameworks
50
-
51
- If you are running another Rack-based framework, such as Sinatra, you should
52
- install the Rack Middleware provided by each library you want to use:
53
-
54
- ```ruby
55
- # In your Rack middleware configuration code.
56
- require "stackdriver"
57
- use Google::Cloud::Logging::Middleware
58
- use Google::Cloud::ErrorReporting::Middleware
59
- use Google::Cloud::Trace::Middleware
60
- use Google::Cloud::Debugger::Middleware
61
- ```
62
-
63
- #### Advanced instrumentation
64
-
65
- See the individual gem documentation for each gem for information on how to
66
- customize the instrumentation, e.g. how to manually report errors or add custom
67
- spans to latency traces.
68
-
69
- ### Viewing diagnostic reports
70
-
71
- Logs, errors, traces, and other reports can be viewed on the Google Cloud
72
- Console. If your app is hosted on Google Cloud (such as on Google App Engine,
73
- Google Kubernetes Engine, or Google Compute Engine), you can use the same
74
- project. Otherwise, if your application is hosted elsewhere, create a new
75
- project on [Google Cloud](https://console.cloud.google.com/).
76
-
77
- Make sure the [Stackdriver Error Reporting
78
- API](https://console.cloud.google.com/apis/library/clouderrorreporting.googleapis.com)
79
- is enabled on your Google Cloud project. (The other service APIs---debugging,
80
- logging, and tracing---are enabled by default on all new projects.)
81
-
82
- #### Authentication
83
-
84
- Your app also needs to authenticate with the Stackdriver services in order to
85
- send data.
86
-
87
- * If you are running on **Google App Engine**, authentication happens
88
- automatically. You do not need to do anything.
89
- * If you are running on **Google Kubernetes Engine**, you must explicitly add
90
- `https://www.googleapis.com/auth/cloud-platform` to the API access scopes
91
- when creating the cluster. Authentication will then happen automatically.
92
- * If you are running on **Google Compute Engine**, you must explicitly add
93
- `https://www.googleapis.com/auth/cloud-platform` to the API access scopes
94
- when creating the VM. Authentication will then happen automatically.
95
- * If you are not running on a Google Cloud hosting environment, you must set
96
- up a service account, and provide the Stackdriver library with the ID of
97
- your Google Cloud project, and the service account credentials.
98
-
99
- ```ruby
100
- # In your app initialization code
101
- Google::Cloud.configure do |config|
102
- config.project_id = "your-project-id"
103
- config.credentials = "/path/to/servce-account-keyfile.json"
104
- end
105
- ```
106
-
107
- See the gem documentation for each individual gem for more information.
108
-
109
- ## Supported Ruby Versions
110
-
111
- This library is supported on Ruby 2.3+.
112
-
113
- Google provides official support for Ruby versions that are actively supported
114
- by Ruby Core—that is, Ruby versions that are either in normal maintenance or in
115
- security maintenance, and not end of life. Currently, this means Ruby 2.3 and
116
- later. Older versions of Ruby _may_ still work, but are unsupported and not
117
- recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details
118
- about the Ruby support schedule.
119
-
120
- This library follows [Semantic Versioning](http://semver.org/). It is currently
121
- in major version zero (0.y.z), which means that anything may change at any time
122
- and the public API should not be considered stable.
123
-
124
- ## Contributing
125
-
126
- Contributions to this library are always welcome and highly encouraged.
127
-
128
- See the [Contributing
129
- Guide](http://googlecloudplatform.github.io/google-cloud-ruby/docs/stackdriver/latest/file.CONTRIBUTING)
130
- for more information on how to get started.
131
-
132
- Please note that this project is released with a Contributor Code of Conduct. By
133
- participating in this project you agree to abide by its terms. See [Code of
134
- Conduct](http://googlecloudplatform.github.io/google-cloud-ruby/docs/stackdriver/latest/file.CODE_OF_CONDUCT)
135
- for more information.
136
-
137
- ## License
138
-
139
- This library is licensed under Apache 2.0. Full license text is available in
140
- [LICENSE](LICENSE).
141
-
142
- ## Support
143
-
144
- Please [report bugs at the project on
145
- Github](https://github.com/GoogleCloudPlatform/google-cloud-ruby/issues). Don't
146
- hesitate to [ask
147
- questions](http://stackoverflow.com/questions/tagged/google-cloud-ruby) about
148
- the client or APIs on [StackOverflow](http://stackoverflow.com).