Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: format codeblocks #18996

Merged
merged 17 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ If no data appears in the UI, try the following steps to diagnose the problem:
>
1. Use `dpkg` to verify that the agent is installed:

```
```sh
dpkg -l | grep newrelic-infra
```
2. If `dpkg` returns no output, see [Install with apt](/docs/infrastructure/new-relic-infrastructure/installation/install-infrastructure-linux#apt-based).
Expand All @@ -58,7 +58,7 @@ If no data appears in the UI, try the following steps to diagnose the problem:
>
1. Use `rpm` to verify that agent is installed:

```
```sh
rpm -qa | grep newrelic-infra
```
2. If `rpm` returns no output, see [Install with yum](/docs/infrastructure/new-relic-infrastructure/installation/install-infrastructure-linux#yum-based).
Expand All @@ -70,7 +70,7 @@ If no data appears in the UI, try the following steps to diagnose the problem:
>
1. Use the Windows command prompt or Powershell to verify that the [agent directory](/docs/agents/manage-apm-agents/troubleshooting/find-agent-root-directory#infra-agent) exists:

```
```sh
dir "C:\Program Files\New Relic\newrelic-infra"
```
2. If you receive a `File not found` error, see [Install for Windows Server](/docs/infrastructure/new-relic-infrastructure/installation/install-infrastructure-windows-server).
Expand All @@ -87,12 +87,12 @@ If no data appears in the UI, try the following steps to diagnose the problem:

1. Check that the agent is running:

```
```sh
sudo systemctl status newrelic-infra
```
2. If the agent isn't running, start the agent manually:

```
```sh
sudo systemctl start newrelic-infra
```
</Collapser>
Expand All @@ -105,12 +105,12 @@ If no data appears in the UI, try the following steps to diagnose the problem:

1. Check that the agent is running:

```
```sh
sudo /etc/init.d/newrelic-infra status
```
2. If the agent isn't running, start the agent manually:

```
```sh
sudo /etc/init.d/newrelic-infra start
```
</Collapser>
Expand All @@ -123,12 +123,12 @@ If no data appears in the UI, try the following steps to diagnose the problem:

1. Check that the agent is running:

```
```sh
sudo initctl status newrelic-infra
```
2. If the agent isn't running, start the agent manually:

```
```sh
sudo initctl start newrelic-infra
```
</Collapser>
Expand All @@ -141,13 +141,13 @@ If no data appears in the UI, try the following steps to diagnose the problem:

1. Check that the agent is running:

```
```sh
sc query "newrelic-infra" | find "RUNNING"
```

2. If the agent isn't running, start the agent manually with the Windows command prompt:

```
```sh
net start newrelic-infra
```

Expand All @@ -166,7 +166,7 @@ If no data appears in the UI, try the following steps to diagnose the problem:
6. Verify that no firewalls or proxies are blocking outbound connections from the agent process to the [Infrastructure domains and ports](/docs/apm/new-relic-apm/getting-started/networks#infrastructure).
7. Confirm the host is reporting correctly even though it is not appearing in the infrastructure monitoring UI by creating a basic query in Query builder, like:

```
```sql
SELECT * FROM SystemSample SINCE 60 minutes ago LIMIT 100
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Generating `debug` log files requires editing your configuration file. For a sam
<td>
Edit your `newrelic-infra.yml` file with logging settings:

```
```yml
log:
level: debug
file: /path/to/logfile.log
Expand Down Expand Up @@ -138,15 +138,15 @@ These are some additional notes and requirements for specific systems, used to s

* Recommended: Set the environment variable `NRIA_LOG_LEVEL` to `debug`. Running this on the command line would look like:

```
```sh
-e NRIA_LOG_LEVEL=debug
```

OR
* Edit the config file to set `level: debug` in the `log` section. (Editing the config file in a container is not recommended, because it requires rebuilding the image twice: once to add verbose logging and once to remove it.)
2. Use `journalctl` to collect the logs:

```
```sh
journalctl -u newrelic-infra > newrelic-infra.log
```
3. Set the logging level back to `info` or `warn` after collecting logs for a few minutes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

The following example shows a typical configuration for the agent log in Linux systems (change file path when running Windows or other platforms):

```
```yml
log:
level: info
file: '/var/log/newrelic-infra/newrelic-infra.log'
Expand Down Expand Up @@ -60,7 +60,7 @@

Alternatively, logs can be formatted as a JSON file:

```
```json
{"context":{},"level":"info","msg":"upstart_interval_sec: 0","timestamp":"2019-07-11T18:24:03+02:00"}
{"context":{},"level":"info","msg":"plugin_dir: ","timestamp":"2019-07-11T18:24:03+02:00"}
```
Expand All @@ -81,18 +81,18 @@

## Integration log management

Integrations write JSON payloads into STDOUT and plain-text (JSON structured in the future) logs into STDERR.
Integrations write JSON payloads into `STDOUT` and plain-text (JSON structured in the future) logs into `STDERR`.

The infrastructure agent handles integration STDERR lines and forward this output into the agent log.
The infrastructure agent handles integration `STDERR` lines and forward this output into the agent log.

Agent handles each STDERR line as follows:
Agent handles each `STDERR` line as follows:

* <DNT>**when agent runs in verbose mode**</DNT>: it just forwards the full STDERR line as a DEBUG agent log entry placing integration line contexts within the \`msg\` field.
* <DNT>**otherwise**</DNT>: it parses the line against the expected format (see below) and only logs as agent ERROR level, entries produced by integrations with \`fatal\` or \`error\` severity levels. In this case fields are extracted and forwarded in structured manner (therefore if JSON output is enabled for the agent fields become queryable.
* <DNT>**When agent runs in verbose mode**</DNT>: it just forwards the full `STDERR` line as a DEBUG agent log entry placing integration line contexts within the `msg` field.
* <DNT>**Otherwise**</DNT>: it parses the line against the expected format (see below) and only logs as agent ERROR level, entries produced by integrations with `fatal` or `error` severity levels. In this case fields are extracted and forwarded in structured manner (therefore if JSON output is enabled for the agent fields become queryable.

Check warning on line 91 in src/content/docs/infrastructure/infrastructure-troubleshooting/troubleshoot-logs/infrastructure-agent-logging-behavior.mdx

View workflow job for this annotation

GitHub Actions / vale-linter

[vale] reported by reviewdog 🐶 [Microsoft.Passive] 'are extracted' looks like passive voice. Raw Output: {"message": "[Microsoft.Passive] 'are extracted' looks like passive voice.", "location": {"path": "src/content/docs/infrastructure/infrastructure-troubleshooting/troubleshoot-logs/infrastructure-agent-logging-behavior.mdx", "range": {"start": {"line": 91, "column": 218}}}, "severity": "INFO"}

Check warning on line 91 in src/content/docs/infrastructure/infrastructure-troubleshooting/troubleshoot-logs/infrastructure-agent-logging-behavior.mdx

View workflow job for this annotation

GitHub Actions / vale-linter

[vale] reported by reviewdog 🐶 [Microsoft.Passive] 'is enabled' looks like passive voice. Raw Output: {"message": "[Microsoft.Passive] 'is enabled' looks like passive voice.", "location": {"path": "src/content/docs/infrastructure/infrastructure-troubleshooting/troubleshoot-logs/infrastructure-agent-logging-behavior.mdx", "range": {"start": {"line": 91, "column": 293}}}, "severity": "INFO"}

By default, the infrastructure agent filters out any errors from integrations that don't prevent the integration from running. You'll only see all errors from an integration if the log level is set to DEBUG, or if the integration is specifically listed in the log configuration. For example, in this configuration, all errors coming from `nri-mssql` will be shown, even if the log level is INFO:

```YAML
```yml
log:
include_filters:
integration_name:
Expand All @@ -109,7 +109,7 @@

Internally agent used this regex to extract the fields:

```
```regex
([^\s]*?)=(".*?[^\\]"|&{.*?}|[^\s]*)
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3500,26 +3500,26 @@ Metrics can also be enriched with extended cloud metadata (including custom reso

In this example, we exclude process metrics using executable files and names:

```
exclude_matching_metrics: # You can combine attributes from different metrics
process.name:
- regex "^java" # Exclude all processes starting with "java"
process.executable:
- "/usr/bin/python2" # Exclude the Python 2.x executable
- regex "\\System32\\svchost" # Exclude all svchost executables
```yml
exclude_matching_metrics: # You can combine attributes from different metrics
process.name:
- regex "^java" # Exclude all processes starting with "java"
process.executable:
- "/usr/bin/python2" # Exclude the Python 2.x executable
- regex "\\System32\\svchost" # Exclude all svchost executables
```

To configure `exclude_matching_metrics` as an environment variable for the [Kubernetes integration](/docs/kubernetes-pixie/kubernetes-integration/get-started/introduction-kubernetes-integration/), add it in the manifest inside the `env:` object:

```yml
env:
- name: NRIA_EXCLUDE_MATCHING_METRICS
value: |
process.name:
- regex "^java"
process.executable:
- "/usr/bin/python2"
- regex "\\System32\\svchost"
- name: NRIA_EXCLUDE_MATCHING_METRICS
value: |
process.name:
- regex "^java"
process.executable:
- "/usr/bin/python2"
- regex "\\System32\\svchost"
```

Default
Expand Down Expand Up @@ -5940,83 +5940,83 @@ If you are having problems with proxy configuration, see [Proxy troubleshooting]

```bash
curl http://localhost:8003/v1/status
{
"checks": {
"endpoints": [
{
"url": "https://infrastructure-command-api.newrelic.com/agent_commands/v1/commands",
"reachable": true
},
{
"url": "https://infra-api.newrelic.com/infra/v2/metrics",
"reachable": true
},
{
"url": "https://identity-api.newrelic.com/identity/v1",
"reachable": true
},
{
"url": "https://infra-api.newrelic.com/inventory",
"reachable": true
}
]
},
"config": {
"reachability_timeout": "10s"
}
}
[output] {
[output] "checks": {
[output] "endpoints": [
[output] {
[output] "url": "https://infrastructure-command-api.newrelic.com/agent_commands/v1/commands",
[output] "reachable": true
[output] },
[output] {
[output] "url": "https://infra-api.newrelic.com/infra/v2/metrics",
[output] "reachable": true
[output] },
[output] {
[output] "url": "https://identity-api.newrelic.com/identity/v1",
[output] "reachable": true
[output] },
[output] {
[output] "url": "https://infra-api.newrelic.com/inventory",
[output] "reachable": true
[output] }
[output] ]
[output] },
[output] "config": {
[output] "reachability_timeout": "10s"
[output] }
[output] }
```

Main status endpoint (with errors):

```bash
curl http://localhost:8003/v1/status
{
"checks": {
"endpoints": [
{
"url": "https://staging-infra-api.newrelic.com/infra/v2/metrics",
"reachable": false,
"error": "endpoint check timeout exceeded"
},
{
"url": "https://infra-api.newrelic.com/infra/v2/metrics",
"reachable": true
},
{
"url": "https://identity-api.newrelic.com/identity/v1",
"reachable": true
},
{
"url": "https://infra-api.newrelic.com/inventory",
"reachable": true
}
]
},
"config": {
"reachability_timeout": "10s"
}
}
[output] {
[output] "checks": {
[output] "endpoints": [
[output] {
[output] "url": "https://staging-infra-api.newrelic.com/infra/v2/metrics",
[output] "reachable": false,
[output] "error": "endpoint check timeout exceeded"
[output] },
[output] {
[output] "url": "https://infra-api.newrelic.com/infra/v2/metrics",
[output] "reachable": true
[output] },
[output] {
[output] "url": "https://identity-api.newrelic.com/identity/v1",
[output] "reachable": true
[output] },
[output] {
[output] "url": "https://infra-api.newrelic.com/inventory",
[output] "reachable": true
[output] }
[output] ]
[output] },
[output] "config": {
[output] "reachability_timeout": "10s"
[output] }
[output] }
```

Errors endpoint example:

```bash
curl http://localhost:18003/v1/status/errors
{
"checks": {
"endpoints": [
{
"url": "https://staging-infra-api.newrelic.com/infra/v2/metrics",
"reachable": false,
"error": "endpoint check timeout exceeded"
}
]
},
"config": {
"reachability_timeout": "10s"
}
}
[output] {
[output] "checks": {
[output] "endpoints": [
[output] {
[output] "url": "https://staging-infra-api.newrelic.com/infra/v2/metrics",
[output] "reachable": false,
[output] "error": "endpoint check timeout exceeded"
[output] }
[output] ]
[output] },
[output] "config": {
[output] "reachability_timeout": "10s"
[output] }
[output] }
```

This is similar to the main status endpoint but filtering those with errors only.
Expand All @@ -6025,10 +6025,10 @@ If you are having problems with proxy configuration, see [Proxy troubleshooting]

```bash
curl http://localhost:8003/v1/status/entity
{
"guid":"MMMMNjI0NjR8SU5GUkF8TkF8ODIwMDg3MDc0ODE0MTUwNTMy",
"key":"your-host-name"
}
[output] {
[output] "guid":"MMMMNjI0NjR8SU5GUkF8TkF8ODIwMDg3MDc0ODE0MTUwNTMy",
[output] "key":"your-host-name"
[output] }
```

Returns information about the agent/host entity. A response status code _204_ ("No Content") will be returned when the agent still has no information
Expand Down
Loading
Loading