Skip to content

Commit efc751d

Browse files
authored
[Chore] Datadog CI integration (#403)
## Problem To continue driving performance improvements in the SDK and avoid major regressions, we need to track performance over time. First step in that is figuring out how to send data over to datadog with ddtrace so we can begin to have a historical overview of how perf is changing over time. Thanks to @ssmith-pc for pointing me in the right direction on how to get started with this stuff. ## Solution - Add ddtrace dev dependency - Adjust CI configurations to set env variables expected by ddtrace Probably later I will need to: - Develop some benchmark tests specifically exercising the areas where performance is most critical. - Setup some dashboards on the datadog side where we can easily find and interpret the data Not sure if this link will be visible to others, but here's where I see data flowing into datadog https://app.datadoghq.com/ci/test-runs?saved-view-id=3068550 ## Type of Change - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update - [x] Infrastructure change (CI configs, etc) - [ ] Non-code change (docs, etc) - [ ] None of the above: (explain here)
1 parent d1fda39 commit efc751d

File tree

8 files changed

+332
-23
lines changed

8 files changed

+332
-23
lines changed

.github/actions/test-data-plane/action.yaml

+10-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ inputs:
2929
description: 'The version of Python to use'
3030
required: false
3131
default: '3.9'
32+
DATADOG_API_KEY:
33+
description: 'The Datadog API key'
34+
required: true
3235

3336
outputs:
3437
index_name:
@@ -52,10 +55,15 @@ runs:
5255
- name: Run data plane tests
5356
id: data-plane-tests
5457
shell: bash
55-
run: poetry run pytest tests/integration/data
58+
run: poetry run pytest tests/integration/data --ddtrace
5659
env:
60+
DD_CIVISIBILITY_AGENTLESS_ENABLED: true
61+
DD_API_KEY: ${{ inputs.DATADOG_API_KEY }}
62+
DD_SITE: datadoghq.com
63+
DD_ENV: ci
64+
DD_SERVICE: pinecone-python-client
5765
PINECONE_API_KEY: ${{ inputs.PINECONE_API_KEY }}
5866
USE_GRPC: ${{ inputs.use_grpc }}
5967
METRIC: ${{ inputs.metric }}
6068
SPEC: ${{ inputs.spec }}
61-
FRESHNESS_TIMEOUT_SECONDS: ${{ inputs.freshness_timeout_seconds }}
69+
FRESHNESS_TIMEOUT_SECONDS: ${{ inputs.freshness_timeout_seconds }}

.github/actions/test-dependency-grpc/action.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,25 @@ runs:
4242
- name: Install grpcio ${{ inputs.grpcio_version }}
4343
run: poetry add grpcio==${{ inputs.grpcio_version }}
4444
shell: bash
45-
45+
4646
- name: Install lz4 ${{ inputs.lz4_version }}
4747
run: poetry add lz4==${{ inputs.lz4_version }}
4848
shell: bash
49-
49+
5050
- name: Install protobuf ${{ inputs.protobuf_version }}
5151
run: poetry add protobuf==${{ inputs.protobuf_version }}
5252
shell: bash
53-
53+
5454
- name: Install googleapis-common-protos ${{ inputs.googleapis_common_protos_version }}
5555
run: poetry add googleapis-common-protos==${{ inputs.googleapis_common_protos_version }}
5656
shell: bash
57-
57+
5858
- uses: nick-fields/retry@v3
5959
with:
6060
timeout_minutes: 5
6161
max_attempts: 3
6262
retry_on: error
63-
command: poetry run pytest tests/dependency/grpc -s -v
63+
command: poetry run pytest tests/dependency/grpc -s -v --ddtrace
6464
env:
6565
PINECONE_API_KEY: ${{ inputs.PINECONE_API_KEY }}
66-
INDEX_NAME: ${{ inputs.index_name }}
66+
INDEX_NAME: ${{ inputs.index_name }}

.github/actions/test-dependency-rest/action.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ runs:
3939
timeout_minutes: 5
4040
max_attempts: 3
4141
retry_on: error
42-
command: poetry run pytest tests/dependency/rest -s -v
42+
command: poetry run pytest tests/dependency/rest -s -v --ddtrace
4343
env:
4444
PINECONE_API_KEY: '${{ inputs.PINECONE_API_KEY }}'
45-
INDEX_NAME: '${{ inputs.index_name }}'
45+
INDEX_NAME: '${{ inputs.index_name }}'

.github/workflows/testing-dependency.yaml

+13-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ name: Dependency Testing
33
on:
44
workflow_call: {}
55

6+
env:
7+
DD_CIVISIBILITY_AGENTLESS_ENABLED: true
8+
DD_API_KEY: ${{ secrets.DATADOG_API_KEY }}
9+
DD_SITE: datadoghq.com
10+
DD_ENV: ci
11+
DD_SERVICE: pinecone-python-client
12+
613
jobs:
714
dependency-matrix-setup:
815
name: Deps setup
@@ -72,6 +79,7 @@ jobs:
7279
lz4_version: '${{ matrix.lz4_version }}'
7380
protobuf_version: '${{ matrix.protobuf_version }}'
7481
googleapis_common_protos_version: '${{ matrix.googleapis_common_protos_version }}'
82+
DD_TAGS: 'test.configuration.python:${{ matrix.python_version}},test.configuration.grpcio:${{ matrix.grpcio_version }},test.configuration.lz4:${{ matrix.lz4_version }},test.configuration.protobuf:${{ matrix.protobuf_version }},test.configuration.googleapis_common_protos:${{ matrix.googleapis_common_protos_version }}'
7583

7684
dependency-matrix-grpc-312:
7785
name: Deps (GRPC)
@@ -107,6 +115,7 @@ jobs:
107115
lz4_version: '${{ matrix.lz4_version }}'
108116
protobuf_version: '${{ matrix.protobuf_version }}'
109117
googleapis_common_protos_version: '${{ matrix.googleapis_common_protos_version }}'
118+
DD_TAGS: 'test.configuration.python:${{ matrix.python_version}},test.configuration.grpcio:${{ matrix.grpcio_version }},test.configuration.lz4:${{ matrix.lz4_version }},test.configuration.protobuf:${{ matrix.protobuf_version }},test.configuration.googleapis_common_protos:${{ matrix.googleapis_common_protos_version }}'
110119

111120
dependency-matrix-rest:
112121
name: Deps (REST)
@@ -132,7 +141,8 @@ jobs:
132141
index_name: '${{ needs.dependency-matrix-setup.outputs.index_name }}'
133142
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
134143
urllib3_version: '${{ matrix.urllib3_version }}'
135-
144+
DD_TAGS: 'test.configuration.python:${{ matrix.python_version}},test.configuration.urllib3:${{ matrix.urllib3_version }}'
145+
136146
dependency-matrix-rest-312:
137147
name: Deps (REST)
138148
runs-on: ubuntu-latest
@@ -156,6 +166,7 @@ jobs:
156166
index_name: '${{ needs.dependency-matrix-setup.outputs.index_name }}'
157167
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
158168
urllib3_version: '${{ matrix.urllib3_version }}'
169+
DD_TAGS: 'test.configuration.python:${{ matrix.python_version}},test.configuration.urllib3:${{ matrix.urllib3_version }}'
159170

160171
deps-cleanup:
161172
name: Deps cleanup
@@ -171,4 +182,4 @@ jobs:
171182
- uses: ./.github/actions/delete-index
172183
with:
173184
index_name: '${{ needs.dependency-matrix-setup.outputs.index_name }}'
174-
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
185+
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'

.github/workflows/testing-integration.yaml

+14-6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ name: "Integration Tests"
22
'on':
33
workflow_call: {}
44

5+
env:
6+
DD_CIVISIBILITY_AGENTLESS_ENABLED: true
7+
DD_API_KEY: ${{ secrets.DATADOG_API_KEY }}
8+
DD_SITE: datadoghq.com
9+
DD_ENV: ci
10+
DD_SERVICE: pinecone-python-client
11+
512
jobs:
613
plugin-inference:
714
name: Test inference plugin
@@ -20,7 +27,7 @@ jobs:
2027
with:
2128
include_grpc: 'true'
2229
- name: 'Run integration tests'
23-
run: poetry run pytest tests/integration/inference -s -vv
30+
run: poetry run pytest tests/integration/inference -s -vv --ddtrace
2431
env:
2532
PINECONE_DEBUG_CURL: 'true'
2633
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
@@ -33,7 +40,7 @@ jobs:
3340
matrix:
3441
python_version: [3.8, 3.12]
3542
use_grpc: [true, false]
36-
metric:
43+
metric:
3744
- cosine
3845
# - euclidean
3946
# - dotproduct
@@ -43,6 +50,7 @@ jobs:
4350
- uses: actions/checkout@v4
4451
- uses: ./.github/actions/test-data-plane
4552
with:
53+
DATADOG_API_KEY: '${{ secrets.DATADOG_API_KEY }}'
4654
python_version: '${{ matrix.python_version }}'
4755
use_grpc: '${{ matrix.use_grpc }}'
4856
metric: '${{ matrix.metric }}'
@@ -91,7 +99,7 @@ jobs:
9199
uses: ./.github/actions/setup-poetry
92100
- name: 'Run integration tests (REST, prod)'
93101
if: matrix.pineconeEnv == 'prod'
94-
run: poetry run pytest tests/integration/control/pod -s -v
102+
run: poetry run pytest tests/integration/control/pod -s -v --ddtrace
95103
env:
96104
PINECONE_DEBUG_CURL: 'true'
97105
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
@@ -101,7 +109,7 @@ jobs:
101109
METRIC: 'cosine'
102110
- name: 'Run integration tests (REST, staging)'
103111
if: matrix.pineconeEnv == 'staging'
104-
run: poetry run pytest tests/integration/control/pod -s -v
112+
run: poetry run pytest tests/integration/control/pod -s -v --ddtrace
105113
env:
106114
PINECONE_DEBUG_CURL: 'true'
107115
PINECONE_CONTROLLER_HOST: 'https://api-staging.pinecone.io'
@@ -136,7 +144,7 @@ jobs:
136144
uses: ./.github/actions/setup-poetry
137145
- name: 'Run integration tests (REST, prod)'
138146
if: matrix.pineconeEnv == 'prod'
139-
run: poetry run pytest tests/integration/control/serverless -s -vv
147+
run: poetry run pytest tests/integration/control/serverless -s -vv --ddtrace
140148
env:
141149
PINECONE_DEBUG_CURL: 'true'
142150
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
@@ -145,7 +153,7 @@ jobs:
145153
SERVERLESS_REGION: '${{ matrix.testConfig.serverless.region }}'
146154
- name: 'Run integration tests (REST, staging)'
147155
if: matrix.pineconeEnv == 'staging'
148-
run: poetry run pytest tests/integration/control/serverless -s -vv
156+
run: poetry run pytest tests/integration/control/serverless -s -vv --ddtrace
149157
env:
150158
PINECONE_DEBUG_CURL: 'true'
151159
PINECONE_CONTROLLER_HOST: 'https://api-staging.pinecone.io'

.github/workflows/testing-unit.yaml

+9-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ name: "Unit Tests"
22
'on':
33
workflow_call: {}
44

5+
env:
6+
DD_CIVISIBILITY_AGENTLESS_ENABLED: true
7+
DD_API_KEY: ${{ secrets.DATADOG_API_KEY }}
8+
DD_SITE: datadoghq.com
9+
DD_ENV: ci
10+
DD_SERVICE: pinecone-python-client
11+
512
jobs:
613
unit-tests:
714
name: Unit tests
@@ -30,10 +37,10 @@ jobs:
3037
include_grpc: '${{ matrix.use_grpc }}'
3138
include_types: true
3239
- name: Run unit tests (REST)
33-
run: poetry run pytest --cov=pinecone --timeout=120 tests/unit
40+
run: poetry run pytest --cov=pinecone --timeout=120 tests/unit --ddtrace
3441
- name: Run unit tests (GRPC)
3542
if: ${{ matrix.use_grpc == true }}
36-
run: poetry run pytest --cov=pinecone/grpc --timeout=120 tests/unit_grpc
43+
run: poetry run pytest --cov=pinecone/grpc --timeout=120 tests/unit_grpc --ddtrace
3744
- name: mypy check
3845
env:
3946
INCLUDE_GRPC: '${{ matrix.use_grpc }}'

0 commit comments

Comments
 (0)