# Monitoring

## [Logging](https://docs.sentry.io/product/relay/monitoring.md#logging)

Relay produces logs to the standard error stream (`stderr`), with `INFO` logging level by default. For example, after starting Relay you may see output such as this:

```bash
INFO  relay::setup > launching relay from config folder .relay
INFO  relay::setup >   relay mode: managed
INFO  relay::setup >   relay id: cde0d72e-0c4e-4550-a934-c1867d8a177c
INFO  relay::setup >   log level: INFO
```

This example displays the messages with the default logging level (`INFO`), which you can modify so it displays either more or less information. For details about configuring logging please see the [Logging](https://docs.sentry.io/product/relay/options.md#logging) section on the options page.

## [Error Reporting](https://docs.sentry.io/product/relay/monitoring.md#error-reporting)

By default, Relay logs errors to the configured logger. You can enable error reporting to your project in Sentry in the Relay configuration file:

```yaml
sentry:
  enabled: true
  dsn: <your_dsn>
```

More information about available options and their meaning can be found [on the options page](https://docs.sentry.io/product/relay/options.md#internal-error-reporting).

## [Health Checks](https://docs.sentry.io/product/relay/monitoring.md#health-checks)

Relay provides two URLs for checking system status:

* `GET /api/relay/healthcheck/live/`: Tests if Relay is running and listening to HTTP requests.
* `GET /api/relay/healthcheck/ready/`: Tests if Relay is authenticated with the upstream and operating normally.

Both endpoints return a *200 OK* response when successful:

```json
{
  "is_healthy": true
}
```

## [Metrics](https://docs.sentry.io/product/relay/monitoring.md#metrics)

You can submit stats to a StatsD server by configuring the `metrics.statsd` key to an `ip:port` tuple.

### [Example Configuration](https://docs.sentry.io/product/relay/monitoring.md#example-configuration)

```yaml
metrics:
  # Endpoint of your StatsD server
  statsd: 127.0.0.1:8126
  # Prefix all metric names with this string
  prefix: mycompany.relay
```

The options for configuring metrics reporting are documented on the [options page](https://docs.sentry.io/product/relay/options.md#statsd-metrics).

## [Learn More](https://docs.sentry.io/product/relay/monitoring.md#learn-more)

* #### [Collected Metrics](https://docs.sentry.io/product/relay/monitoring/collected-metrics.md)

  Learn what metrics Relay produces.
