From d8393b5b75f97f9bc6324af15766d63f6e0a00cd Mon Sep 17 00:00:00 2001 From: Ashish Aggarwal Date: Fri, 3 Aug 2018 12:06:49 +0530 Subject: [PATCH] updating haystack-client min version 0.1.3 --- package.json | 2 +- src/blob_client_impl.ts | 4 ++-- src/dispatchers/offline_agent_dispatcher.ts | 6 +++--- src/dispatchers/remote.ts | 6 +++--- src/utils.ts | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 5efc3b8..7ccb65f 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "Haystack " ], "dependencies": { - "haystack-client": "^0.1.0", + "haystack-client": "^0.1.3", "google-protobuf": "^3.0.0", "grpc": "^1.9.0", "base-64": "^0.1.0", diff --git a/src/blob_client_impl.ts b/src/blob_client_impl.ts index 2c2ccdb..9a2d334 100644 --- a/src/blob_client_impl.ts +++ b/src/blob_client_impl.ts @@ -50,8 +50,8 @@ export default class BlobClientImpl implements BlobClient { throw new Error(`Fail to write the blob to an already closed haystack span`); } const spanCtx = span.context(); - const parentSpanId = spanCtx.parentSpanId() || spanCtx.traceId(); - span.setTag(`Blob-${blobType}`, `/getBlob/${span.serviceName()}/${blobType}/${spanCtx.traceId()}/${parentSpanId}/${spanCtx.spanId()}`); + const parentSpanId = spanCtx.parentSpanId || spanCtx.traceId; + span.setTag(`Blob-${blobType}`, `/getBlob/${span.serviceName()}/${blobType}/${spanCtx.traceId}/${parentSpanId}/${spanCtx.spanId}`); this._dispatcher.dispatch(span, blobPayload, blobType, contentType, callback); } } diff --git a/src/dispatchers/offline_agent_dispatcher.ts b/src/dispatchers/offline_agent_dispatcher.ts index 79456fb..17f3a14 100644 --- a/src/dispatchers/offline_agent_dispatcher.ts +++ b/src/dispatchers/offline_agent_dispatcher.ts @@ -65,13 +65,13 @@ export default class OfflineAgentDispatcher implements Dispatcher { this._ensureDirectoryExists(span, blobDir => { const blobFilePath = Utils.blobFilePath(span, blobDir, blobtype); const spanCtx = span.context(); - const requestId = spanCtx.parentSpanId() || spanCtx.traceId(); + const requestId = spanCtx.parentSpanId || spanCtx.traceId; const blobWithMetadata = { client: span.serviceName(), timestamp: Date.now(), - transactionid: spanCtx.traceId(), - eventid: spanCtx.spanId(), + transactionid: spanCtx.traceId, + eventid: spanCtx.spanId, requestid: requestId, blobType: blobtype, contentType: contenttype.toString(), diff --git a/src/dispatchers/remote.ts b/src/dispatchers/remote.ts index 1909666..b223a8c 100644 --- a/src/dispatchers/remote.ts +++ b/src/dispatchers/remote.ts @@ -66,11 +66,11 @@ export default class RemoteDispatcher implements Dispatcher { private _convertToProtoBlob(span: haystack.Span, blobPayload: Buffer, blobType: string, contentType: BlobContentType): any { const protoBlob = new messages.Blob(); const spanCtx = span.context(); - const requestId = spanCtx.parentSpanId() || spanCtx.traceId(); + const requestId = spanCtx.parentSpanId || spanCtx.traceId; protoBlob.setClient(span.serviceName()); - protoBlob.setTransactionid(spanCtx.traceId()); - protoBlob.setEventid(spanCtx.spanId()); + protoBlob.setTransactionid(spanCtx.traceId); + protoBlob.setEventid(spanCtx.spanId); protoBlob.setRequestid(requestId); protoBlob.setTimestamp(Date.now()); protoBlob.setContent(blobPayload); diff --git a/src/utils.ts b/src/utils.ts index 7a61803..b0ffd09 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -20,7 +20,7 @@ export default class Utils { static blobFilePath(span: haystack.Span, baseDir: string, blobType: string): string { const spanCtx = span.context(); - const parentSpanIdMarker = spanCtx.parentSpanId() || spanCtx.traceId(); - return `${baseDir}/${span.serviceName()}_${spanCtx.traceId()}_${parentSpanIdMarker}_${spanCtx.spanId()}_${blobType}.log`; + const parentSpanIdMarker = spanCtx.parentSpanId || spanCtx.traceId; + return `${baseDir}/${span.serviceName()}_${spanCtx.traceId}_${parentSpanIdMarker}_${spanCtx.spanId}_${blobType}.log`; } }