Skip to content
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

Conversation

Diabl0Man
Copy link
Contributor

@Diabl0Man Diabl0Man commented Mar 9, 2020

Required for all PRs:

  • Signed CLA.
  • Associated README.md updated.
  • Has appropriate unit tests.

@Diabl0Man Diabl0Man marked this pull request as ready for review March 9, 2020 09:08
Copy link
Contributor

@ssoroka ssoroka left a 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.

plugins/outputs/application_insights/transmitter.go Outdated Show resolved Hide resolved
plugins/outputs/application_insights/transmitter.go Outdated Show resolved Hide resolved
@Diabl0Man Diabl0Man requested a review from ssoroka March 11, 2020 11:12
func NewTransmitter(ikey string) *Transmitter {
return &Transmitter{client: appinsights.NewTelemetryClient(ikey)}
func NewTransmitter(ikey string, endpointURL string) *Transmitter {
if len(endpointURL) == 0 {
Copy link
Contributor

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.

Copy link
Contributor Author

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

@ssoroka ssoroka merged commit a03555e into influxdata:master Aug 19, 2020
pmalek-sumo pushed a commit to SumoLogic/telegraf that referenced this pull request Aug 20, 2020
pmalek-sumo pushed a commit to SumoLogic/telegraf that referenced this pull request Aug 26, 2020
idohalevi pushed a commit to idohalevi/telegraf that referenced this pull request Sep 29, 2020
arstercz pushed a commit to arstercz/telegraf that referenced this pull request Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants