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

fix(backend): adding empty port as supported for tempo #2704

Conversation

xoscar
Copy link
Collaborator

@xoscar xoscar commented Jun 9, 2023

This PR removes the warning for http ports when using tempo as a data store

Changes

  • Adds empty port as valid for tempo
  • Updates libs to parse urls

Fixes

Checklist

  • tested locally
  • added new dependencies
  • updated the docs
  • added a test

@xoscar xoscar linked an issue Jun 9, 2023 that may be closed by this pull request
@@ -25,7 +25,7 @@ type HttpClient struct {
}

func NewHttpClient(name string, config *datastoreresource.HttpClientConfig, callback HttpCallback) DataSource {
endpoint, _ := url.Parse(config.Url)
endpoint, _ := urlx.Parse(config.Url)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes an annoying but with the URL lib not setting up the expected values when parsing the url

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the main difference between using url.Parse and urlx.Parse? Is there a way to keep url.Parse?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is my concern: https://github.com/goware/urlx is a small library without changes for 2 years and we are using only a portion of its capability.
My thought is that we can transform the url.URL return like this lib does.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... In that case, we can keep it and mark a tech debt to eliminate this dependency in the future.

@@ -23,7 +23,7 @@ import (
)

func tempoDefaultPorts() []string {
return []string{"9095"}
return []string{"9095", ""}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For http urls like www.grafana.com/traces the port is "not" setup

Ideally, I'd like us to change this logic to allow each integration read the config file and based on the values decide what is the expected list of port instead of having a static list

@xoscar xoscar self-assigned this Jun 12, 2023
@xoscar xoscar added the backend label Jun 12, 2023
@xoscar xoscar marked this pull request as ready for review June 12, 2023 15:16
@xoscar xoscar merged commit 2e8c2e4 into main Jun 12, 2023
24 checks passed
@xoscar xoscar deleted the 2155-port-number-when-setting-up-grafana-with-http-not-shown-correctly branch June 12, 2023 17:34
mathnogueira pushed a commit that referenced this pull request Jun 13, 2023
fix(backend): adding empty port as supproted for tempo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Port number when setting up Grafana with http not shown correctly
2 participants