Skip to content

Commit 3b8224f

Browse files
Anush008nirga
andauthored
feat: Qdrant instrumentation (#278)
Co-authored-by: Nir Gazit <nirga@users.noreply.github.com>
1 parent 1b1aa3d commit 3b8224f

File tree

20 files changed

+840
-18
lines changed

20 files changed

+840
-18
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ updates:
4646
interval: "weekly"
4747
labels:
4848
- "instrumentation-pinecone"
49+
- package-ecosystem: "npm"
50+
directory: "/packages/instrumentation-qdrant"
51+
schedule:
52+
interval: "weekly"
53+
labels:
54+
- "instrumentation-qdrant"
4955
- package-ecosystem: "npm"
5056
directory: "/packages/instrumentation-vertexai"
5157
schedule:

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ jobs:
2828
build-and-test:
2929
name: Build and test
3030
runs-on: ubuntu-latest
31+
services:
32+
qdrant:
33+
image: qdrant/qdrant
34+
ports:
35+
- 6333:6333
3136
permissions:
3237
contents: "read"
3338
id-token: "write"

.python-version

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

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ OpenLLMetry-JS can instrument everything that [OpenTelemetry already instruments
119119

120120
- ✅ Pinecone
121121
- ✅ Chroma
122+
- ✅ Qdrant
122123
- ⏳ Weaviate
123124
- ⏳ Milvus
124125

package-lock.json

Lines changed: 57 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ai-semantic-conventions/src/SemanticAttributes.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ export const SpanAttributes = {
3838
// Vector DB
3939
VECTOR_DB_VENDOR: "db.system",
4040
VECTOR_DB_QUERY_TOP_K: "db.vector.query.top_k",
41+
VECTOR_DB_TABLE_NAME: "db.vector.table_name",
42+
VECTOR_DB_ADD_COUNT: "db.vector.add.count",
43+
VECTOR_DB_DELETE_SELECTOR: "db.vector.delete.selector",
44+
VECTOR_DB_DELETE_COUNT: "db.vector.delete.count",
45+
VECTOR_DB_GET_SELECTOR: "db.vector.get.selector",
46+
VECTOR_DB_GET_COUNT: "db.vector.get.count",
47+
VECTOR_DB_GET_INCLUDE_METADATA: "db.vector.get.include_metadata",
48+
VECTOR_DB_GET_INCLUDE_VALUES: "db.vector.get.include_values",
4149

4250
// LLM Workflows
4351
TRACELOOP_SPAN_KIND: "traceloop.span.kind",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"extends": ["../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {}
8+
},
9+
{
10+
"files": ["*.ts", "*.tsx"],
11+
"rules": {}
12+
},
13+
{
14+
"files": ["*.js", "*.jsx"],
15+
"rules": {}
16+
}
17+
]
18+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/dist
2+
/coverage
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# OpenTelemetry Qdrant instrumentation for Node.js
2+
3+
[![NPM Published Version][npm-img]][npm-url]
4+
[![Apache License][license-image]][license-image]
5+
6+
This module provides automatic instrumentation for [`@qdrant/js-client-rest`](https://www.npmjs.com/package/@qdrant/js-client-rest) module, which may be loaded using the [`@opentelemetry/sdk-trace-node`](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-node) package and is included in the [`@traceloop/node-server-sdk`](https://www.npmjs.com/package/@traceloop/node-server-sdk) bundle.
7+
8+
If total installation size is not constrained, it is recommended to use the [`@traceloop/node-server-sdk`](https://www.npmjs.com/package/@traceloop/node-server-sdk) bundle for the most seamless instrumentation experience.
9+
10+
Compatible with OpenTelemetry JS API and SDK `1.0+`.
11+
12+
## Installation
13+
14+
```bash
15+
npm install --save @traceloop/instrumentation-qdrant
16+
```
17+
18+
## Supported Versions
19+
20+
- `>=1.9.0`
21+
22+
## Usage
23+
24+
To load a specific plugin, specify it in the registerInstrumentations's configuration:
25+
26+
```js
27+
const { NodeTracerProvider } = require("@opentelemetry/sdk-trace-node");
28+
const { QdrantInstrumentation } = require("@traceloop/instrumentation-qdrant");
29+
const { registerInstrumentations } = require("@opentelemetry/instrumentation");
30+
31+
const provider = new NodeTracerProvider();
32+
provider.register();
33+
34+
registerInstrumentations({
35+
instrumentations: [new QdrantInstrumentation()],
36+
});
37+
```
38+
39+
## Useful links
40+
41+
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
42+
- For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-js>
43+
- For help or feedback on this project, join us on [Slack][slack-url]
44+
45+
## License
46+
47+
Apache 2.0 - See [LICENSE][license-url] for more information.
48+
49+
[slack-url]: https://traceloop.com/slack
50+
[license-url]: https://github.com/traceloop/openllmetry-js/blob/main/LICENSE
51+
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
52+
[npm-url]: https://www.npmjs.com/package/@traceloop/instrumentation-qdrant
53+
[npm-img]: https://badge.fury.io/js/%40traceloop%2Finstrumentation-qdrant.svg

0 commit comments

Comments
 (0)