diff --git a/.codecov.yml b/.codecov.yml index 2ce5446ec4..805f4e052d 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -199,10 +199,6 @@ coverage: target: 75 flags: - tidb - Traefik: - target: 75 - flags: - - traefik Trino: target: 75 flags: @@ -601,11 +597,6 @@ flags: paths: - tidb/datadog_checks/tidb - tidb/tests - traefik: - carryforward: true - paths: - - traefik/datadog_checks/traefik - - traefik/tests trino: carryforward: true paths: diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 07bb3ac846..7dc004736b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -205,7 +205,6 @@ /tidb/ @SabaPing xuyifan02@pingcap.com @DataDog/ecosystems-review /tidb_cloud/ @SabaPing xuyifan02@pingcap.com @DataDog/ecosystems-review /torq/ @torqio/rnd support@torq.io -/traefik/ @renaudhager /trino/ @ndrluis /twenty_forty_eight/ @DataDog/apps-sdk @DataDog/ecosystems-review /twingate/ @emrul partnerships@twingate.com @DataDog/ecosystems-review @@ -1106,13 +1105,6 @@ /tidb/assets/monitors @SabaPing xuyifan02@pingcap.com @DataDog/documentation @DataDog/monitor-app @DataDog/agent-integrations /tidb/assets/logs/ @SabaPing xuyifan02@pingcap.com @DataDog/agent-integrations @DataDog/logs-backend -/traefik/*metadata.csv @renaudhager @DataDog/documentation -/traefik/manifest.json @renaudhager @DataDog/documentation -/traefik/README.md @renaudhager @DataDog/documentation -/traefik/assets/dashboards @renaudhager @DataDog/documentation @DataDog/dashboards-backend @DataDog/agent-integrations -/traefik/assets/monitors @renaudhager @DataDog/documentation @DataDog/monitor-app @DataDog/agent-integrations -/traefik/assets/logs/ @renaudhager @DataDog/agent-integrations @DataDog/logs-backend - /twingate/*metadata.csv @emrul partnerships@twingate.com @DataDog/documentation @DataDog/ecosystems-review /twingate/manifest.json @emrul partnerships@twingate.com @DataDog/documentation @DataDog/ecosystems-review diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index b8bf42b317..6697f31e01 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -1227,25 +1227,6 @@ jobs: test-py3: ${{ inputs.test-py3 }} setup-env-vars: "${{ inputs.setup-env-vars }}" secrets: inherit - j54ace69: - uses: DataDog/integrations-core/.github/workflows/test-target.yml@master - with: - job-name: Traefik - target: traefik - platform: linux - runner: '["ubuntu-22.04"]' - repo: "${{ inputs.repo }}" - python-version: "${{ inputs.python-version }}" - standard: ${{ inputs.standard }} - latest: ${{ inputs.latest }} - agent-image: "${{ inputs.agent-image }}" - agent-image-py2: "${{ inputs.agent-image-py2 }}" - agent-image-windows: "${{ inputs.agent-image-windows }}" - agent-image-windows-py2: "${{ inputs.agent-image-windows-py2 }}" - test-py2: ${{ inputs.test-py2 }} - test-py3: ${{ inputs.test-py3 }} - setup-env-vars: "${{ inputs.setup-env-vars }}" - secrets: inherit jd73ec80: uses: DataDog/integrations-core/.github/workflows/test-target.yml@master with: diff --git a/traefik/CHANGELOG.md b/traefik/CHANGELOG.md deleted file mode 100644 index 4396dc7c93..0000000000 --- a/traefik/CHANGELOG.md +++ /dev/null @@ -1,26 +0,0 @@ -# CHANGELOG - traefik - -## 1.1.0 / 2023-06-13 - -***Added***: - -* Add `pyproject.toml` file ([#1195](https://github.com/DataDog/integrations-extras/pull/1195)) -* Add curated_metric column to metadata.csv files ([#1209](https://github.com/DataDog/integrations-extras/pull/1209)) -* Add average_response_time_sec to traefik integration ([#836](https://github.com/DataDog/integrations-extras/pull/836). Thanks [divyamamgai](https://github.com/divyamamgai)) - -***Fixed***: - -* Do not use requests directly ([#1090](https://github.com/DataDog/integrations-extras/pull/1090)) - -## 0.2.0 - -***Added***: - -* configuration now allows scheme parameter - -## 0.1.0 - -***Added***: - -* first version - diff --git a/traefik/README.md b/traefik/README.md index e9203f3f6d..1a590a6ac8 100644 --- a/traefik/README.md +++ b/traefik/README.md @@ -1,217 +1,5 @@ # Traefik Integration -## Overview +This integration has been moved to [integrations-core repo][1]. All development continues there. -Send [Traefik][1] metrics, logs, and traces to Datadog to monitor your Traefik services. - -## Setup - -The Traefik check is not included in the [Datadog Agent][2] package, so you need to install it. - -### Installation - -For Agent v7.21+ / v6.21+, follow the instructions below to install the Traefik check on your host. See [Use Community Integrations][3] to install with the Docker Agent or earlier versions of the Agent. - -1. Run the following command to install the Agent integration: - - ```shell - datadog-agent integration install -t datadog-traefik== - ``` - -2. Configure your integration similar to core [integrations][4]. - -### Configuration - - - - -#### About v2 -For information about the changes from v1 to v2, see the [Traefik migration guide][5]. For information about the latest version, see the [Traefik documentation][6]. - -#### Metric collection - -Follow [Traefik's documentation][7] to send [Traefik metrics][8] to Datadog. - -#### Log collection - -**Available for Agent >6.0** - -By default, [Traefik logs][9] are sent to stdout. This should not be changed for containerized version, because the Datadog Agent can collect logs directly from the container `stdout`/`stderr`. - -1. To configure [Traefik to log to a file][9], add the following in the Traefik configuration file: - - ```conf - [traefikLog] - filePath = "/path/to/traefik.log" - format = "json" - ``` - - The [common Apache Access format][10] is used by default and is supported by this integration. - -2. Collecting logs is disabled by default in the Datadog Agent. Enable it in your `datadog.yaml` file with: - - ```yaml - logs_enabled: true - ``` - -3. Add this configuration block to your `traefik.d/conf.yaml` file at the root of your [Agent's configuration directory][11] 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. - -4. [Restart the Agent][12] - -#### Trace collection - -1. [Enable APM][13] for Datadog, if needed. -2. Follow [Traefik's documentation][14] to send [traces][15] to Datadog. - - - - -#### About v1 - -See [Traefik documentation][16] for information about v1. For information about the changes from v1 to v2, see the [Traefik migration guide][17]. - -#### Metric collection - -1. To collect Traefik [metrics][17], open the `traefik.d/conf.yaml` file in the `conf.d/` folder at the root of your [Agent's configuration directory][18]. - -2. Add this configuration setup to your `traefik.d/conf.yaml` file to start gathering your [metrics][17]: - - ```yaml - init_config: - - instances: - - host: 10.1.2.3 - port: "8080" - path: "/health" - scheme: "http" - ``` - - Configuration Options: - - - host: Traefik endpoint to query. **Required** - - port: API listener of Traefik endpoint. Default value `8080`. _Optional_ - - path: Path of Traefik health check endpoint. Default `/health`. _Optional_ - - scheme: Scheme of Traefik health check endpoint. Default `http`. _Optional_ - -3. [Restart the Agent][19] to begin sending Traefik metrics to Datadog. - -See the [sample traefik.d/conf.yaml][20] for all available configuration options. - -#### Log collection - -**Available for Agent >6.0** - -By default, [Traefik logs][21] are sent to stdout. This should not be changed for containerized version, as the Datadog Agent is able to collect logs directly from container `stdout`/`stderr`. - -1. To configure [Traefik to log to a file][21], add the following in the Traefik configuration file: - - ```conf - [traefikLog] - filePath = "/path/to/traefik.log" - format = "json" - ``` - - The [common Apache Access format][22] is used by default and is supported by this integration. - -2. Collecting logs is disabled by default in the Datadog Agent. Enable it in your `datadog.yaml` file with: - - ```yaml - logs_enabled: true - ``` - -3. Add this configuration block to your `traefik.d/conf.yaml` file at the root of your [Agent's configuration directory][18] 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. - -4. [Restart the Agent][19] - -#### Trace collection - -**Available for Traefik v1.7+** - -1. [Enable APM][23] for Datadog, if needed. -2. Follow [Traefik's documentation][24] to send traces to Datadog. - - - - -### Validation - -[Run the Agent's `status` subcommand][25] and look for `traefik` under the Checks section. - -## Compatibility - -The check is compatible with all major platforms. - -**Metrics** - -For v2, see the list of [Traefik metrics][26] sent to Datadog. - -For v1, see the list of [metrics][27] provided by the integration. - -## Data Collected - -### Metrics - -See [metadata.csv][28] for a list of metrics provided by this integration. - -### Events - -The Traefik check does not include any events. - -### Service Checks - -See [service_checks.json][29] for a list of service checks provided by this integration. - -## Troubleshooting - -Need help? Contact [Datadog support][30]. - -[1]: https://traefik.io -[2]: https://app.datadoghq.com/account/settings/agent/latest -[3]: https://docs.datadoghq.com/agent/guide/use-community-integrations/ -[4]: https://docs.datadoghq.com/getting_started/integrations/ -[5]: https://doc.traefik.io/traefik/v2.0/migration/v1-to-v2/ -[6]: https://doc.traefik.io/traefik/ -[7]: https://doc.traefik.io/traefik/observability/metrics/datadog/ -[8]: https://doc.traefik.io/traefik/observability/metrics/overview/ -[9]: https://doc.traefik.io/traefik/observability/logs/#filepath -[10]: https://doc.traefik.io/traefik/observability/logs/#format -[11]: https://docs.datadoghq.com/agent/faq/agent-configuration-files/#agent-configuration-directory -[12]: https://docs.datadoghq.com/agent/faq/agent-commands/#start-stop-restart-the-agent -[13]: https://docs.datadoghq.com/getting_started/tracing/#enable-apm -[14]: https://doc.traefik.io/traefik/observability/tracing/datadog/ -[15]: https://doc.traefik.io/traefik/observability/tracing/overview/ -[16]: https://doc.traefik.io/traefik/v1.7/ -[17]: https://github.com/DataDog/integrations-extras/blob/master/traefik/metadata.csv -[18]: https://docs.datadoghq.com/agent/faq/agent-configuration-files/#agent-configuration-directory -[19]: https://docs.datadoghq.com/agent/faq/agent-commands/#start-stop-restart-the-agent -[20]: https://github.com/DataDog/integrations-extras/blob/master/traefik/datadog_checks/traefik/data/conf.yaml.example -[21]: https://doc.traefik.io/traefik/v1.7/configuration/logs/#traefik-logs -[22]: https://doc.traefik.io/traefik/v1.7/configuration/logs/#clf-common-log-format -[23]: https://docs.datadoghq.com/getting_started/tracing/#enable-apm -[24]: https://doc.traefik.io/traefik/v1.7/configuration/tracing/#datadog -[25]: https://docs.datadoghq.com/agent/guide/agent-commands/#service-status -[26]: https://doc.traefik.io/traefik/observability/metrics/overview/ -[27]: https://docs.datadoghq.com/integrations/traefik/#metrics -[28]: https://github.com/DataDog/integrations-extras/blob/master/traefik/metadata.csv -[29]: https://github.com/DataDog/integrations-extras/blob/master/traefik/assets/service_checks.json -[30]: https://docs.datadoghq.com/help +[1]: https://github.com/DataDog/integrations-core/tree/9938bf3afc91b8a12b83d3f79ef6941d3a0ed21e/traefik_mesh diff --git a/traefik/assets/logos/avatars-bot.png b/traefik/assets/logos/avatars-bot.png deleted file mode 100644 index 9705296a07..0000000000 Binary files a/traefik/assets/logos/avatars-bot.png and /dev/null differ diff --git a/traefik/assets/logos/saas_logos-bot.png b/traefik/assets/logos/saas_logos-bot.png deleted file mode 100644 index c745ba3868..0000000000 Binary files a/traefik/assets/logos/saas_logos-bot.png and /dev/null differ diff --git a/traefik/assets/logos/saas_logos-small.png b/traefik/assets/logos/saas_logos-small.png deleted file mode 100644 index 19e94fbcf6..0000000000 Binary files a/traefik/assets/logos/saas_logos-small.png and /dev/null differ diff --git a/traefik/assets/logs/traefik.yaml b/traefik/assets/logs/traefik.yaml deleted file mode 100644 index 5aa72bf0b8..0000000000 --- a/traefik/assets/logs/traefik.yaml +++ /dev/null @@ -1,228 +0,0 @@ -id: traefik -metric_id: traefik -backend_only: false -facets: - - facetType: range - groups: - - Measure - name: Duration - path: duration - source: log - type: double - unit: - family: time - name: nanosecond - - groups: - - Web Access - name: Method - path: http.method - source: log - - groups: - - Web Access - name: Referer - path: http.referer - source: log - - groups: - - Web Access - name: Status Code - path: http.status_code - source: log - - groups: - - Web Access - name: URL Host - path: http.url_details.host - source: log - - groups: - - Web Access - name: URL Path - path: http.url_details.path - source: log - - groups: - - Web Access - name: URL Port - path: http.url_details.port - source: log - - groups: - - Web Access - name: URL scheme - path: http.url_details.scheme - source: log - - groups: - - Web Access - name: Browser - path: http.useragent_details.browser.family - source: log - - groups: - - Web Access - name: Device - path: http.useragent_details.device.family - source: log - - groups: - - Web Access - name: OS - path: http.useragent_details.os.family - source: log - - groups: - - Web Access - name: Client IP - path: network.client.ip - source: log - - groups: - - Web Access - name: Client Port - path: network.client.port - source: log -pipeline: - type: pipeline - name: Traefik - enabled: true - filter: - query: source:traefik - processors: - - type: grok-parser - name: Parsing Traefik logs - enabled: true - source: message - samples: - - 10.32.0.1 - - [07/Dec/2018:06:07:03 +0000] "GET / HTTP/1.1" 302 5 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36" 132170 "entrypoint redirect for http" "/" 0ms - - time="2019-04-05T11:57:47Z" level=info msg="Skipping same configuration for provider consul_catalog" - grok: - supportRules: | - _duration %{number:duration:scale(1000000)} - _traefik_backend_url %{regex("[^\\\"“]*"):traefik.backend_url} - _traefik_name %{regex("[^\\\"]*"):traefik.name} - _total_request %{number:traefik.request_total} - _auth %{notSpace:http.auth:nullIf("-")} - _bytes_written %{integer:network.bytes_written} - _client_ip %{ipOrHost:network.client.ip} - _version HTTP\/%{regex("\\d+\\.\\d+"):http.version} - _url %{notSpace:http.url} - _ident %{notSpace:http.ident:nullIf("-")} - _user_agent %{regex("[^\\\"]*"):http.useragent} - _referer %{notSpace:http.referer} - _status_code %{integer:http.status_code} - _method %{word:http.method} - _date_access %{date("dd/MMM/yyyy:HH:mm:ss Z"):date_access} - matchRules: | - access.common %{_client_ip} %{_ident} %{_auth} \[%{_date_access}\] "(?>%{_method} |)%{_url}(?> %{_version}|)" %{_status_code} (?>%{_bytes_written}|-) "%{_referer}" "%{_user_agent}" %{_total_request} "?%{_traefik_name}"? "?%{_traefik_backend_url}["“]? %{_duration}ms.* - - keyvalue %{data::keyvalue} - - - type: message-remapper - name: Define `msg` as the official message of the log - enabled: true - sources: - - msg - - type: attribute-remapper - name: Map `RequestMethod` to `http.method` - enabled: true - sources: - - RequestMethod - target: http.method - preserveSource: false - overrideOnConflict: false - sourceType: attribute - targetType: attribute - - type: attribute-remapper - name: Map `Duration` to `duration` - enabled: true - sources: - - Duration - target: duration - preserveSource: false - overrideOnConflict: false - sourceType: attribute - targetType: attribute - - type: attribute-remapper - name: Map `ClientHost` to `network.client.ip` - enabled: true - sources: - - ClientHost - target: network.client.ip - preserveSource: false - overrideOnConflict: false - sourceType: attribute - targetType: attribute - - type: attribute-remapper - name: Map `ClientPort` to `network.client.port` - enabled: true - sources: - - ClientPort - target: network.client.port - preserveSource: false - overrideOnConflict: false - sourceType: attribute - targetType: attribute - - type: attribute-remapper - name: Map `OriginStatus`, `DownstreamStatus` to `http.status_code` - enabled: true - sources: - - OriginStatus - - DownstreamStatus - target: http.status_code - preserveSource: false - overrideOnConflict: false - sourceType: attribute - targetType: attribute - - type: attribute-remapper - name: Map `RequestContentSize` to `network.bytes_read` - enabled: true - sources: - - RequestContentSize - target: network.bytes_read - preserveSource: false - overrideOnConflict: false - sourceType: attribute - targetType: attribute - - type: attribute-remapper - name: Map `DownstreamContentSize` to `network.bytes_written` - enabled: true - sources: - - DownstreamContentSize - target: network.bytes_written - preserveSource: false - overrideOnConflict: false - sourceType: attribute - targetType: attribute - - type: url-parser - name: '' - enabled: true - sources: - - http.url - - RequestPath - target: http.url_details - - type: user-agent-parser - name: '' - enabled: true - sources: - - http.useragent - target: http.useragent_details - encoded: false - - type: date-remapper - name: Define `date_access` as the official date of the log - enabled: true - sources: - - date_access - - type: category-processor - name: Categorise status code - enabled: true - categories: - - filter: - query: '@http.status_code:[200 TO 299]' - name: OK - - filter: - query: '@http.status_code:[300 TO 399]' - name: notice - - filter: - query: '@http.status_code:[400 TO 499]' - name: warning - - filter: - query: '@http.status_code:[500 TO 599]' - name: error - target: http.status_category - - type: status-remapper - name: Define `http.status_category`, `level` as the official status of the log - enabled: true - sources: - - http.status_category - - level diff --git a/traefik/assets/logs/traefik_tests.yaml b/traefik/assets/logs/traefik_tests.yaml deleted file mode 100644 index 5df899627d..0000000000 --- a/traefik/assets/logs/traefik_tests.yaml +++ /dev/null @@ -1,245 +0,0 @@ -id: "traefik" -tests: - - - sample: "10.32.0.1 - - [07/Dec/2018:06:07:03 +0000] \"GET / HTTP/1.1\" 302 5 \"-\" \"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36\" 132170 \"entrypoint redirect for http\" \"/“ 0ms" - result: - custom: - date_access: 1544162823000 - duration: 0.0 - http: - method: "GET" - referer: "-" - status_category: "notice" - status_code: 302 - url: "/" - url_details: - path: "/" - useragent: "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36" - useragent_details: - browser: - family: "Chrome" - major: "51" - minor: "0" - patch: "2704" - patch_minor: "103" - device: - category: "Desktop" - family: "Other" - os: - family: "Windows" - major: "10" - version: "1.1" - network: - bytes_written: 5 - client: - ip: "10.32.0.1" - traefik: - backend_url: "/" - name: "entrypoint redirect for http" - request_total: 132170.0 - message: "10.32.0.1 - - [07/Dec/2018:06:07:03 +0000] \"GET / HTTP/1.1\" 302 5 \"-\" \"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36\" 132170 \"entrypoint redirect for http\" \"/“ 0ms" - status: "notice" - tags: - - "source:LOGS_SOURCE" - timestamp: 1544162823000 - - - sample: "10.32.0.1 - - [07/Dec/2018:04:36:29 +0000] \"GET / HTTP/1.1\" 302 5 \"-\" \"HTTP Banner Detection (https://security.ipip.net)\" 132167 \"entrypoint redirect for http\" \"/“ 0ms" - result: - custom: - date_access: 1544157389000 - duration: 0.0 - http: - method: "GET" - referer: "-" - status_category: "notice" - status_code: 302 - url: "/" - url_details: - path: "/" - useragent: "HTTP Banner Detection (https://security.ipip.net)" - useragent_details: - browser: - family: "Other" - device: - brand: "Generic" - category: "Other" - family: "Generic Feature Phone" - model: "Feature Phone" - os: - family: "Other" - version: "1.1" - network: - bytes_written: 5 - client: - ip: "10.32.0.1" - traefik: - backend_url: "/" - name: "entrypoint redirect for http" - request_total: 132167.0 - message: "10.32.0.1 - - [07/Dec/2018:04:36:29 +0000] \"GET / HTTP/1.1\" 302 5 \"-\" \"HTTP Banner Detection (https://security.ipip.net)\" 132167 \"entrypoint redirect for http\" \"/“ 0ms" - status: "notice" - tags: - - "source:LOGS_SOURCE" - timestamp: 1544157389000 - - - sample: "time=\"2019-04-05T11:57:47Z\" level=info msg=\"Skipping same configuration for provider consul_catalog\"" - result: - custom: - level: "info" - time: "2019-04-05T11:57:47Z" - message: "Skipping same configuration for provider consul_catalog" - status: "info" - tags: - - "source:LOGS_SOURCE" - timestamp: 1 - - - sample: |- - { - "RequestPath" : "https://mail.google.com/mail/u/0/#inbox", - "ClientAddr" : "180.150.154.44:5051", - "RequestHost" : "https://datadoghq.com", - "RequestMethod" : "GET", - "ClientPort" : "5051", - "RequestProtocol" : "1.1", - "BackendAddr" : "127.0.0.1:8088", - "OriginStatusLine" : "404 page not found", - "RequestCount" : 2, - "BackendName" : "unicorn-backend", - "OriginContentSize" : 257, - "OriginStatus" : 404, - "RequestContentSize" : 456, - "BackendURL" : { - "ForceQuery" : false, - "Host" : "127.0.0.1:8088" - }, - "RetryAttempts" : 2, - "ClientUsername" : "-", - "DownstreamStatus" : 404, - "RequestPort" : "6014", - "Duration" : 12345678, - "OriginDuration" : 1345642, - "RequestAddr" : "127.150.32.44:10514", - "ClientHost" : "180.150.154.44", - "RequestLine" : "GET https://mail.google.com/mail/u/0/#inbox HTTP/1.1", - "DownstreamStatusLine" : "404 page not found", - "DownstreamContentSize" : 203, - "Overhead" : 100, - "GzipRatio" : 5, - "FrontendName" : "this-is-my-frontend-name" - } - result: - custom: - BackendAddr: "127.0.0.1:8088" - BackendName: "unicorn-backend" - BackendURL: - ForceQuery: false - Host: "127.0.0.1:8088" - ClientAddr: "180.150.154.44:5051" - ClientUsername: "-" - DownstreamStatusLine: "404 page not found" - FrontendName: "this-is-my-frontend-name" - GzipRatio: 5 - OriginContentSize: 257 - OriginDuration: 1345642 - OriginStatusLine: "404 page not found" - Overhead: 100 - RequestAddr: "127.150.32.44:10514" - RequestCount: 2 - RequestHost: "https://datadoghq.com" - RequestLine: "GET https://mail.google.com/mail/u/0/#inbox HTTP/1.1" - RequestPath: "https://mail.google.com/mail/u/0/#inbox" - RequestPort: "6014" - RequestProtocol: "1.1" - RetryAttempts: 2 - duration: 12345678 - http: - method: "GET" - status_category: "warning" - status_code: 404 - url_details: - hash: "inbox" - host: "mail.google.com" - path: "/mail/u/0/" - scheme: "https" - network: - bytes_read: 456 - bytes_written: 203 - client: - ip: "180.150.154.44" - port: "5051" - message: |- - { - "RequestPath" : "https://mail.google.com/mail/u/0/#inbox", - "ClientAddr" : "180.150.154.44:5051", - "RequestHost" : "https://datadoghq.com", - "RequestMethod" : "GET", - "ClientPort" : "5051", - "RequestProtocol" : "1.1", - "BackendAddr" : "127.0.0.1:8088", - "OriginStatusLine" : "404 page not found", - "RequestCount" : 2, - "BackendName" : "unicorn-backend", - "OriginContentSize" : 257, - "OriginStatus" : 404, - "RequestContentSize" : 456, - "BackendURL" : { - "ForceQuery" : false, - "Host" : "127.0.0.1:8088" - }, - "RetryAttempts" : 2, - "ClientUsername" : "-", - "DownstreamStatus" : 404, - "RequestPort" : "6014", - "Duration" : 12345678, - "OriginDuration" : 1345642, - "RequestAddr" : "127.150.32.44:10514", - "ClientHost" : "180.150.154.44", - "RequestLine" : "GET https://mail.google.com/mail/u/0/#inbox HTTP/1.1", - "DownstreamStatusLine" : "404 page not found", - "DownstreamContentSize" : 203, - "Overhead" : 100, - "GzipRatio" : 5, - "FrontendName" : "this-is-my-frontend-name" - } - status: "warn" - tags: - - "source:LOGS_SOURCE" - timestamp: 1 - - - sample: "127.0.0.1 - - [07/Dec/2018:04:36:29 +0000] \"GET /ping HTTP/1.1\" 200 2 \"-\" \"-\" 1 - - 0ms" - result: - custom: - date_access: 1544157389000 - duration: 0.0 - http: - method: "GET" - referer: "-" - status_category: "OK" - status_code: 200 - url: "/ping" - url_details: - path: "/ping" - useragent: "-" - useragent_details: - browser: - family: "Other" - device: - category: "Other" - family: "Other" - os: - family: "Other" - version: "1.1" - network: - bytes_written: 2 - client: - ip: "127.0.0.1" - traefik: - backend_url: "-" - name: "-" - request_total: 1.0 - message: "127.0.0.1 - - [07/Dec/2018:04:36:29 +0000] \"GET /ping HTTP/1.1\" 200 2 \"-\" \"-\" 1 - - 0ms" - status: "ok" - tags: - - "source:LOGS_SOURCE" - timestamp: 1544157389000 - diff --git a/traefik/assets/service_checks.json b/traefik/assets/service_checks.json deleted file mode 100644 index f970b644ff..0000000000 --- a/traefik/assets/service_checks.json +++ /dev/null @@ -1,20 +0,0 @@ -[ - { - "agent_version": "5.5.0", - "integration": "Traefik", - "groups": [ - "host", - "check", - "service", - "traefik" - ], - "check": "traefik.check", - "statuses": [ - "ok", - "critical", - "unknown" - ], - "name": "Health check", - "description": "Returns ok if the Traefik is up, critical when down and unknown when unknown exception occurred." - } -] diff --git a/traefik/datadog_checks/__init__.py b/traefik/datadog_checks/__init__.py deleted file mode 100644 index fda0dcc702..0000000000 --- a/traefik/datadog_checks/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# (C) Datadog, Inc. 2018 -# All rights reserved -# Licensed under a 3-clause BSD style license (see LICENSE) - -__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/traefik/datadog_checks/traefik/__about__.py b/traefik/datadog_checks/traefik/__about__.py deleted file mode 100644 index c551fe4899..0000000000 --- a/traefik/datadog_checks/traefik/__about__.py +++ /dev/null @@ -1,5 +0,0 @@ -# (C) Datadog, Inc. 2018 -# All rights reserved -# Licensed under a 3-clause BSD style license (see LICENSE) - -__version__ = '1.1.0' diff --git a/traefik/datadog_checks/traefik/__init__.py b/traefik/datadog_checks/traefik/__init__.py deleted file mode 100644 index 719f39cb23..0000000000 --- a/traefik/datadog_checks/traefik/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -# (C) Datadog, Inc. 2018 -# All rights reserved -# Licensed under a 3-clause BSD style license (see LICENSE) - -from .__about__ import __version__ -from .traefik import TraefikCheck - -__all__ = ['__version__', 'TraefikCheck'] diff --git a/traefik/datadog_checks/traefik/data/conf.yaml.example b/traefik/datadog_checks/traefik/data/conf.yaml.example deleted file mode 100644 index 958af983f9..0000000000 --- a/traefik/datadog_checks/traefik/data/conf.yaml.example +++ /dev/null @@ -1,23 +0,0 @@ -init_config: - -instances: - - ## @param host - string - required - ## Traefik host endpoint to connect to. - # - - host: - - ## @param port - integer - optional - default: 8080 - ## Port to connect to when reaching to `host`. - # - # port: 8080 - - ## @param path - string - optional - default: /health - ## Traefik host endpoint path to gather data from. - # - # path: "/health" - - ## @param scheme - string - optional - default: http - ## Traefik host scheme to use when reaching `host`. - # - # scheme: "http" diff --git a/traefik/datadog_checks/traefik/traefik.py b/traefik/datadog_checks/traefik/traefik.py deleted file mode 100644 index 59acd86546..0000000000 --- a/traefik/datadog_checks/traefik/traefik.py +++ /dev/null @@ -1,59 +0,0 @@ -# (C) Datadog, Inc. 2018 -# All rights reserved -# Licensed under a 3-clause BSD style license (see LICENSE) -from requests.exceptions import ConnectionError -from six import iteritems - -from datadog_checks.base import AgentCheck, ConfigurationError - - -class TraefikCheck(AgentCheck): - def check(self, instance): - host = instance.get('host') - port = instance.get('port', '8080') - path = instance.get('path', '/health') - scheme = instance.get('scheme', 'http') - - if not host: - self.warning('Configuration error, you must define `host`') - raise ConfigurationError('Configuration error, you must define `host`') - - try: - url = '{}://{}:{}{}'.format(scheme, host, port, path) - response = self.http.get(url) - response_status_code = response.status_code - - if response_status_code == 200: - self.service_check('traefik.health', self.OK) - - payload = response.json() - - if 'total_status_code_count' in payload: - status_code_counts = payload['total_status_code_count'] - - for status_code, count in iteritems(status_code_counts): - self.gauge('traefik.total_status_code_count', count, ['status_code:{}'.format(status_code)]) - - else: - self.log.debug('Field total_status_code_count not found in response.') - - if 'total_count' in payload: - self.gauge('traefik.total_count', payload['total_count']) - else: - self.log.debug('Field total_count not found in response.') - - if 'average_response_time_sec' in payload: - self.gauge('traefik.average_response_time_sec', payload['average_response_time_sec']) - else: - self.log.debug('Field average_response_time_sec not found in response.') - - else: - self.service_check( - 'traefik.health', self.CRITICAL, message='Traefik health check return code is not 200' - ) - - except ConnectionError: - self.service_check('traefik.health', self.CRITICAL, message='Traefik endpoint unreachable') - - except Exception as e: - self.service_check('traefik.health', self.UNKNOWN, message='UNKNOWN exception: {}'.format(e)) diff --git a/traefik/hatch.toml b/traefik/hatch.toml deleted file mode 100644 index e2b324f5c0..0000000000 --- a/traefik/hatch.toml +++ /dev/null @@ -1,13 +0,0 @@ -[env.collectors.datadog-checks] - -[[envs.default.matrix]] -python = ["2.7", "3.11"] -version = ["1.6", "1.7"] - -[envs.default.overrides] -matrix.version.env-vars = [ - { key = "TRAEFIK_VERSION", value = "v{matrix:version}" }, -] - -[envs.default] -e2e-env = false diff --git a/traefik/images/total_count_requests.png b/traefik/images/total_count_requests.png deleted file mode 100644 index 43cceb480f..0000000000 Binary files a/traefik/images/total_count_requests.png and /dev/null differ diff --git a/traefik/images/total_count_requests_status_code.png b/traefik/images/total_count_requests_status_code.png deleted file mode 100644 index 951c98b22c..0000000000 Binary files a/traefik/images/total_count_requests_status_code.png and /dev/null differ diff --git a/traefik/manifest.json b/traefik/manifest.json deleted file mode 100644 index dfd0fcc4b1..0000000000 --- a/traefik/manifest.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "manifest_version": "2.0.0", - "app_uuid": "3e412d36-f638-4cb0-9068-294aac7a84e2", - "app_id": "traefik", - "display_on_public_website": true, - "tile": { - "overview": "README.md#Overview", - "configuration": "README.md#Setup", - "support": "README.md#Support", - "changelog": "CHANGELOG.md", - "description": "collects traefik metrics", - "title": "Traefik", - "media": [], - "classifier_tags": [ - "Category::Cloud", - "Category::Log Collection", - "Supported OS::Linux", - "Supported OS::Windows", - "Supported OS::macOS" - ] - }, - "author": { - "support_email": "help@datadoghq.com", - "homepage": "https://github.com/DataDog/integrations-extras", - "sales_email": "help@datadoghq.com", - "name": "Community" - }, - "assets": { - "integration": { - "source_type_name": "Traefik", - "configuration": {}, - "events": { - "creates_events": false - }, - "metrics": { - "prefix": "traefik.", - "check": "traefik.total_status_code_count", - "metadata_path": "metadata.csv" - }, - "service_checks": { - "metadata_path": "assets/service_checks.json" - }, - "source_type_id": 10047, - "auto_install": true - } - } -} \ No newline at end of file diff --git a/traefik/metadata.csv b/traefik/metadata.csv deleted file mode 100644 index d6d8cf3a42..0000000000 --- a/traefik/metadata.csv +++ /dev/null @@ -1,4 +0,0 @@ -metric_name,metric_type,interval,unit_name,per_unit_name,description,orientation,integration,short_name,curated_metric -traefik.total_status_code_count,gauge,,,,total count for each returned status code,0,traefik,, -traefik.total_count,gauge,,,,count total number of requests,0,traefik,, -traefik.service.request.total,count,,,,total count of HTTP requests processed on a service,0,traefik,, diff --git a/traefik/pyproject.toml b/traefik/pyproject.toml deleted file mode 100644 index f3877e480b..0000000000 --- a/traefik/pyproject.toml +++ /dev/null @@ -1,61 +0,0 @@ -[build-system] -requires = [ - "hatchling>=0.12.0", - "setuptools<61", -] -build-backend = "hatchling.build" - -[project] -name = "datadog-traefik" -description = "The Traefik check" -readme = "README.md" -license = {text = "BSD-3-Clause"} -keywords = [ - "datadog", - "datadog agent", - "datadog check", - "traefik", -] -authors = [ - { email = "renaudhager@users.noreply.github.com" }, -] -classifiers = [ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "Intended Audience :: System Administrators", - "License :: OSI Approved :: BSD License", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3.11", - "Topic :: System :: Monitoring", - "Private :: Do Not Upload", -] -dependencies = [ - "datadog-checks-base>=4.2.0", -] -dynamic = [ - "version", -] - -[project.optional-dependencies] -deps = [] - -[project.urls] -Source = "https://github.com/DataDog/integrations-extras" - -[tool.hatch.version] -path = "datadog_checks/traefik/__about__.py" - -[tool.hatch.build.targets.sdist] -include = [ - "/datadog_checks", - "/tests", - "/manifest.json", -] - -[tool.hatch.build.targets.wheel] -include = [ - "/datadog_checks/traefik", -] -dev-mode-dirs = [ - ".", -] diff --git a/traefik/setup.py b/traefik/setup.py deleted file mode 100644 index e82c873e34..0000000000 --- a/traefik/setup.py +++ /dev/null @@ -1,75 +0,0 @@ -# (C) Datadog, Inc. 2018 -# All rights reserved -# Licensed under a 3-clause BSD style license (see LICENSE) - -from codecs import open -from os import path - -from setuptools import setup - -HERE = path.abspath(path.dirname(__file__)) - -# Get version info -ABOUT = {} -with open(path.join(HERE, "datadog_checks", "traefik", "__about__.py")) as f: - exec(f.read(), ABOUT) - -# Get the long description from the README file -with open(path.join(HERE, 'README.md'), encoding='utf-8') as f: - long_description = f.read() - - -def get_dependencies(): - dep_file = path.join(HERE, 'requirements.in') - if not path.isfile(dep_file): - return [] - - with open(dep_file, encoding='utf-8') as f: - return f.readlines() - - -def parse_pyproject_array(name): - import os - import re - from ast import literal_eval - - pattern = r'^{} = (\[.*?\])$'.format(name) - - with open(os.path.join(HERE, 'pyproject.toml'), 'r', encoding='utf-8') as f: - # Windows \r\n prevents match - contents = '\n'.join(line.rstrip() for line in f.readlines()) - - array = re.search(pattern, contents, flags=re.MULTILINE | re.DOTALL).group(1) - return literal_eval(array) - - -CHECKS_BASE_REQ = parse_pyproject_array('dependencies')[0] - -setup( - name='datadog-traefik', - version=ABOUT["__version__"], - description='collects traefik metrics', - long_description=long_description, - keywords='datadog agent check', - url='https://github.com/DataDog/integrations-extras', - author='Renaud Hager', - author_email='paas@argos.co.uk', - license='BSD', - # See https://pypi.org/classifiers - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Intended Audience :: Developers', - 'Intended Audience :: System Administrators', - 'Topic :: System :: Monitoring', - 'License :: OSI Approved :: BSD License', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.7', - ], - # The package we're going to ship - packages=['datadog_checks.traefik'], - # Run-time dependencies - install_requires=[CHECKS_BASE_REQ], - extras_require={'deps': parse_pyproject_array('deps')}, - # Extra files to ship with the wheel - include_package_data=True, -) diff --git a/traefik/tests/__init__.py b/traefik/tests/__init__.py deleted file mode 100644 index a383179a00..0000000000 --- a/traefik/tests/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# (C) Datadog, Inc. 2018 -# All rights reserved -# Licensed under a 3-clause BSD style license (see LICENSE) diff --git a/traefik/tests/common.py b/traefik/tests/common.py deleted file mode 100644 index d84bc60c56..0000000000 --- a/traefik/tests/common.py +++ /dev/null @@ -1,16 +0,0 @@ -# (C) Datadog, Inc. 2019 -# All rights reserved -# Licensed under a 3-clause BSD style license (see LICENSE) -import os - -from datadog_checks.dev import get_docker_hostname, get_here - -HERE = get_here() -DOCKER_COMPOSE_FILE = os.path.join(HERE, 'docker', 'docker-compose.yaml') -HOST = get_docker_hostname() -PORT = '8080' -SCHEME = 'http' - -INSTANCE = {'scheme': SCHEME, 'host': HOST, 'port': PORT} -INSTANCE_BAD = {'scheme': 'https', 'host': 'foobar', 'port': 9000} -INSTANCE_INVALID = {} diff --git a/traefik/tests/conftest.py b/traefik/tests/conftest.py deleted file mode 100644 index 167b88bb46..0000000000 --- a/traefik/tests/conftest.py +++ /dev/null @@ -1,35 +0,0 @@ -import pytest -import requests - -from datadog_checks.dev import WaitFor, docker_run - -from . import common - - -def ping_traefik(): - response = requests.get('{}://{}:{}/health'.format(common.SCHEME, common.HOST, common.PORT)) - response.raise_for_status() - - # Trigger a 404 - requests.get('http://{}:800'.format(common.HOST)) - - -@pytest.fixture(scope='session') -def dd_environment(): - with docker_run(common.DOCKER_COMPOSE_FILE, conditions=[WaitFor(ping_traefik)]): - yield common.INSTANCE - - -@pytest.fixture -def instance(): - return common.INSTANCE - - -@pytest.fixture -def instance_bad(): - return common.INSTANCE_BAD - - -@pytest.fixture -def instance_invalid(): - return common.INSTANCE_INVALID diff --git a/traefik/tests/docker/docker-compose.yaml b/traefik/tests/docker/docker-compose.yaml deleted file mode 100644 index 936767dd40..0000000000 --- a/traefik/tests/docker/docker-compose.yaml +++ /dev/null @@ -1,10 +0,0 @@ -version: '3' - -services: - traefik: - image: traefik:${TRAEFIK_VERSION} - ports: - - 800:80 - - 8080:8080 - volumes: - - ./traefik.toml:/etc/traefik/traefik.toml:ro diff --git a/traefik/tests/docker/traefik.toml b/traefik/tests/docker/traefik.toml deleted file mode 100644 index a1cebd9330..0000000000 --- a/traefik/tests/docker/traefik.toml +++ /dev/null @@ -1,25 +0,0 @@ - -logLevel = "DEBUG" - -[entryPoints] - [entryPoints.http] - address = ":80" - - # [entryPoints.dashboard] - # address = ":8080" - -# [traefikLog] -# format = "json" - -# API definition -[api] - - entryPoint = "traefik" - dashboard = true - debug = false - - [api.statistics] - recentErrors = 10 - - - diff --git a/traefik/tests/test_check.py b/traefik/tests/test_check.py deleted file mode 100644 index ebeab6760f..0000000000 --- a/traefik/tests/test_check.py +++ /dev/null @@ -1,29 +0,0 @@ -import pytest - -from datadog_checks.base import ConfigurationError -from datadog_checks.traefik import TraefikCheck - - -def test_config(instance_invalid): - c = TraefikCheck('traefik', {}, {}, None) - - with pytest.raises(ConfigurationError): - c.check(instance_invalid) - - -def test_bad_url(aggregator, instance_bad): - c = TraefikCheck('traefik', {}, {}, None) - c.check(instance_bad) - - aggregator.assert_service_check('traefik.health', TraefikCheck.CRITICAL) - - -@pytest.mark.integration -@pytest.mark.usefixtures('dd_environment') -def test_check(aggregator, instance): - c = TraefikCheck('traefik', {}, {}, None) - c.check(instance) - - aggregator.assert_metric('traefik.total_count', value=1) - aggregator.assert_metric('traefik.total_status_code_count', value=1, tags=['status_code:404']) - aggregator.assert_service_check('traefik.health', TraefikCheck.OK)