You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Stackdriver Debugger](https://cloud.google.com/debugger/)([docs](https://cloud.google.com/debugger/docs/)) lets you inspect the state of a running application at any code location in real time, without stopping or slowing down the application, and without modifying the code to add logging statements. You can use Stackdriver Debugger with any deployment of your application, including test, development, and production. The Ruby debugger adds minimal request latency, typically less than 50ms, and only when the application state is captured. In most cases, this is not noticeable by users.
3
+
[Stackdriver Debugger](https://cloud.google.com/debugger/) lets you inspect the state of a running application at any code location in real time, without stopping or slowing down the application, and without modifying the code to add logging statements. You can use Stackdriver Debugger with any deployment of your application, including test, development, and production. The Ruby debugger adds minimal request latency, typically less than 50ms, and only when the application state is captured. In most cases, this is not noticeable by users.
to be enabled on your Google Cloud project. Make sure it's enabled if not
39
+
already.
40
+
41
+
## Enabling the Debugger agent
42
+
43
+
If you're using Ruby on Rails and the `stackdriver` gem, they automatically
44
+
loads the library into your application when it starts.
45
+
46
+
Otherwise, you can load the Railtie that comes with the library into your Ruby
47
+
on Rails application by explicitly require it in the application startup path:
48
+
49
+
```ruby
50
+
# In config/application.rb
51
+
require"google/cloud/debugger/rails"
52
+
```
53
+
54
+
Other Rack-based frameworks, such as Sinatra, can use the Rack Middleware
55
+
provided by the library:
56
+
57
+
```ruby
58
+
require"google/cloud/debugger"
59
+
use Google::Cloud::Debugger::Middleware
60
+
```
61
+
62
+
Non-rack-based applications can start the agent explicitly at the entry point of
63
+
your application:
64
+
65
+
```ruby
66
+
require"google/cloud/debugger"
67
+
Google::Cloud::Debugger.new.start
68
+
```
69
+
70
+
### Configuring the agent
22
71
23
-
This library uses Service Account credentials to connect to Google Cloud services. When running on Compute Engine the credentials will be discovered automatically. When running on other environments the Service Account credentials can be specified by providing the path to the JSON file, or the JSON itself, in environment variables.
72
+
You can customize the behavior of the Stackdriver Debugger agent. See the
73
+
[agent configuration](../stackdriver/docs/configuration.md) for a list of
74
+
possible configuration options.
24
75
25
-
Instructions and configuration options are covered in the [Authentication Guide](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-debugger/guides/authentication).
76
+
## Running on Google Cloud Platform
26
77
27
-
## Usage
78
+
The Stackdriver Debugger agent should work without you manually providing
79
+
authentication credentials for instances running on Google Cloud Platform, as
80
+
long as the Stackdriver Debugger API access scope is enabled on that instance.
81
+
82
+
### App Engine
83
+
84
+
On Google App Engine, the Stackdriver Debugger API access scope is enabled by
85
+
default, and the Stackdriver Debugger agent can be used without providing
86
+
credentials or a project ID.
87
+
88
+
### Container Engine
89
+
90
+
On Google Container Engine, you must explicitly add the `cloud_debugger` OAuth
You can also do this through the Google Cloud Platform Console. Select
98
+
**Enabled** in the Cloud Platform section of **Create a container cluster**.
99
+
100
+
### Compute Engine
101
+
102
+
To use Stackdriver Debugger, Compute Engine VM instances should have one of the
103
+
following access scopes. These are only relevant when you use Compute Engine's
104
+
default service account:
105
+
106
+
*`https://www.googleapis.com/auth/cloud-platform`
107
+
*`https://www.googleapis.com/auth/cloud_debugger`
108
+
109
+
The `cloud-platform` access scope can be supplied when creating a new instance
110
+
through the Google Cloud Platform Console. Select **Allow full access to all
111
+
Cloud APIs** in the **Identity and API access** section of **Create an
112
+
instance**.
113
+
114
+
The `cloud_debugger` access scope must be supplied manually using the SDK's
115
+
`gcloud compute instances create` command or the `gcloud compute instances
116
+
set-service-account` command.
117
+
118
+
## Running locally and elsewhere
119
+
120
+
To run the Stackdriver Debugger agent outside of Google Cloud Platform, you must
121
+
supply your GCP project ID and appropriate service account credentials directly
122
+
to the Stackdriver Debugger agent. This applies to running the agent on your own
123
+
workstation, on your datacenter's computers, or on the VM instances of another
124
+
cloud provider. See the [Authentication section](#authentication) for
125
+
instructions on how to do so.
126
+
127
+
## Authentication
28
128
29
-
This library provides a Stackdriver Debugger Agent that's able to work with Ruby applications. It also integrates with Ruby on Rails and other popular Rack-based frameworks. See the [Instrumentation Guide](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-debugger/guides/instrumentation) for more details.
129
+
This library uses Service Account credentials to connect to Google Cloud
130
+
services. When running on Compute Engine the credentials will be discovered
131
+
automatically. When running on other environments the Service Account
132
+
credentials can be specified by providing in several ways.
133
+
134
+
The best way to provide authentication information if you're using Ruby on Rails
135
+
is through the Rails configuration interface:
136
+
137
+
```ruby
138
+
# in config/environments/*.rb
139
+
Rails.application.configure do |config|
140
+
# Shared parameters
141
+
config.google_cloud.project_id ="your-project-id"
142
+
config.google_cloud.keyfile ="/path/to/key.json"
143
+
# Or Stackdriver Debugger agent specific parameters
0 commit comments