Skip to content

Commit 193d85a

Browse files
author
Kapil Rastogi
authored
Merge pull request #8 from ExpediaDotCom/update-haystack-client
updating haystack-client min version 0.1.3
2 parents 5afe5a3 + d8393b5 commit 193d85a

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"Haystack <haystack@expedia.com>"
2121
],
2222
"dependencies": {
23-
"haystack-client": "^0.1.0",
23+
"haystack-client": "^0.1.3",
2424
"google-protobuf": "^3.0.0",
2525
"grpc": "^1.9.0",
2626
"base-64": "^0.1.0",

src/blob_client_impl.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ export default class BlobClientImpl implements BlobClient {
5050
throw new Error(`Fail to write the blob to an already closed haystack span`);
5151
}
5252
const spanCtx = span.context();
53-
const parentSpanId = spanCtx.parentSpanId() || spanCtx.traceId();
54-
span.setTag(`Blob-${blobType}`, `/getBlob/${span.serviceName()}/${blobType}/${spanCtx.traceId()}/${parentSpanId}/${spanCtx.spanId()}`);
53+
const parentSpanId = spanCtx.parentSpanId || spanCtx.traceId;
54+
span.setTag(`Blob-${blobType}`, `/getBlob/${span.serviceName()}/${blobType}/${spanCtx.traceId}/${parentSpanId}/${spanCtx.spanId}`);
5555
this._dispatcher.dispatch(span, blobPayload, blobType, contentType, callback);
5656
}
5757
}

src/dispatchers/offline_agent_dispatcher.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ export default class OfflineAgentDispatcher implements Dispatcher {
6565
this._ensureDirectoryExists(span, blobDir => {
6666
const blobFilePath = Utils.blobFilePath(span, blobDir, blobtype);
6767
const spanCtx = span.context();
68-
const requestId = spanCtx.parentSpanId() || spanCtx.traceId();
68+
const requestId = spanCtx.parentSpanId || spanCtx.traceId;
6969

7070
const blobWithMetadata = {
7171
client: span.serviceName(),
7272
timestamp: Date.now(),
73-
transactionid: spanCtx.traceId(),
74-
eventid: spanCtx.spanId(),
73+
transactionid: spanCtx.traceId,
74+
eventid: spanCtx.spanId,
7575
requestid: requestId,
7676
blobType: blobtype,
7777
contentType: contenttype.toString(),

src/dispatchers/remote.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ export default class RemoteDispatcher implements Dispatcher {
6666
private _convertToProtoBlob(span: haystack.Span, blobPayload: Buffer, blobType: string, contentType: BlobContentType): any {
6767
const protoBlob = new messages.Blob();
6868
const spanCtx = span.context();
69-
const requestId = spanCtx.parentSpanId() || spanCtx.traceId();
69+
const requestId = spanCtx.parentSpanId || spanCtx.traceId;
7070

7171
protoBlob.setClient(span.serviceName());
72-
protoBlob.setTransactionid(spanCtx.traceId());
73-
protoBlob.setEventid(spanCtx.spanId());
72+
protoBlob.setTransactionid(spanCtx.traceId);
73+
protoBlob.setEventid(spanCtx.spanId);
7474
protoBlob.setRequestid(requestId);
7575
protoBlob.setTimestamp(Date.now());
7676
protoBlob.setContent(blobPayload);

src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default class Utils {
2020

2121
static blobFilePath(span: haystack.Span, baseDir: string, blobType: string): string {
2222
const spanCtx = span.context();
23-
const parentSpanIdMarker = spanCtx.parentSpanId() || spanCtx.traceId();
24-
return `${baseDir}/${span.serviceName()}_${spanCtx.traceId()}_${parentSpanIdMarker}_${spanCtx.spanId()}_${blobType}.log`;
23+
const parentSpanIdMarker = spanCtx.parentSpanId || spanCtx.traceId;
24+
return `${baseDir}/${span.serviceName()}_${spanCtx.traceId}_${parentSpanIdMarker}_${spanCtx.spanId}_${blobType}.log`;
2525
}
2626
}

0 commit comments

Comments
 (0)