Skip to content

Commit

Permalink
Merge pull request #8 from ExpediaDotCom/update-haystack-client
Browse files Browse the repository at this point in the history
updating haystack-client min version 0.1.3
  • Loading branch information
Kapil Rastogi authored Aug 3, 2018
2 parents 5afe5a3 + d8393b5 commit 193d85a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"Haystack <[email protected]>"
],
"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",
Expand Down
4 changes: 2 additions & 2 deletions src/blob_client_impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
6 changes: 3 additions & 3 deletions src/dispatchers/offline_agent_dispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
6 changes: 3 additions & 3 deletions src/dispatchers/remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
}
}

0 comments on commit 193d85a

Please sign in to comment.