-
Notifications
You must be signed in to change notification settings - Fork 847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(exporter-collector): default endpoint for node and browser #1197
Changes from 3 commits
ac9f12f
843eafe
f983d37
fa10cb3
fbcd430
8878457
c4f73d6
b1cc101
16978eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,8 @@ import * as collectorTypes from '../../types'; | |
|
||
export type CollectorExporterConfig = CollectorExporterConfigBase; | ||
|
||
const DEFAULT_COLLECTOR_URL = 'http://localhost:55678/v1/trace'; | ||
|
||
/** | ||
* Collector Exporter for Web | ||
*/ | ||
|
@@ -38,6 +40,10 @@ export class CollectorExporter extends CollectorExporterBase< | |
window.removeEventListener('unload', this.shutdown); | ||
} | ||
|
||
defaultURL(url: string | undefined) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would change the name to describe some action as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For me, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can be getDefaultUrl, chooseDefaultUrl etc. just something that sounds like action / method :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @obecny @mayurkale22 Just fixed that, thanks! |
||
return url || DEFAULT_COLLECTOR_URL; | ||
} | ||
|
||
sendSpans( | ||
spans: ReadableSpan[], | ||
onSuccess: () => void, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,8 @@ import { toCollectorExportTraceServiceRequest } from '../../transform'; | |
import { GRPCQueueItem, TraceServiceClient } from './types'; | ||
import { removeProtocol } from './util'; | ||
|
||
const DEFAULT_COLLECTOR_URL = 'http://localhost:55678'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should change this URL to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would change the default url, but would live the |
||
|
||
/** | ||
* Collector Exporter Config for Node | ||
*/ | ||
|
@@ -135,4 +137,8 @@ export class CollectorExporter extends CollectorExporterBase< | |
}); | ||
} | ||
} | ||
|
||
defaultURL(url: string | undefined): string { | ||
return url || DEFAULT_COLLECTOR_URL; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would mention both (Node and Web) default URLs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mayurkale22 Should I also throw an error/alter the URL when someone enters an incorrect URL? (e.g. entering a URL that ends in
/v1/trace
for Node)