google-cloud-debugger - Class Google::Cloud::Debugger::Agent (v0.42.2)
Reference documentation and code samples for the google-cloud-debugger class Google::Cloud::Debugger::Agent.
Agent
The Stackdriver Debugger Agent runs on the same system where a debuggee
application is running. The agent is responsible for sending state data,
such as the value of program variables and the call stack, to
Stackdriver Debugger when the code at a breakpoint location is executed.
The Debugger Agent runs in its own child thread when started. It ensures
the instrumented application is registered properly and constantly
monitors for any active breakpoints. Once the agent gets updated with
active breakpoints from Stackdriver Debugger service, it facilitates
the breakpoints in application requests thread, then transport the
result snapshot back to Stackdriver Debugger service asynchronously.
Absolute path to the debuggee Ruby application root directory. The
Stackdriver Debugger service creates canonical breakpoints with only
relative path. So the debugger agent combines the relative path to
the application directory to trace and evaluate breakpoints.
Returns
(String)
#app_root=
defapp_root=(value)->String
Absolute path to the debuggee Ruby application root directory. The
Stackdriver Debugger service creates canonical breakpoints with only
relative path. So the debugger agent combines the relative path to
the application directory to trace and evaluate breakpoints.
The gRPC Debuggee representation of the debuggee application. It
contains identification information to match running application to
specific Cloud Source Repository code base, and correctly group
same versions of the debuggee application together through a generated
unique identifier.
The logger used to write the results of Logpoints.
#logger=
deflogger=(value)
The logger used to write the results of Logpoints.
#quota_manager
defquota_manager()
A quota tracking object helps tracking resource consumption during
evaluations.
#quota_manager=
defquota_manager=(value)
A quota tracking object helps tracking resource consumption during
evaluations.
#start
defstart()
Starts the Debugger Agent in a child thread, where debuggee
application registration and breakpoints querying will take place.
It also starts the transmitter in another child thread.
#stop
defstop()
Stops and terminates the Debugger Agent. It also properly shuts down
transmitter and tracer.
Once Debugger Agent is stopped, it cannot be started again.
#stop_tracer
defstop_tracer()
Stops the tracer regardless of whether any active breakpoints are
present. Once the tracer stops monitoring the debuggee application,
the application can return to normal performance.
#tracer
deftracer()->Google::Cloud::Debugger::Tracer
It monitors the debuggee application and triggers breakpoint
evaluation when breakpoints are set.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# google-cloud-debugger - Class Google::Cloud::Debugger::Agent (v0.42.2)\n\nReference documentation and code samples for the google-cloud-debugger class Google::Cloud::Debugger::Agent.\n\nAgent\n-----\n\nThe Stackdriver Debugger Agent runs on the same system where a debuggee\napplication is running. The agent is responsible for sending state data,\nsuch as the value of program variables and the call stack, to\nStackdriver Debugger when the code at a breakpoint location is executed.\n\nThe Debugger Agent runs in its own child thread when started. It ensures\nthe instrumented application is registered properly and constantly\nmonitors for any active breakpoints. Once the agent gets updated with\nactive breakpoints from Stackdriver Debugger service, it facilitates\nthe breakpoints in application requests thread, then transport the\nresult snapshot back to Stackdriver Debugger service asynchronously. \n\nInherits\n--------\n\n- Object \n\nIncludes\n--------\n\n- Stackdriver::Core::AsyncActor\n\nExample\n-------\n\n```ruby\nrequire \"google/cloud/debugger\"\n\ndebugger = Google::Cloud::Debugger.new\nagent = debugger.agent\nagent.start\n```\n\nMethods\n-------\n\n### #app_root\n\n def app_root() -\u003e String\n\nAbsolute path to the debuggee Ruby application root directory. The\nStackdriver Debugger service creates canonical breakpoints with only\nrelative path. So the debugger agent combines the relative path to\nthe application directory to trace and evaluate breakpoints. \n**Returns**\n\n- (String)\n\n### #app_root=\n\n def app_root=(value) -\u003e String\n\nAbsolute path to the debuggee Ruby application root directory. The\nStackdriver Debugger service creates canonical breakpoints with only\nrelative path. So the debugger agent combines the relative path to\nthe application directory to trace and evaluate breakpoints. \n**Parameter**\n\n- **value** (String) \n**Returns**\n\n- (String)\n\n### #breakpoint_manager\n\n def breakpoint_manager() -\u003e Google::Cloud::Debugger::BreakpointManager\n\nIt manages syncing breakpoints between the Debugger Agent and\nStackdriver Debugger service \n**Returns**\n\n- ([Google::Cloud::Debugger::BreakpointManager](./Google-Cloud-Debugger-BreakpointManager))\n\n### #debuggee\n\n def debuggee() -\u003e Google::Cloud::Debugger::Debuggee\n\nThe gRPC Debuggee representation of the debuggee application. It\ncontains identification information to match running application to\nspecific Cloud Source Repository code base, and correctly group\nsame versions of the debuggee application together through a generated\nunique identifier. \n**Returns**\n\n- ([Google::Cloud::Debugger::Debuggee](./Google-Cloud-Debugger-Debuggee))\n\n### #initialize\n\n def initialize(service, service_name:, service_version:, logger: nil, app_root: nil) -\u003e Agent\n\nCreate a new Debugger Agent instance. \n**Parameters**\n\n- **service** (Google::Cloud::Debugger::Service) --- The gRPC Service object\n- **logger** (Google::Cloud::Logging::Logger) *(defaults to: nil)* --- The logger used to write the results of Logpoints.\n- **service_name** (String) --- Name for the debuggee application.\n- **service_version** (String) --- Version identifier for the debuggee application.\n- **app_root** (String) *(defaults to: nil)* --- Absolute path to the root directory of the debuggee application. Default to Rack root. \n**Returns**\n\n- ([Agent](./Google-Cloud-Debugger-Agent)) --- a new instance of Agent\n\n### #logger\n\n def logger()\n\nThe logger used to write the results of Logpoints.\n\n### #logger=\n\n def logger=(value)\n\nThe logger used to write the results of Logpoints.\n\n### #quota_manager\n\n def quota_manager()\n\nA quota tracking object helps tracking resource consumption during\nevaluations.\n\n### #quota_manager=\n\n def quota_manager=(value)\n\nA quota tracking object helps tracking resource consumption during\nevaluations.\n\n### #start\n\n def start()\n\nStarts the Debugger Agent in a child thread, where debuggee\napplication registration and breakpoints querying will take place.\nIt also starts the transmitter in another child thread.\n\n### #stop\n\n def stop()\n\nStops and terminates the Debugger Agent. It also properly shuts down\ntransmitter and tracer.\n\n\n\u003cbr /\u003e\n\nOnce Debugger Agent is stopped, it cannot be started again.\n\n### #stop_tracer\n\n def stop_tracer()\n\nStops the tracer regardless of whether any active breakpoints are\npresent. Once the tracer stops monitoring the debuggee application,\nthe application can return to normal performance.\n\n### #tracer\n\n def tracer() -\u003e Google::Cloud::Debugger::Tracer\n\nIt monitors the debuggee application and triggers breakpoint\nevaluation when breakpoints are set. \n**Returns**\n\n- ([Google::Cloud::Debugger::Tracer](./Google-Cloud-Debugger-Tracer))\n\n### #transmitter\n\n def transmitter() -\u003e Google::Cloud::Debugger::Transmiter\n\nIt sends evaluated breakpoints snapshot back to Stackdriver Debugger\nService. \n**Returns**\n\n- (Google::Cloud::Debugger::Transmiter)\n\nConstants\n---------\n\n### DEFAULT_LOG_NAME\n\n**value:** \"debugger_logpoints\".freeze \nName of the logpoints log file."]]