Class: Appsignal::CLI::Diagnose Private

Inherits:
Object
  • Object
show all
Extended by:
Data, Helpers
Defined in:
lib/appsignal/cli/diagnose.rb,
lib/appsignal/cli/diagnose/paths.rb,
lib/appsignal/cli/diagnose/utils.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Command line tool to run diagnostics on your project.

This command line tool is useful when testing AppSignal on a system and validating the local configuration. It outputs useful information to debug issues and it checks if AppSignal agent is able to run on the machine’s architecture and communicate with the AppSignal servers.

This diagnostic tool outputs the following:

  • if AppSignal can run on the host system.

  • if the configuration is valid and active.

  • if the Push API key is present and valid (internet connection required).

  • if the required system paths exist and are writable.

  • outputs AppSignal version information.

  • outputs information about the host system and Ruby.

  • outputs last lines from the available log files.

## Exit codes

  • Exits with status code ‘0` if the diagnose command has finished.

  • Exits with status code ‘1` if the diagnose command failed to finished.

Examples:

On the command line in your project

appsignal diagnose

With a specific environment

appsignal diagnose --environment=production

Automatically send the diagnose report without prompting

appsignal diagnose --send-report

Don’t prompt about sending the report and don’t sent it

appsignal diagnose --no-send-report

See Also:

Since:

  • 1.1.0

Defined Under Namespace

Modules: Data Classes: Paths, Utils

Constant Summary collapse

DIAGNOSE_ENDPOINT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Since:

  • 1.1.0

"https://appsignal.com/diag"

Class Method Summary collapse

Methods included from Data

current_section, data, data_section, save

Class Method Details

.run(options = {}) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :environment (String)

    environment to load configuration for.

Since:

  • 1.1.0



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/appsignal/cli/diagnose.rb', line 79

def run(options = {})
  # Do not start AppSignal on `Appsignal.start` and run the extension
  # and agent in diagnose mode.
  ENV["_APPSIGNAL_DIAGNOSE"] = "true"

  self.coloring = options.delete(:color) { true }
  $stdout.sync = true
  header
  print_empty_line

  library_information
  data[:installation] = fetch_installation_report
  print_installation_report
  print_empty_line

  host_information
  print_empty_line

  configure_appsignal(options)
  run_agent_diagnose_mode
  print_empty_line

  print_config_section
  print_empty_line

  check_api_key
  print_empty_line

  data[:process] = process_user

  paths_report = Paths.new
  data[:paths] = paths_report.report
  print_paths_section(paths_report)

  transmit_report_to_appsignal if send_report_to_appsignal?(options)
end