Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Commit

Permalink
Use options.host instead of options.hostname (#416) (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
jinmel authored and mayurkale22 committed Mar 13, 2019
1 parent 096eb70 commit 66ebc78
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/opencensus-instrumentation-http/src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,8 @@ export class HttpPlugin extends BasePlugin {
const tags = new TagMap();
tags.set(stats.HTTP_CLIENT_METHOD, {value: method});

if (options.hostname) {
span.addAttribute(HttpPlugin.ATTRIBUTE_HTTP_HOST, options.hostname);
}
const host = options.hostname || options.host || 'localhost';
span.addAttribute(HttpPlugin.ATTRIBUTE_HTTP_HOST, host);
span.addAttribute(HttpPlugin.ATTRIBUTE_HTTP_METHOD, method);
if (options.path) {
span.addAttribute(HttpPlugin.ATTRIBUTE_HTTP_PATH, options.path);
Expand Down

0 comments on commit 66ebc78

Please sign in to comment.