github.com/waldiirawan/apm-agent-go/v2@v2.2.2/docs/troubleshooting.asciidoc (about)

     1  [[troubleshooting]]
     2  == Troubleshooting
     3  
     4  Is something not working as expected?
     5  Don't worry if you can't figure out what the problem is; we’re here to help!
     6  First, ensure your app is compatible with the agent's <<supported-tech,supported technologies>>.
     7  
     8  If you're an existing Elastic customer with a support contract, please create a ticket in the
     9  https://support.elastic.co/customers/s/login/[Elastic Support portal].
    10  Other users can post in the https://discuss.elastic.co/c/apm[APM discuss forum].
    11  
    12  IMPORTANT: *Please upload your complete debug logs* to a service like https://gist.github.com[GitHub Gist]
    13  so that we can analyze the problem.
    14  Logs should include everything from when the application starts up until the first request executes.
    15  Instructions for enabling logging are below.
    16  
    17  [float]
    18  [[agent-logging]]
    19  === Logging
    20  
    21  Agent logs are critical to the debugging process.
    22  By default, this logging is disabled. To enable it, set a log output file with <<config-log-file,`ELASTIC_APM_LOG_FILE`>>.
    23  Alternatively, if you're using Docker or Kubernetes and are okay with mixing agent and application logs,
    24  you can set `ELASTIC_APM_LOG_FILE=stderr`.
    25  
    26  NOTE: The agent does not rotate log files. Log rotation must be handled externally.
    27  
    28  With logging enabled, use <<config-log-level,`ELASTIC_APM_LOG_LEVEL`>> to increase the granularity of the agent's logging.
    29  For example: `ELASTIC_APM_LOG_LEVEL=debug`.
    30  
    31  Be sure to execute a few requests to your application before posting your log files.
    32  Each request should add lines similar to these in the logs:
    33  
    34  [source,log]
    35  ----
    36  {"level":"debug","time":"2020-07-23T11:46:32+08:00","message":"sent request with 100 transactions, 0 spans, 0 errors, 0 metricsets"}
    37  ----
    38  
    39  If you don't see lines like these, it's likely that you haven't instrumented your application correctly.
    40  
    41  [float]
    42  [[disable-agent]]
    43  === Disable the Agent
    44  
    45  In the unlikely event the agent causes disruptions to a production application,
    46  you can disable the agent while you troubleshoot.
    47  
    48  If you have access to <<dynamic-configuration,dynamic configuration>>,
    49  you can disable the recording of events by setting <<config-recording,`ELASTIC_APM_RECORDING`>> to `false`.
    50  When changed at runtime from a supported source, there's no need to restart your application.
    51  
    52  If that doesn't work, or you don't have access to dynamic configuration, you can disable the agent by setting
    53  <<config-active,`ELASTIC_APM_ACTIVE`>> to `false`.
    54  Restart your application for the changes to apply.