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

Add log instruction on traefik integration #249

Merged
merged 6 commits into from
Jan 7, 2019
Merged
Show file tree
Hide file tree
Changes from 2 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
58 changes: 55 additions & 3 deletions traefik/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,25 @@

## Overview

This integration collects data from Traefik and checks its health.
This integration collects data from Traefik in order to check its health and monitor:

- Errors logs (4xx codes, 5xx codes)
- Number of requests
- Number of bytes exchanged


## Setup

### Installation

The Traefik check is included in the Datadog Agent package. To start gathering your Traefik metrics and logs, you need to [install the Datadog Agent][1]

masci marked this conversation as resolved.
Show resolved Hide resolved
### Configuration

Create a `traefik.yaml` in the Datadog Agent's `conf.d` directory.
1. Edit the `traefik.d/conf.yaml` file in the `conf.d/` folder at the root of your [Agent's configuration directory][7] to start collecting your Traefik [metrics](#metric-collection) and [logs](#log-collection).
See the [sample traefik.d/conf.yaml][8] for all available configuration options.

2. [Restart the Agent][3]

#### Metric Collection

Expand All @@ -31,6 +43,42 @@ Configuration Options:

[Restart the Agent][3] to begin sending Traefik metrics to Datadog.

#### Log Collection

**Available for Agent >6.0**

By default [Traefik logging][9] feature logs to stdout. This should not be changed for containerised version as the Datadog Agent is able to collect logs directly from container `Stdout`/`Stderr`.

To configure Traefik to log into a file simply add the following in the Traefik configuration file:

```
[traefikLog]
filePath = "/path/to/traefik.log"
```

The [common Apache Access format][10] is used by default and is supported by this integration.

1. Collecting logs is disabled by default in the Datadog Agent. Enable it in your `datadog.yaml` file with:

```yaml
logs_enabled: true
```


2. Add this configuration block to your `traefik.d/conf.yaml` file at the root of your [Agent's configuration directory][7] to start collecting your Traefik logs:

```yaml
logs:
- type: file
path: /path/to/traefik.log
source: traefik
service: traefik
```

* Change the `path` and `service` parameter values and configure them for your environment.

* [Restart the Agent][3]

### Validation

[Run the Agent's `status` subcommand][4] and look for `traefik` under the Checks section:
Expand Down Expand Up @@ -75,4 +123,8 @@ Refer to the [main documentation][6] for more details about how to test and deve
[3]: https://docs.datadoghq.com/agent/faq/agent-commands/#start-stop-restart-the-agent
[4]: https://docs.datadoghq.com/agent/faq/agent-commands/#agent-status-and-information
[5]: https://github.com/DataDog/cookiecutter-datadog-check/blob/master/%7B%7Bcookiecutter.check_name%7D%7D/metadata.csv
[6]: https://docs.datadoghq.com/developers/
[6]: https://docs.datadoghq.com/developers/
[7]: https://docs.datadoghq.com/agent/faq/agent-configuration-files/#agent-configuration-directory
[8]: https://github.com/DataDog/integrations-extras/blob/master/traefik/conf.yaml.example
[9]: https://docs.traefik.io/configuration/logs/#traefik-logs
[10]: https://docs.traefik.io/configuration/logs/#clf-common-log-format
2 changes: 1 addition & 1 deletion traefik/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"guid": "000-000",
"public_title": "traefik Integration",
"categories":[],
"categories":["log collection"],
"type":"check",
"doc_link": "",
"aliases":[],
Expand Down