Skip to content

Commit

Permalink
chore: renamed missed type
Browse files Browse the repository at this point in the history
  • Loading branch information
Anush008 committed Jun 15, 2024
1 parent f05df5e commit 46f6e21
Showing 1 changed file with 36 additions and 27 deletions.
63 changes: 36 additions & 27 deletions packages/instrumentation-qdrant/src/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,30 +154,37 @@ export class QdrantInstrumentation extends InstrumentationBase<any> {

try {
if (this._config.traceContent) {
if (methodName === UPSERT) {
this._setUpsertAttributes(
span,
collectionName,
params as UpsertRequest,
);
} else if (methodName === DELETE) {
this._setDeleteAttributes(
span,
collectionName,
params as DeleteRequest,
);
} else if (methodName === RETRIEVE) {
this._setRetrieveAttributes(
span,
collectionName,
params as RetrieveRequest,
);
} else if (methodName === SEARCH) {
this._setSearchAttributes(
span,
collectionName,
params as SearchRequest,
);
switch (methodName) {
case UPSERT:
this._setUpsertAttributes(
span,
collectionName,
params as UpsertRequest,
);
break;
case DELETE:
this._setDeleteAttributes(
span,
collectionName,
params as DeleteRequest,
);
break;
case RETRIEVE:
this._setRetrieveAttributes(
span,
collectionName,
params as RetrieveRequest,
);
break;
case SEARCH:
this._setSearchAttributes(
span,
collectionName,
params as SearchRequest,
);
break;
default:
break;
}
}
} catch (e) {
Expand All @@ -198,8 +205,10 @@ export class QdrantInstrumentation extends InstrumentationBase<any> {
result: any;
}) {
try {
if (methodName === SEARCH) {
this._setSearchResultAttributes(span, result as SearchResponse);
switch (methodName) {
case SEARCH: this._setSearchResultAttributes(span, result as SearchResponse);
break;
default: break;
}
span.setStatus({ code: SpanStatusCode.OK });
span.end();
Expand All @@ -212,7 +221,7 @@ export class QdrantInstrumentation extends InstrumentationBase<any> {
private _setUpsertAttributes(
span: Span,
collectionName: string,
params: qdrant.Schemas["PointInsertOperations"],
params: UpsertRequest,
) {
span.setAttribute("db.qdrant.upsert.collection_name", collectionName);
if ("batch" in params) {
Expand Down

0 comments on commit 46f6e21

Please sign in to comment.