Skip to content

Same agent Smaller bill. The tools and infrastructure to get more work from your AI. Fewer tokens. Less compute. Lower cost.

[Feat]: Add OpenTelemetry instrumentation for monitoring AstraDB (#526)

Patcherdfec3d8557d3
diff --git a/docs/images/docs-astradb-banner.gif b/docs/images/docs-astradb-banner.gif
new file mode 100644
index 00000000..0b912ea6
Binary files /dev/null and b/docs/images/docs-astradb-banner.gif differ
diff --git a/docs/latest/integrations/astradb.mdx b/docs/latest/integrations/astradb.mdx
new file mode 100644
index 00000000..e273467a
--- /dev/null
+++ b/docs/latest/integrations/astradb.mdx
@@ -0,0 +1,78 @@
+---
+title: 'Monitor AstraDB using OpenTelemetry'
+sidebarTitle: 'AstraDB'
+---
+
+<Frame>
+ <img src="/images/docs-astradb-banner.gif" />
+</Frame>
+
+OpenLIT uses OpenTelemetry Auto-Instrumentation to help you monitor LLM applications using AstraDB as the vector store. This includes tracking performance, operation stats and more.
+
+Auto-instrumentation means you don't have to set up monitoring manually for different LLMs, frameworks, or databases. By simply adding OpenLIT in your application, all the necessary monitoring configurations are automatically set up.
+
+The integration is compatible with
+- AstraDB Python SDK client `>= 1.5.2`
+
+## Get Started
+
+<Steps>
+ <Step title="Install OpenLIT">
+ Open your command line or terminal and run:
+ ```shell
+ pip install openlit
+ ```
+ </Step>
+ <Step title="Initialize OpenLIT in your Application">
+ You can set up OpenLIT in your application using either function arguments directly in your code or by using environment variables.
+ <Tabs>
+ <Tab title="Setup using function arguments">
+
+ Add the following two lines to your application code:
+
+ ```python
+ import openlit
+
+ openlit.init(
+ otlp_endpoint="YOUR_OTEL_ENDPOINT",
+ )
+ ```
+
+ Replace:
+ 1. `YOUR_OTEL_ENDPOINT` with the URL of your OpenTelemetry backend, such as `http://127.0.0.1:4318` if you are using OpenLIT and a local OTel Collector.
+ </Tab>
+ <Tab title="Setup using Environment Variables">
+
+ Add the following two lines to your application code:
+
+ ```python
+ import openlit
+
+ openlit.init()
+ ```
+
+ Then, configure the your OTLP endpoint using environment variable:
+ ```shell
+ export OTEL_EXPORTER_OTLP_ENDPOINT = "YOUR_OTEL_ENDPOINT"
+ ```
+
+ Replace:
+ 1. `YOUR_OTEL_ENDPOINT` with the URL of your OpenTelemetry backend, such as `http://127.0.0.1:4318` if you are using OpenLIT and a local OTel Collector.
+ </Tab>
+ </Tabs>
+ To send metrics and traces to other Observability tools, refer to the [Connections Guide](/latest/connections/intro).
+
+ For more advanced configurations and application use cases, visit the [OpenLIT Python repository](https://github.com/openlit/openlit/tree/main/sdk/python).
+ </Step>
+</Steps>
+
+---
+
+<CardGroup cols={2}>
+<Card title="Connections" href="/latest/connections/intro" icon='link'>
+Connect to your existing Observablity Stack
+</Card>
+<Card title="SDK configuration" href="/latest/sdk-configuration" icon='file-code'>
+Documentation of the configuration options for the OpenLIT SDK.
+</Card>
+</CardGroup>
\ No newline at end of file
diff --git a/docs/latest/integrations/introduction.mdx b/docs/latest/integrations/introduction.mdx
index 696afda2..ecc03f0e 100644
--- a/docs/latest/integrations/introduction.mdx
+++ b/docs/latest/integrations/introduction.mdx
@@ -1648,6 +1648,18 @@ Start integrating and monitoring your applications with OpenLIT in just one line
iconType="duotone"
>
</Card>
+ <Card
+ title="AstraDB"
+ href="/latest/integrations/astradb"
+ icon={
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 220 220">
+ <path d="M0 0 C10.05926959 6.17309708 14.44357043 14.24085077 18.65625 24.921875 C19.00466446 25.79976181 19.35307892 26.67764862 19.71205139 27.58213806 C23.36353273 36.8346174 26.8427085 46.15012123 30.29571533 55.4781189 C31.48052322 58.67872156 32.6683552 61.87818832 33.85693359 65.07739258 C35.15608845 68.57423277 36.45508466 72.07113082 37.75323486 75.56834412 C42.98035175 89.6487195 48.23224847 103.71984375 53.48416138 117.79098511 C54.82500069 121.38347881 56.16541498 124.97613088 57.5056181 128.56886196 C58.27621593 130.63451258 59.04699438 132.70009574 59.8177948 134.76567078 C60.80794206 137.41914167 61.79729445 140.07290696 62.78608704 142.72688293 C65.08582901 148.89620792 67.39853434 155.06018085 69.74121094 161.21337891 C70.1648996 162.32997391 70.58858826 163.44656891 71.02511597 164.59700012 C71.81415026 166.67402938 72.60714228 168.74956117 73.40481567 170.82328796 C73.74930756 171.73149796 74.09379944 172.63970795 74.44873047 173.57543945 C74.9009346 174.75635918 74.9009346 174.75635918 75.36227417 175.96113586 C76 178 76 178 76 181 C59.5 181 43 181 26 181 C23.65961157 175.14902892 21.42459002 169.52017767 19.47314453 163.57055664 C19.25096001 162.89611952 19.02877548 162.2216824 18.79985809 161.52680779 C18.07444877 159.32224934 17.35359535 157.11623119 16.6328125 154.91015625 C16.1158622 153.33597538 15.5986337 151.76188584 15.08114624 150.18788147 C13.70777049 146.0077275 12.33842154 141.82626568 10.97012329 137.64444733 C9.55809998 133.33055627 8.14307214 129.01765075 6.72851562 124.70458984 C4.49943545 117.90647823 2.27286286 111.1075498 0.04785156 104.30810547 C-2.18199467 97.49419076 -4.41801332 90.68234866 -6.65945435 83.87223816 C-7.98274408 79.85027675 -9.3025794 75.82718958 -10.62115479 71.80368042 C-11.20226014 70.0324976 -11.78471651 68.2617574 -12.36859131 66.4914856 C-13.15608268 64.10241601 -13.93818297 61.71165171 -14.71875 59.3203125 C-14.94043854 58.6520192 -15.16212708 57.98372589 -15.39053345 57.29518127 C-16.60458916 53.55253909 -17.4523015 49.8959919 -18 46 C-18.66 46 -19.32 46 -20 46 C-20.1143146 46.55467422 -20.22862921 47.10934843 -20.34640789 47.68083096 C-21.47335698 52.96959566 -22.87532332 58.06449609 -24.59106445 63.18969727 C-24.96982979 64.33887131 -24.96982979 64.33887131 -25.35624695 65.51126099 C-26.1878456 68.03101215 -27.02557238 70.54868058 -27.86328125 73.06640625 C-28.45745752 74.86330307 -29.05121378 76.66033882 -29.64457703 78.45750427 C-31.21236422 83.20266752 -32.78519944 87.94614151 -34.35931396 92.68920898 C-36.83074859 100.13911974 -39.29412458 107.59170175 -41.75857162 115.04392624 C-42.67428357 117.81187917 -43.59102507 120.57948966 -44.50784302 123.34707642 C-47.62913613 132.77641729 -50.72618611 142.21302525 -53.78271484 151.66357422 C-54.08605208 152.60083186 -54.38938932 153.5380895 -54.7019186 154.50374889 C-56.15140253 158.9844361 -57.59705533 163.46630791 -59.03694153 167.9500885 C-59.54952771 169.53828589 -60.06219294 171.12645776 -60.57495117 172.71459961 C-60.8074803 173.44319372 -61.04000942 174.17178783 -61.27958488 174.92246056 C-62.88669194 179.88669194 -62.88669194 179.88669194 -64 181 C-65.56547048 181.09326716 -67.13512772 181.11745582 -68.70336914 181.11352539 C-69.70433121 181.11344986 -70.70529327 181.11337433 -71.73658752 181.11329651 C-72.8251152 181.10813522 -73.91364288 181.10297394 -75.03515625 181.09765625 C-76.14354355 181.0962413 -77.25193085 181.09482635 -78.39390564 181.09336853 C-81.95013069 181.08775033 -85.50629383 181.07519475 -89.0625 181.0625 C-91.46679597 181.05748734 -93.87109292 181.05292403 -96.27539062 181.04882812 C-102.18361504 181.03777499 -108.0918031 181.02101917 -114 181 C-113.34650007 175.45342636 -111.50916728 170.60346328 -109.52734375 165.42578125 C-109.17324936 164.48715744 -108.81915497 163.54853363 -108.45433044 162.58146667 C-107.28695952 159.48993128 -106.11211724 156.4012886 -104.9375 153.3125 C-104.11149259 151.12784957 -103.28614391 148.94294997 -102.46142578 146.7578125 C-101.19676438 143.40710501 -99.93176199 140.056532 -98.66479492 136.70669556 C-95.17746881 127.48499834 -91.73245724 118.24810825 -88.30441284 109.00424194 C-86.36468072 103.77776095 -84.41661013 98.55437913 -82.4705658 93.33024597 C-80.32921519 87.57890048 -78.19364924 81.82544357 -76.0625 76.0703125 C-73.65030084 69.55641294 -71.23148203 63.04500467 -68.8067112 56.53577423 C-67.46478115 52.9326071 -66.12580962 49.32840442 -64.79412842 45.72143555 C-63.53368658 42.30764636 -62.26517115 38.89696025 -60.99093628 35.48829651 C-60.29846094 33.62966395 -59.61428233 31.76794674 -58.93041992 29.90612793 C-53.72741096 16.03974263 -48.30191836 4.76861202 -34.5 -2 C-23.54383957 -6.12779991 -10.32168827 -5.61792373 0 0 Z " fill="#EB6C34" transform="translate(147,40)"/>
+ </svg>
+
+ }
+ iconType="duotone"
+ >
+ </Card>
</CardGroup>
### Frameworks
diff --git a/docs/mint.json b/docs/mint.json
index 0c0e8953..bd3375ad 100644
--- a/docs/mint.json
+++ b/docs/mint.json
@@ -115,7 +115,8 @@
"latest/integrations/chromadb",
"latest/integrations/pinecone",
"latest/integrations/qdrant",
- "latest/integrations/milvus"
+ "latest/integrations/milvus",
+ "latest/integrations/astradb"
]
},
{
diff --git a/sdk/python/README.md b/sdk/python/README.md
index c6810f40..ca020ec1 100644
--- a/sdk/python/README.md
+++ b/sdk/python/README.md
@@ -38,7 +38,7 @@ This project proudly follows and maintains the [Semantic Conventions](https://gi
| [✅ Ollama](https://docs.openlit.io/latest/integrations/ollama) | [✅ Pinecone](https://docs.openlit.io/latest/integrations/pinecone) | [✅ LiteLLM](https://docs.openlit.io/latest/integrations/litellm) | [✅ AMD](https://docs.openlit.io/latest/integrations/amd-gpu) |
| [✅ Anthropic](https://docs.openlit.io/latest/integrations/anthropic) | [✅ Qdrant](https://docs.openlit.io/latest/integrations/qdrant) | [✅ LlamaIndex](https://docs.openlit.io/latest/integrations/llama-index) | |
| [✅ GPT4All](https://docs.openlit.io/latest/integrations/gpt4all) | [✅ Milvus](https://docs.openlit.io/latest/integrations/milvus) | [✅ Haystack](https://docs.openlit.io/latest/integrations/haystack) | |
-| [✅ Cohere](https://docs.openlit.io/latest/integrations/cohere) | | [✅ EmbedChain](https://docs.openlit.io/latest/integrations/embedchain) | |
+| [✅ Cohere](https://docs.openlit.io/latest/integrations/cohere) | [✅ AstraDB](https://docs.openlit.io/latest/integrations/astradb) | [✅ EmbedChain](https://docs.openlit.io/latest/integrations/embedchain) | |
| [✅ Mistral](https://docs.openlit.io/latest/integrations/mistral) | | [✅ Guardrails](https://docs.openlit.io/latest/integrations/guardrails) | |
| [✅ Azure OpenAI](https://docs.openlit.io/latest/integrations/azure-openai) | | [✅ CrewAI](https://docs.openlit.io/latest/integrations/crewai) | |
| [✅ Azure AI Inference](https://docs.openlit.io/latest/integrations/azure-ai-inference) | | [✅ DSPy](https://docs.openlit.io/latest/integrations/dspy) | |
diff --git a/sdk/python/pyproject.toml b/sdk/python/pyproject.toml
index 3185414e..fa78a031 100644
--- a/sdk/python/pyproject.toml
+++ b/sdk/python/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "openlit"
-version = "1.32.2"
+version = "1.32.3"
description = "OpenTelemetry-native Auto instrumentation library for monitoring LLM Applications and GPUs, facilitating the integration of observability into your GenAI-driven projects"
authors = ["OpenLIT"]
repository = "https://github.com/openlit/openlit/tree/main/openlit/python"
diff --git a/sdk/python/src/openlit/__init__.py b/sdk/python/src/openlit/__init__.py
index e7852a8a..cd29518d 100644
--- a/sdk/python/src/openlit/__init__.py
+++ b/sdk/python/src/openlit/__init__.py
@@ -48,6 +48,7 @@ from openlit.instrumentation.chroma import ChromaInstrumentor
from openlit.instrumentation.pinecone import PineconeInstrumentor
from openlit.instrumentation.qdrant import QdrantInstrumentor
from openlit.instrumentation.milvus import MilvusInstrumentor
+from openlit.instrumentation.astra import AstraInstrumentor
from openlit.instrumentation.transformers import TransformersInstrumentor
from openlit.instrumentation.litellm import LiteLLMInstrumentor
from openlit.instrumentation.crewai import CrewAIInstrumentor
@@ -250,6 +251,7 @@ def init(environment="default", application_name="default", tracer=None, otlp_en
"reka-api": "reka",
"premai": "premai",
"julep": "julep",
+ "astra": "astrapy",
}
invalid_instrumentors = [
@@ -339,6 +341,7 @@ def init(environment="default", application_name="default", tracer=None, otlp_en
"reka-api": RekaInstrumentor(),
"premai": PremAIInstrumentor(),
"julep": JulepInstrumentor(),
+ "astra": AstraInstrumentor(),
}
# Initialize and instrument only the enabled instrumentors
diff --git a/sdk/python/src/openlit/instrumentation/astra/__init__.py b/sdk/python/src/openlit/instrumentation/astra/__init__.py
new file mode 100644
index 00000000..098eccd8
--- /dev/null
+++ b/sdk/python/src/openlit/instrumentation/astra/__init__.py
@@ -0,0 +1,179 @@
+# pylint: disable=useless-return, bad-staticmethod-argument, disable=duplicate-code
+"""Initializer of Auto Instrumentation of AstraDB Functions"""
+from typing import Collection
+import importlib.metadata
+from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
+from wrapt import wrap_function_wrapper
+
+from openlit.instrumentation.astra.astra import general_wrap
+# from openlit.instrumentation.astra.async_astra import asyc_general_wrap
+
+_instruments = ("astrapy >= 1.5.2",)
+
+class AstraInstrumentor(BaseInstrumentor):
+ """An instrumentor for AstraDB's client library."""
+
+ def instrumentation_dependencies(self) -> Collection[str]:
+ return _instruments
+
+ def _instrument(self, **kwargs):
+ application_name = kwargs.get("application_name")
+ environment = kwargs.get("environment")
+ tracer = kwargs.get("tracer")
+ metrics = kwargs.get("metrics_dict")
+ pricing_info = kwargs.get("pricing_info")
+ trace_content = kwargs.get("trace_content")
+ disable_metrics = kwargs.get("disable_metrics")
+ version = importlib.metadata.version("astrapy")
+
+ # Sync
+ wrap_function_wrapper(
+ "astrapy.database",
+ "Database.create_collection",
+ general_wrap("astra.create_collection", version, environment, application_name,
+ tracer, pricing_info, trace_content, metrics, disable_metrics),
+ )
+ wrap_function_wrapper(
+ "astrapy.database",
+ "Database.drop_collection",
+ general_wrap("astra.drop_collection", version, environment, application_name,
+ tracer, pricing_info, trace_content, metrics, disable_metrics),
+ )
+ wrap_function_wrapper(
+ "astrapy.collection",
+ "Collection.insert_one",
+ general_wrap("astra.insert_one", version, environment, application_name,
+ tracer, pricing_info, trace_content, metrics, disable_metrics),
+ )
+ wrap_function_wrapper(
+ "astrapy.collection",
+ "Collection.insert_many",
+ general_wrap("astra.insert_many", version, environment, application_name,
+ tracer, pricing_info, trace_content, metrics, disable_metrics),
+ )
+ wrap_function_wrapper(
+ "astrapy.collection",
+ "Collection.update_one",
+ general_wrap("astra.update_one", version, environment, application_name,
+ tracer, pricing_info, trace_content, metrics, disable_metrics),
+ )
+ wrap_function_wrapper(
+ "astrapy.collection",
+ "Collection.update_many",
+ general_wrap("astra.update_many", version, environment, application_name,
+ tracer, pricing_info, trace_content, metrics, disable_metrics),
+ )
+ wrap_function_wrapper(
+ "astrapy.collection",
+ "Collection.find_one_and_update",
+ general_wrap("astra.find_one_and_update", version, environment, application_name,
+ tracer, pricing_info, trace_content, metrics, disable_metrics),
+ )
+ wrap_function_wrapper(
+ "astrapy.collection",
+ "Collection.find",
+ general_wrap("astra.find", version, environment, application_name,
+ tracer, pricing_info, trace_content, metrics, disable_metrics),
+ )
+ wrap_function_wrapper(
+ "astrapy.collection",
+ "Collection.replace_one",
+ general_wrap("astra.replace_one", version, environment, application_name,
+ tracer, pricing_info, trace_content, metrics, disable_metrics),
+ )
+ wrap_function_wrapper(
+ "astrapy.collection",
+ "Collection.find_one_and_delete",
+ general_wrap("astra.find_one_and_delete", version, environment, application_name,
+ tracer, pricing_info, trace_content, metrics, disable_metrics),
+ )
+ wrap_function_wrapper(
+ "astrapy.collection",
+ "Collection.delete_one",
+ general_wrap("astra.delete_one", version, environment, application_name,
+ tracer, pricing_info, trace_content, metrics, disable_metrics),
+ )
+ wrap_function_wrapper(
+ "astrapy.collection",
+ "Collection.delete_many",
+ general_wrap("astra.delete_many", version, environment, application_name,
+ tracer, pricing_info, trace_content, metrics, disable_metrics),
+ )
+
+ # ASync
+ wrap_function_wrapper(
+ "astrapy.database",
+ "AsyncDatabase.create_collection",
+ general_wrap("astra.create_collection", version, environment, application_name,
+ tracer, pricing_info, trace_content, metrics, disable_metrics),
+ )
+ wrap_function_wrapper(
+ "astrapy.database",
+ "AsyncDatabase.drop_collection",
+ general_wrap("astra.drop_collection", version, environment, application_name,
+ tracer, pricing_info, trace_content, metrics, disable_metrics),
+ )
+ wrap_function_wrapper(
+ "astrapy.collection",
+ "AsyncCollection.insert_one",
+ general_wrap("astra.insert_one", version, environment, application_name,
+ tracer, pricing_info, trace_content, metrics, disable_metrics),
+ )
+ wrap_function_wrapper(
+ "astrapy.collection",
+ "AsyncCollection.insert_many",
+ general_wrap("astra.insert_many", version, environment, application_name,
+ tracer, pricing_info, trace_content, metrics, disable_metrics),
+ )
+ wrap_function_wrapper(
+ "astrapy.collection",
+ "AsyncCollection.update_one",
+ general_wrap("astra.update_one", version, environment, application_name,
+ tracer, pricing_info, trace_content, metrics, disable_metrics),
+ )
+ wrap_function_wrapper(
+ "astrapy.collection",
+ "AsyncCollection.update_many",
+ general_wrap("astra.update_many", version, environment, application_name,
+ tracer, pricing_info, trace_content, metrics, disable_metrics),
+ )
+ wrap_function_wrapper(
+ "astrapy.collection",
+ "AsyncCollection.find_one_and_update",
+ general_wrap("astra.find_one_and_update", version, environment, application_name,
+ tracer, pricing_info, trace_content, metrics, disable_metrics),
+ )
+ wrap_function_wrapper(
+ "astrapy.collection",
+ "AsyncCollection.find",
+ general_wrap("astra.find", version, environment, application_name,
+ tracer, pricing_info, trace_content, metrics, disable_metrics),
+ )
+ wrap_function_wrapper(
+ "astrapy.collection",
+ "AsyncCollection.replace_one",
+ general_wrap("astra.replace_one", version, environment, application_name,
+ tracer, pricing_info, trace_content, metrics, disable_metrics),
+ )
+ wrap_function_wrapper(
+ "astrapy.collection",
+ "AsyncCollection.find_one_and_delete",
+ general_wrap("astra.find_one_and_delete", version, environment, application_name,
+ tracer, pricing_info, trace_content, metrics, disable_metrics),
+ )
+ wrap_function_wrapper(
+ "astrapy.collection",
+ "AsyncCollection.delete_one",
+ general_wrap("astra.delete_one", version, environment, application_name,
+ tracer, pricing_info, trace_content, metrics, disable_metrics),
+ )
+ wrap_function_wrapper(
+ "astrapy.collection",
+ "AsyncCollection.delete_many",
+ general_wrap("astra.delete_many", version, environment, application_name,
+ tracer, pricing_info, trace_content, metrics, disable_metrics),
+ )
+
+ @staticmethod
+ def _uninstrument(self, **kwargs):
+ pass
diff --git a/sdk/python/src/openlit/instrumentation/astra/astra.py b/sdk/python/src/openlit/instrumentation/astra/astra.py
new file mode 100644
index 00000000..206097fd
--- /dev/null
+++ b/sdk/python/src/openlit/instrumentation/astra/astra.py
@@ -0,0 +1,226 @@
+# pylint: disable=duplicate-code, broad-exception-caught, too-many-statements, unused-argument, possibly-used-before-assignment, too-many-branches
+"""
+Module for monitoring AstraDB.
+"""
+
+import logging
+from opentelemetry.trace import SpanKind, Status, StatusCode
+from opentelemetry.sdk.resources import TELEMETRY_SDK_NAME
+from openlit.__helpers import handle_exception
+from openlit.semcov import SemanticConvetion
+
+# Initialize logger for logging potential issues and operations
+logger = logging.getLogger(__name__)
+
+def object_count(obj):
+ """
+ Counts Length of object if it exists, Else returns None
+ """
+
+ return len(obj) if obj else None
+
+def general_wrap(gen_ai_endpoint, version, environment, application_name,
+ tracer, pricing_info, trace_content, metrics, disable_metrics):
+ """
+ Wraps a AstraDB operation to trace and log its execution metrics.
+
+ This function is intended to wrap around AstraDB operations in order to
+ measure their execution time, log relevant information, and trace the execution
+ using OpenTelemetry. This helps in monitoring and debugging operations within
+ the AstraDB space.
+
+ Parameters:
+ - operation (str): The specific AstraDB operation being monitored.
+ Examples include 'create_index', 'query', 'upsert', etc.
+ - version (str): The version of the application interfacing with AstraDB.
+ - environment (str): The deployment environment, such as 'production' or 'development'.
+ - application_name (str): The name of the application performing the AstraDB operation.
+ - tracer (opentelemetry.trace.Tracer): An object used for OpenTelemetry tracing.
+ - pricing_info (dict): Information about pricing, not used in current implementation.
+ - trace_content (bool): A flag indicating whether the content of responses should be traced.
+
+ Returns:
+ - function: A decorator function that, when applied, wraps the target function with
+ additional functionality for tracing and logging AstraDB operations.
+ """
+
+ def wrapper(wrapped, instance, args, kwargs):
+ """
+ Executes the wrapped AstraDB operation, adding tracing and logging.
+
+ This inner wrapper function captures the execution of AstraDB operations,
+ annotating the operation with relevant metrics and tracing information, and
+ ensuring any exceptions are caught and logged appropriately.
+
+ Parameters:
+ - wrapped (Callable): The AstraDB operation to be wrapped and executed.
+ - instance (object): The instance on which the operation is called (for class methods).
+ - args (tuple): Positional arguments for the AstraDB operation.
+ - kwargs (dict): Keyword arguments for the AstraDB operation.
+
+ Returns:
+ - Any: The result of executing the wrapped AstraDB operation.
+ """
+
+ with tracer.start_as_current_span(gen_ai_endpoint, kind= SpanKind.CLIENT) as span:
+ response = wrapped(*args, **kwargs)
+
+ try:
+ span.set_attribute(TELEMETRY_SDK_NAME, "openlit")
+ span.set_attribute(SemanticConvetion.GEN_AI_ENDPOINT,
+ gen_ai_endpoint)
+ span.set_attribute(SemanticConvetion.GEN_AI_ENVIRONMENT,
+ environment)
+ span.set_attribute(SemanticConvetion.GEN_AI_APPLICATION_NAME,
+ application_name)
+ span.set_attribute(SemanticConvetion.GEN_AI_TYPE,
+ SemanticConvetion.GEN_AI_TYPE_VECTORDB)
+ span.set_attribute(SemanticConvetion.DB_SYSTEM,
+ SemanticConvetion.DB_SYSTEM_ASTRA)
+
+ if gen_ai_endpoint == "astra.create_collection":
+ db_operation = SemanticConvetion.DB_OPERATION_CREATE_COLLECTION
+ span.set_attribute(SemanticConvetion.DB_OPERATION,
+ db_operation)
+ span.set_attribute(SemanticConvetion.DB_COLLECTION_NAME,
+ response.name)
+ span.set_attribute(SemanticConvetion.DB_INDEX_DIMENSION,
+ kwargs.get("dimension", ""))
+ span.set_attribute(SemanticConvetion.DB_INDEX_METRIC,
+ kwargs.get("metric", ""))
+ span.set_attribute(SemanticConvetion.DB_OPERATION_API_ENDPOINT,
+ instance.api_endpoint)
+
+ elif gen_ai_endpoint == "astra.drop_collection":
+ db_operation = SemanticConvetion.DB_OPERATION_DELETE_COLLECTION
+ span.set_attribute(SemanticConvetion.DB_OPERATION,
+ db_operation)
+ span.set_attribute(SemanticConvetion.DB_COLLECTION_NAME,
+ kwargs.get("name_or_collection", ""))
+ span.set_attribute(SemanticConvetion.DB_OPERATION_API_ENDPOINT,
+ instance.api_endpoint)
+
+ elif gen_ai_endpoint == "astra.insert_one":
+ db_operation = SemanticConvetion.DB_OPERATION_INSERT
+ span.set_attribute(SemanticConvetion.DB_OPERATION,
+ db_operation)
+ span.set_attribute(SemanticConvetion.DB_COLLECTION_NAME,
+ instance.name)
+ span.set_attribute(SemanticConvetion.DB_DOCUMENTS_COUNT,
+ 1)
+ span.set_attribute(SemanticConvetion.DB_OPERATION_API_ENDPOINT,
+ instance.database.api_endpoint)
+ span.set_attribute(SemanticConvetion.DB_OPERATION_ID,
+ response.inserted_id)
+
+ elif gen_ai_endpoint == "astra.insert_many":
+ db_operation = SemanticConvetion.DB_OPERATION_INSERT
+ span.set_attribute(SemanticConvetion.DB_OPERATION,
+ db_operation)
+ span.set_attribute(SemanticConvetion.DB_DOCUMENTS_COUNT,
+ object_count(args[0]))
+ span.set_attribute(SemanticConvetion.DB_COLLECTION_NAME,
+ instance.name)
+ span.set_attribute(SemanticConvetion.DB_OPERATION_API_ENDPOINT,
+ instance.database.api_endpoint)
+
+ elif gen_ai_endpoint in ["astra.update_one", "astra.update_many"]:
+ db_operation = SemanticConvetion.DB_OPERATION_UPDATE
+ span.set_attribute(SemanticConvetion.DB_OPERATION,
+ db_operation)
+ span.set_attribute(SemanticConvetion.DB_COLLECTION_NAME,
+ instance.name)
+ span.set_attribute(SemanticConvetion.DB_OPERATION_API_ENDPOINT,
+ instance.database.api_endpoint)
+ span.set_attribute(SemanticConvetion.DB_DOCUMENTS_COUNT,
+ response.update_info.get("nModified", 0))
+
+ elif gen_ai_endpoint == "astra.find_one_and_update":
+ db_operation = SemanticConvetion.DB_OPERATION_UPDATE
+ span.set_attribute(SemanticConvetion.DB_OPERATION,
+ db_operation)
+ span.set_attribute(SemanticConvetion.DB_COLLECTION_NAME,
+ instance.name)
+ span.set_attribute(SemanticConvetion.DB_OPERATION_API_ENDPOINT,
+ instance.database.api_endpoint)
+
+ elif gen_ai_endpoint == "astra.find":
+ db_operation = SemanticConvetion.DB_OPERATION_QUERY
+ span.set_attribute(SemanticConvetion.DB_OPERATION,
+ db_operation)
+ span.set_attribute(SemanticConvetion.DB_COLLECTION_NAME,
+ instance.name)
+ span.set_attribute(SemanticConvetion.DB_OPERATION_API_ENDPOINT,
+ instance.database.api_endpoint)
+ span.set_attribute(SemanticConvetion.DB_STATEMENT,
+ str(args))
+
+ elif gen_ai_endpoint == "astra.replace_one":
+ if kwargs.get("upsert") is True:
+ db_operation = SemanticConvetion.DB_OPERATION_UPSERT
+ else:
+ db_operation = SemanticConvetion.DB_OPERATION_REPLACE
+ span.set_attribute(SemanticConvetion.DB_OPERATION,
+ db_operation)
+ span.set_attribute(SemanticConvetion.DB_COLLECTION_NAME,
+ instance.name)
+ span.set_attribute(SemanticConvetion.DB_OPERATION_API_ENDPOINT,
+ instance.database.api_endpoint)
+ span.set_attribute(SemanticConvetion.DB_STATEMENT,
+ str(args))
+
+ elif gen_ai_endpoint in ["astra.delete_one", "astra.delete_many"]:
+ db_operation = SemanticConvetion.DB_OPERATION_DELETE
+ span.set_attribute(SemanticConvetion.DB_OPERATION,
+ db_operation)
+ span.set_attribute(SemanticConvetion.DB_COLLECTION_NAME,
+ instance.name)
+ span.set_attribute(SemanticConvetion.DB_OPERATION_API_ENDPOINT,
+ instance.database.api_endpoint)
+ span.set_attribute(SemanticConvetion.DB_STATEMENT,
+ str(args))
+ span.set_attribute(SemanticConvetion.DB_DOCUMENTS_COUNT,
+ response.deleted_count)
+
+ elif gen_ai_endpoint == "astra.find_one_and_delete":
+ db_operation = SemanticConvetion.DB_OPERATION_DELETE
+ span.set_attribute(SemanticConvetion.DB_OPERATION,
+ db_operation)
+ span.set_attribute(SemanticConvetion.DB_COLLECTION_NAME,
+ instance.name)
+ span.set_attribute(SemanticConvetion.DB_OPERATION_API_ENDPOINT,
+ instance.database.api_endpoint)
+ span.set_attribute(SemanticConvetion.DB_STATEMENT,
+ str(args))
+
+ span.set_status(Status(StatusCode.OK))
+
+ if disable_metrics is False:
+ attributes = {
+ TELEMETRY_SDK_NAME:
+ "openlit",
+ SemanticConvetion.GEN_AI_APPLICATION_NAME:
+ application_name,
+ SemanticConvetion.DB_SYSTEM:
+ SemanticConvetion.DB_SYSTEM_ASTRA,
+ SemanticConvetion.GEN_AI_ENVIRONMENT:
+ environment,
+ SemanticConvetion.GEN_AI_TYPE:
+ SemanticConvetion.GEN_AI_TYPE_VECTORDB,
+ SemanticConvetion.DB_OPERATION:
+ db_operation
+ }
+
+ metrics["db_requests"].add(1, attributes)
+
+ # Return original response
+ return response
+
+ except Exception as e:
+ handle_exception(span, e)
+ logger.error("Error in trace creation: %s", e)
+
+ # Return original response
+ return response
+
+ return wrapper
diff --git a/sdk/python/src/openlit/instrumentation/astra/async_astra.py b/sdk/python/src/openlit/instrumentation/astra/async_astra.py
new file mode 100644
index 00000000..aebfc3a4
--- /dev/null
+++ b/sdk/python/src/openlit/instrumentation/astra/async_astra.py
@@ -0,0 +1,226 @@
+# pylint: disable=duplicate-code, broad-exception-caught, too-many-statements, unused-argument, possibly-used-before-assignment, too-many-branches
+"""
+Module for monitoring AstraDB.
+"""
+
+import logging
+from opentelemetry.trace import SpanKind, Status, StatusCode
+from opentelemetry.sdk.resources import TELEMETRY_SDK_NAME
+from openlit.__helpers import handle_exception
+from openlit.semcov import SemanticConvetion
+
+# Initialize logger for logging potential issues and operations
+logger = logging.getLogger(__name__)
+
+def object_count(obj):
+ """
+ Counts Length of object if it exists, Else returns None
+ """
+
+ return len(obj) if obj else None
+
+def general_wrap(gen_ai_endpoint, version, environment, application_name,
+ tracer, pricing_info, trace_content, metrics, disable_metrics):
+ """
+ Wraps a AstraDB operation to trace and log its execution metrics.
+
+ This function is intended to wrap around AstraDB operations in order to
+ measure their execution time, log relevant information, and trace the execution
+ using OpenTelemetry. This helps in monitoring and debugging operations within
+ the AstraDB space.
+
+ Parameters:
+ - operation (str): The specific AstraDB operation being monitored.
+ Examples include 'create_index', 'query', 'upsert', etc.
+ - version (str): The version of the application interfacing with AstraDB.
+ - environment (str): The deployment environment, such as 'production' or 'development'.
+ - application_name (str): The name of the application performing the AstraDB operation.
+ - tracer (opentelemetry.trace.Tracer): An object used for OpenTelemetry tracing.
+ - pricing_info (dict): Information about pricing, not used in current implementation.
+ - trace_content (bool): A flag indicating whether the content of responses should be traced.
+
+ Returns:
+ - function: A decorator function that, when applied, wraps the target function with
+ additional functionality for tracing and logging AstraDB operations.
+ """
+
+ async def wrapper(wrapped, instance, args, kwargs):
+ """
+ Executes the wrapped AstraDB operation, adding tracing and logging.
+
+ This inner wrapper function captures the execution of AstraDB operations,
+ annotating the operation with relevant metrics and tracing information, and
+ ensuring any exceptions are caught and logged appropriately.
+
+ Parameters:
+ - wrapped (Callable): The AstraDB operation to be wrapped and executed.
+ - instance (object): The instance on which the operation is called (for class methods).
+ - args (tuple): Positional arguments for the AstraDB operation.
+ - kwargs (dict): Keyword arguments for the AstraDB operation.
+
+ Returns:
+ - Any: The result of executing the wrapped AstraDB operation.
+ """
+
+ with tracer.start_as_current_span(gen_ai_endpoint, kind= SpanKind.CLIENT) as span:
+ response = await wrapped(*args, **kwargs)
+
+ try:
+ span.set_attribute(TELEMETRY_SDK_NAME, "openlit")
+ span.set_attribute(SemanticConvetion.GEN_AI_ENDPOINT,
+ gen_ai_endpoint)
+ span.set_attribute(SemanticConvetion.GEN_AI_ENVIRONMENT,
+ environment)
+ span.set_attribute(SemanticConvetion.GEN_AI_APPLICATION_NAME,
+ application_name)
+ span.set_attribute(SemanticConvetion.GEN_AI_TYPE,
+ SemanticConvetion.GEN_AI_TYPE_VECTORDB)
+ span.set_attribute(SemanticConvetion.DB_SYSTEM,
+ SemanticConvetion.DB_SYSTEM_ASTRA)
+
+ if gen_ai_endpoint == "astra.create_collection":
+ db_operation = SemanticConvetion.DB_OPERATION_CREATE_COLLECTION
+ span.set_attribute(SemanticConvetion.DB_OPERATION,
+ db_operation)
+ span.set_attribute(SemanticConvetion.DB_COLLECTION_NAME,
+ response.name)
+ span.set_attribute(SemanticConvetion.DB_INDEX_DIMENSION,
+ kwargs.get("dimension", ""))
+ span.set_attribute(SemanticConvetion.DB_INDEX_METRIC,
+ kwargs.get("metric", ""))
+ span.set_attribute(SemanticConvetion.DB_OPERATION_API_ENDPOINT,
+ instance.api_endpoint)
+
+ elif gen_ai_endpoint == "astra.drop_collection":
+ db_operation = SemanticConvetion.DB_OPERATION_DELETE_COLLECTION
+ span.set_attribute(SemanticConvetion.DB_OPERATION,
+ db_operation)
+ span.set_attribute(SemanticConvetion.DB_COLLECTION_NAME,
+ kwargs.get("name_or_collection", ""))
+ span.set_attribute(SemanticConvetion.DB_OPERATION_API_ENDPOINT,
+ instance.api_endpoint)
+
+ elif gen_ai_endpoint == "astra.insert_one":
+ db_operation = SemanticConvetion.DB_OPERATION_INSERT
+ span.set_attribute(SemanticConvetion.DB_OPERATION,
+ db_operation)
+ span.set_attribute(SemanticConvetion.DB_COLLECTION_NAME,
+ instance.name)
+ span.set_attribute(SemanticConvetion.DB_DOCUMENTS_COUNT,
+ 1)
+ span.set_attribute(SemanticConvetion.DB_OPERATION_API_ENDPOINT,
+ instance.database.api_endpoint)
+ span.set_attribute(SemanticConvetion.DB_OPERATION_ID,
+ response.inserted_id)
+
+ elif gen_ai_endpoint == "astra.insert_many":
+ db_operation = SemanticConvetion.DB_OPERATION_INSERT
+ span.set_attribute(SemanticConvetion.DB_OPERATION,
+ db_operation)
+ span.set_attribute(SemanticConvetion.DB_DOCUMENTS_COUNT,
+ object_count(args[0]))
+ span.set_attribute(SemanticConvetion.DB_COLLECTION_NAME,
+ instance.name)
+ span.set_attribute(SemanticConvetion.DB_OPERATION_API_ENDPOINT,
+ instance.database.api_endpoint)
+
+ elif gen_ai_endpoint in ["astra.update_one", "astra.update_many"]:
+ db_operation = SemanticConvetion.DB_OPERATION_UPDATE
+ span.set_attribute(SemanticConvetion.DB_OPERATION,
+ db_operation)
+ span.set_attribute(SemanticConvetion.DB_COLLECTION_NAME,
+ instance.name)
+ span.set_attribute(SemanticConvetion.DB_OPERATION_API_ENDPOINT,
+ instance.database.api_endpoint)
+ span.set_attribute(SemanticConvetion.DB_DOCUMENTS_COUNT,
+ response.update_info.get("nModified", 0))
+
+ elif gen_ai_endpoint == "astra.find_one_and_update":
+ db_operation = SemanticConvetion.DB_OPERATION_UPDATE
+ span.set_attribute(SemanticConvetion.DB_OPERATION,
+ db_operation)
+ span.set_attribute(SemanticConvetion.DB_COLLECTION_NAME,
+ instance.name)
+ span.set_attribute(SemanticConvetion.DB_OPERATION_API_ENDPOINT,
+ instance.database.api_endpoint)
+
+ elif gen_ai_endpoint == "astra.find":
+ db_operation = SemanticConvetion.DB_OPERATION_QUERY
+ span.set_attribute(SemanticConvetion.DB_OPERATION,
+ db_operation)
+ span.set_attribute(SemanticConvetion.DB_COLLECTION_NAME,
+ instance.name)
+ span.set_attribute(SemanticConvetion.DB_OPERATION_API_ENDPOINT,
+ instance.database.api_endpoint)
+ span.set_attribute(SemanticConvetion.DB_STATEMENT,
+ str(args))
+
+ elif gen_ai_endpoint == "astra.replace_one":
+ if kwargs.get("upsert") is True:
+ db_operation = SemanticConvetion.DB_OPERATION_UPSERT
+ else:
+ db_operation = SemanticConvetion.DB_OPERATION_REPLACE
+ span.set_attribute(SemanticConvetion.DB_OPERATION,
+ db_operation)
+ span.set_attribute(SemanticConvetion.DB_COLLECTION_NAME,
+ instance.name)
+ span.set_attribute(SemanticConvetion.DB_OPERATION_API_ENDPOINT,
+ instance.database.api_endpoint)
+ span.set_attribute(SemanticConvetion.DB_STATEMENT,
+ str(args))
+
+ elif gen_ai_endpoint in ["astra.delete_one", "astra.delete_many"]:
+ db_operation = SemanticConvetion.DB_OPERATION_DELETE
+ span.set_attribute(SemanticConvetion.DB_OPERATION,
+ db_operation)
+ span.set_attribute(SemanticConvetion.DB_COLLECTION_NAME,
+ instance.name)
+ span.set_attribute(SemanticConvetion.DB_OPERATION_API_ENDPOINT,
+ instance.database.api_endpoint)
+ span.set_attribute(SemanticConvetion.DB_STATEMENT,
+ str(args))
+ span.set_attribute(SemanticConvetion.DB_DOCUMENTS_COUNT,
+ response.deleted_count)
+
+ elif gen_ai_endpoint == "astra.find_one_and_delete":
+ db_operation = SemanticConvetion.DB_OPERATION_DELETE
+ span.set_attribute(SemanticConvetion.DB_OPERATION,
+ db_operation)
+ span.set_attribute(SemanticConvetion.DB_COLLECTION_NAME,
+ instance.name)
+ span.set_attribute(SemanticConvetion.DB_OPERATION_API_ENDPOINT,
+ instance.database.api_endpoint)
+ span.set_attribute(SemanticConvetion.DB_STATEMENT,
+ str(args))
+
+ span.set_status(Status(StatusCode.OK))
+
+ if disable_metrics is False:
+ attributes = {
+ TELEMETRY_SDK_NAME:
+ "openlit",
+ SemanticConvetion.GEN_AI_APPLICATION_NAME:
+ application_name,
+ SemanticConvetion.DB_SYSTEM:
+ SemanticConvetion.DB_SYSTEM_ASTRA,
+ SemanticConvetion.GEN_AI_ENVIRONMENT:
+ environment,
+ SemanticConvetion.GEN_AI_TYPE:
+ SemanticConvetion.GEN_AI_TYPE_VECTORDB,
+ SemanticConvetion.DB_OPERATION:
+ db_operation
+ }
+
+ metrics["db_requests"].add(1, attributes)
+
+ # Return original response
+ return response
+
+ except Exception as e:
+ handle_exception(span, e)
+ logger.error("Error in trace creation: %s", e)
+
+ # Return original response
+ return response
+
+ return wrapper
diff --git a/sdk/python/src/openlit/semcov/__init__.py b/sdk/python/src/openlit/semcov/__init__.py
index 6ecab575..b540fbed 100644
--- a/sdk/python/src/openlit/semcov/__init__.py
+++ b/sdk/python/src/openlit/semcov/__init__.py
@@ -121,17 +121,21 @@ class SemanticConvetion:
GEN_AI_SYSTEM_JULEP = "julep"
# Vector DB
+ DB_OPERATION_API_ENDPOINT = "db.operation.api_endpoint"
DB_REQUESTS = "db.total.requests"
DB_SYSTEM = "db.system"
DB_COLLECTION_NAME = "db.collection.name"
DB_OPERATION = "db.operation"
+ DB_OPERATION_ID = "db.operation.id"
DB_OPERATION_STATUS = "db.operation.status"
DB_OPERATION_COST = "db.operation.cost"
DB_OPERATION_CREATE_INDEX = "create_index"
DB_OPERATION_CREATE_COLLECTION = "create_collection"
DB_OPERATION_UPDATE_COLLECTION = "update_collection"
DB_OPERATION_DELETE_COLLECTION = "delete_collection"
+ DB_OPERATION_INSERT = "insert"
DB_OPERATION_QUERY = "query"
+ DB_OPERATION_REPLACE = "replace"
DB_OPERATION_DELETE = "delete"
DB_OPERATION_UPDATE = "update"
DB_OPERATION_UPSERT = "upsert"
@@ -166,6 +170,7 @@ class SemanticConvetion:
DB_SYSTEM_PINECONE = "pinecone"
DB_SYSTEM_QDRANT = "qdrant"
DB_SYSTEM_MILVUS = "milvus"
+ DB_SYSTEM_ASTRA = "astra"
# Agents
GEN_AI_AGENT_ID = "gen_ai.agent.id"
diff --git a/sdk/python/tests/requirements.txt b/sdk/python/tests/requirements.txt
index 48ace1af..37c3aef7 100644
--- a/sdk/python/tests/requirements.txt
+++ b/sdk/python/tests/requirements.txt
@@ -28,6 +28,7 @@ chromadb
pinecone-client
qdrant-client
pymilvus
+astrapy
# Frameworks
langchain
diff --git a/sdk/python/tests/test_astra.py b/sdk/python/tests/test_astra.py
new file mode 100644
index 00000000..4d56013b
--- /dev/null
+++ b/sdk/python/tests/test_astra.py
@@ -0,0 +1,117 @@
+# pylint: disable=duplicate-code, no-name-in-module, assignment-from-no-return
+"""
+This module contains tests for AstraDB functionality using the AstraDB Python library.
+
+Tests cover various API endpoints, including create_collection, add, query,
+upsert, update, get, peek and delete.
+These tests validate integration with OpenLIT.
+
+Note: Ensure the environment is properly configured for AstraDB access and OpenLIT monitoring
+prior to running these tests.
+"""
+
+import os
+from astrapy import DataAPIClient
+import openlit
+
+# Initialize the client
+client = DataAPIClient(os.getenv("ASTRA_DB_APPLICATION_TOKEN"))
+db = client.get_database_by_api_endpoint(
+ os.getenv("ASTRA_DB_API_ENDPOINT")
+)
+
+# Initialize environment and application name for OpenLIT monitoring
+openlit.init(environment="openlit-python-testing", application_name="openlit-python-astra-test")
+
+def test_db_chroma():
+ """
+ Tests basic operations within a AstraDB collection.
+
+ This includes creating a new collection, adding documents to the collection,
+ querying the collection, and deleting documents from the collection. The test
+ verifies correct behavior of these operations by asserting expected outcomes at
+ """
+
+ # collection = db.create_collection(
+ # "openlit",
+ # dimension=3,
+ # metric=astrapy.constants.VectorMetric.COSINE,
+ # )
+ # assert collection.name == "openlit"
+ collection = db.get_collection("openlit")
+
+ response = collection.insert_one({"summary": "I was flying", "$vector": [-0.4, 0.7, 0]})
+ assert isinstance(response.inserted_id, str)
+
+ response = collection.insert_many(
+ [
+ {
+ "tags": ["food"],
+ "summary": "A dinner on the Moon",
+ "$vector": [0.2, -0.3, -0.5],
+ },
+ {
+ "summary": "Riding the waves",
+ "tags": ["sport"],
+ "$vector": [0, 0.2, 1],
+ },
+ {
+ "summary": "Friendly aliens in town",
+ "tags": ["scifi"],
+ "$vector": [-0.3, 0, 0.8],
+ },
+ {
+ "summary": "Meeting Beethoven at the dentist",
+ "$vector": [0.2, 0.6, 0],
+ },
+ ],
+ )
+ assert isinstance(response.inserted_ids, list)
+
+ response = collection.update_one(
+ {"tags": "sport"},
+ {"$set": {"summary": "Surfers' paradise"}},
+ )
+ assert isinstance(response.update_info["n"], int)
+
+ response = collection.update_many(
+ {"tags": {"$exists": False}},
+ {"$set": {"name": "unknown"}},
+ )
+ assert isinstance(response.update_info["n"], int)
+
+ response = collection.find_one_and_update(
+ {"tags": {"$exists": True}},
+ {"$set": {"name": "Mr."}},
+ )
+ assert isinstance(response["tags"], list)
+
+ response = collection.find_one({"tag": {"$exists": True}})
+ assert response is None
+
+ cursor = collection.find(
+ {},
+ sort={"$vector": [0, 0.2, 0.4]},
+ limit=2,
+ include_similarity=True,
+ )
+ for response in cursor:
+ assert isinstance(response['summary'], str)
+
+ response = collection.replace_one(
+ {"tag": {"$exists": True}}, # filter
+ {"summary": "Pest"}, # replacement
+ )
+ assert isinstance(response.update_info["n"], int)
+
+ response = collection.delete_one({"tag": {"$exists": True}})
+ assert isinstance(response.deleted_count, int)
+
+ response = collection.delete_many({"tag": {"$exists": True}})
+ assert isinstance(response.deleted_count, int)
+
+ response = collection.find_one_and_delete({"status": "stale_entry"})
+ assert response is None
+
+ # response = db.drop_collection(name_or_collection="openlit")
+ # assert isinstance(response["ok"], int)
diff --git a/sdk/python/tests/test_qdrant.py b/sdk/python/tests/test_qdrant.py
index f494cc18..44e836f1 100644
--- a/sdk/python/tests/test_qdrant.py
+++ b/sdk/python/tests/test_qdrant.py
@@ -26,7 +26,7 @@ client = QdrantClient(
)
# Initialize environment and application name for OpenLIT monitoring
-openlit.init(environment="openlit-testing", application_name="openlit-python-test")
+openlit.init(environment="openlit-python-testing", application_name="openlit-python-qdrant-test")
COLLECTION_NAME = "openlit"
def test_db_qdrant():