-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Added the ability to set the endpoint url in the configuration file #7134
Added the ability to set the endpoint url in the configuration file #7134
Conversation
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.
Thanks for the PR! Just need some minor edits to merge.
func NewTransmitter(ikey string) *Transmitter { | ||
return &Transmitter{client: appinsights.NewTelemetryClient(ikey)} | ||
func NewTransmitter(ikey string, endpointURL string) *Transmitter { | ||
if len(endpointURL) == 0 { |
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.
You could simplify this function to:
func NewTransmitter(ikey string, endpointURL string) *Transmitter {
telemetryConfig := appinsights.NewTelemetryConfiguration(ikey)
telemetryConfig.EndpointUrl = endpointURL
return &Transmitter{client: appinsights.NewTelemetryClientFromConfig(telemetryConfig)}
}
since telemetryConfig.EndpointUrl is likely already an empty string.
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.
telemetryConfig.EndpointUrl
by default = https://dc.services.visualstudio.com/v2/track
and if we set it to empty we get error
Required for all PRs: