Skip to content

Commit e6b077a

Browse files
authored
Initial release for integration DuckDB (#19238)
* create duckdb * fix readme * implementation v1 * implementation v2 * add tests * test * commit * docker * add tests * bump to python3.12 * clean files * rewrite tests * tests * tests * commit * commit * commit * commit * commit * commit * ci * asset * add service check * metadata * labler * licenses * licenses * tests * remove file * add e2e test * base check * lint * remove service check * commit
1 parent a0ac38c commit e6b077a

35 files changed

+936
-1
lines changed

.codecov.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ coverage:
186186
target: 75
187187
flags:
188188
- druid
189+
DuckDB:
190+
target: 75
191+
flags:
192+
- duckdb
189193
EKS_Fargate:
190194
target: 75
191195
flags:
@@ -974,6 +978,11 @@ flags:
974978
paths:
975979
- druid/datadog_checks/druid
976980
- druid/tests
981+
duckdb:
982+
carryforward: true
983+
paths:
984+
- duckdb/datadog_checks/duckdb
985+
- duckdb/tests
977986
ecs_fargate:
978987
carryforward: true
979988
paths:

.github/workflows/config/labeler.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ integration/dotnetclr:
177177
- dotnetclr/**/*
178178
integration/druid:
179179
- druid/**/*
180+
integration/duckdb:
181+
- duckdb/**/*
180182
integration/ecs_fargate:
181183
- ecs_fargate/**/*
182184
integration/eks_anywhere:

.github/workflows/test-all.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,6 +1154,26 @@ jobs:
11541154
minimum-base-package: ${{ inputs.minimum-base-package }}
11551155
pytest-args: ${{ inputs.pytest-args }}
11561156
secrets: inherit
1157+
j9eb6aa6:
1158+
uses: ./.github/workflows/test-target.yml
1159+
with:
1160+
job-name: DuckDB
1161+
target: duckdb
1162+
platform: linux
1163+
runner: '["ubuntu-22.04"]'
1164+
repo: "${{ inputs.repo }}"
1165+
python-version: "${{ inputs.python-version }}"
1166+
standard: ${{ inputs.standard }}
1167+
latest: ${{ inputs.latest }}
1168+
agent-image: "${{ inputs.agent-image }}"
1169+
agent-image-py2: "${{ inputs.agent-image-py2 }}"
1170+
agent-image-windows: "${{ inputs.agent-image-windows }}"
1171+
agent-image-windows-py2: "${{ inputs.agent-image-windows-py2 }}"
1172+
test-py2: ${{ inputs.test-py2 }}
1173+
test-py3: ${{ inputs.test-py3 }}
1174+
minimum-base-package: ${{ inputs.minimum-base-package }}
1175+
pytest-args: ${{ inputs.pytest-args }}
1176+
secrets: inherit
11571177
j562bfe5:
11581178
uses: ./.github/workflows/test-target.yml
11591179
with:

LICENSE-3rdparty.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ cryptography,PyPI,BSD-3-Clause,Copyright (c) Individual contributors.
2222
cryptography,PyPI,PSF,Copyright (c) Individual contributors.
2323
ddtrace,PyPI,BSD-3-Clause,"Copyright 2016 Datadog, Inc."
2424
dnspython,PyPI,ISC,Copyright (C) Dnspython Contributors
25+
duckdb,PyPI,MIT,Copyright (c) Hannes Muehleisen
2526
flup,Vendor,BSD-3-Clause,Copyright (c) 2005 Allan Saddi. All Rights Reserved.
2627
flup-py3,Vendor,BSD-3-Clause,"Copyright (c) 2005, 2006 Allan Saddi <allan@saddi.com> All rights reserved."
2728
foundationdb,PyPI,Apache-2.0,Copyright 2017 FoundationDB

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ For more information on integrations, please reference our [documentation][11] a
5454
[28]: https://img.shields.io/badge/typing-Mypy-blue.svg
5555
[29]: https://github.com/python/mypy
5656
[30]: https://img.shields.io/badge/license-BSD--3--Clause-9400d3.svg
57-
[31]: https://spdx.org/licenses/BSD-3-Clause.html
57+
[31]: https://spdx.org/licenses/BSD-3-Clause.html

agent_requirements.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ confluent-kafka==2.6.1
1313
cryptography==43.0.1
1414
ddtrace==2.10.6
1515
dnspython==2.6.1
16+
duckdb==1.1.1
1617
foundationdb==6.3.24
1718
hazelcast-python-client==5.4.0
1819
importlib-metadata==2.1.3; python_version < '3.8'

duckdb/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# CHANGELOG - DuckDB
2+
3+
<!-- towncrier release notes start -->
4+

duckdb/README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Agent Check: DuckDB
2+
3+
## Overview
4+
5+
This check monitors [DuckDB][1] through the Datadog Agent.
6+
7+
Include a high level overview of what this integration does:
8+
- What does your product do (in 1-2 sentences)?
9+
- What value will customers get from this integration, and why is it valuable to them?
10+
- What specific data will your integration monitor, and what's the value of that data?
11+
12+
## Setup
13+
14+
Follow the instructions below to install and configure this check for an Agent running on a host. For containerized environments, see the [Autodiscovery Integration Templates][3] for guidance on applying these instructions.
15+
16+
### Installation
17+
18+
The DuckDB check is included in the [Datadog Agent][2] package.
19+
No additional installation is needed on your server.
20+
21+
### Configuration
22+
23+
1. Edit the `duckdb.d/conf.yaml` file, in the `conf.d/` folder at the root of your Agent's configuration directory to start collecting your duckdb performance data. See the [sample duckdb.d/conf.yaml][4] for all available configuration options.
24+
25+
2. [Restart the Agent][5].
26+
27+
### Validation
28+
29+
[Run the Agent's status subcommand][6] and look for `duckdb` under the Checks section.
30+
31+
## Data Collected
32+
33+
### Metrics
34+
35+
See [metadata.csv][7] for a list of metrics provided by this integration.
36+
37+
### Events
38+
39+
The DuckDB integration does not include any events.
40+
41+
### Service Checks
42+
43+
The DuckDB integration does not include any service checks.
44+
45+
See [service_checks.json][8] for a list of service checks provided by this integration.
46+
47+
## Troubleshooting
48+
49+
Need help? Contact [Datadog support][9].
50+
51+
52+
[1]: **LINK_TO_INTEGRATION_SITE**
53+
[2]: https://app.datadoghq.com/account/settings/agent/latest
54+
[3]: https://docs.datadoghq.com/agent/kubernetes/integrations/
55+
[4]: https://github.com/DataDog/integrations-core/blob/master/duckdb/datadog_checks/duckdb/data/conf.yaml.example
56+
[5]: https://docs.datadoghq.com/agent/guide/agent-commands/#start-stop-and-restart-the-agent
57+
[6]: https://docs.datadoghq.com/agent/guide/agent-commands/#agent-status-and-information
58+
[7]: https://github.com/DataDog/integrations-core/blob/master/duckdb/metadata.csv
59+
[8]: https://github.com/DataDog/integrations-core/blob/master/duckdb/assets/service_checks.json
60+
[9]: https://docs.datadoghq.com/help/

duckdb/assets/configuration/spec.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: DuckDB
2+
files:
3+
- name: duckdb.yaml
4+
options:
5+
- template: init_config
6+
options:
7+
- template: init_config/default
8+
- template: instances
9+
options:
10+
- name: db_name
11+
required: true
12+
description: |
13+
The database to connect to (file path).
14+
NOTE: DuckDB databases are stored as files.
15+
value:
16+
example: "/path-to-file/my_database.db"
17+
type: string
18+
- name: connection_attempt
19+
description: |
20+
The number of retries to connect to the database in case of failure
21+
value:
22+
type: integer
23+
default: 3
24+
display_default: 3
25+
- template: instances/default
26+
overrides:
27+
min_collection_interval.description: |
28+
This changes the collection interval of this check to avoid
29+
the risk of locking the database file.
30+
If your database file is heavily used in write mode, you changes
31+
further increase this value to minimise the monitoring acccess.
32+
min_collection_interval.value.default: 60
33+
min_collection_interval.value.example: 60
34+
min_collection_interval.enabled: true
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"title": "DuckDB Overview",
3+
"description": "[[suggested_dashboards]]",
4+
"widgets": [
5+
{
6+
"id": 6432334130190000,
7+
"definition": {
8+
"type": "image",
9+
"url": "https://static.datadoghq.com/static/images/logos/duckdb_small.svg",
10+
"sizing": "contain",
11+
"margin": "md",
12+
"has_background": false,
13+
"has_border": false,
14+
"vertical_align": "center",
15+
"horizontal_align": "center"
16+
},
17+
"layout": {
18+
"x": 0,
19+
"y": 0,
20+
"width": 2,
21+
"height": 2
22+
}
23+
}
24+
],
25+
"template_variables": [],
26+
"layout_type": "ordered",
27+
"notify_list": [],
28+
"reflow_type": "fixed"
29+
}

duckdb/assets/service_checks.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
[]

duckdb/changelog.d/1.added

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Initial Release

duckdb/datadog_checks/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# (C) Datadog, Inc. 2024-present
2+
# All rights reserved
3+
# Licensed under a 3-clause BSD style license (see LICENSE)
4+
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# (C) Datadog, Inc. 2024-present
2+
# All rights reserved
3+
# Licensed under a 3-clause BSD style license (see LICENSE)
4+
__version__ = '0.0.1'
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# (C) Datadog, Inc. 2024-present
2+
# All rights reserved
3+
# Licensed under a 3-clause BSD style license (see LICENSE)
4+
from .__about__ import __version__
5+
from .check import DuckdbCheck
6+
7+
__all__ = ['__version__', 'DuckdbCheck']

0 commit comments

Comments
 (0)