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

不支持采https? #115

Open
Hoyifei opened this issue Apr 24, 2024 · 1 comment
Open

不支持采https? #115

Hoyifei opened this issue Apr 24, 2024 · 1 comment

Comments

@Hoyifei
Copy link

Hoyifei commented Apr 24, 2024

在prometheus.yml里打标了__schema__=https,结果下发的job还是http
kvass/pkg/sidecar/injector.go:107 injectJobs()

func (i *Injector) injectJobs(cfg *config.Config) error {
	for _, job := range cfg.ScrapeConfigs {
		if i.option.ProxyURL != "" {
			u, err := url.Parse(i.option.ProxyURL)
			if err != nil {
				return err
			}

			job.HTTPClientConfig.ProxyURL = config_util.URL{
				URL: u,
			}
		}

		job.ServiceDiscoveryConfigs = []discovery.Config{
			discovery.StaticConfig(target2targetGroup(job.JobName, i.curTargets[job.JobName])),
		}

		job.Scheme = "http"
		job.HTTPClientConfig.BearerToken = ""
		job.HTTPClientConfig.BasicAuth = nil
		job.HTTPClientConfig.TLSConfig = config_util.TLSConfig{}

		// fix invalid label
		job.RelabelConfigs = []*relabel.Config{
			{
				Separator:   ";",
				Regex:       relabel.MustNewRegexp(target.PrefixForInvalidLabelName + "(.+)"),
				Replacement: "$1",
				Action:      relabel.LabelMap,
			},
		}
	}

	return nil
}
@Hoyifei
Copy link
Author

Hoyifei commented Apr 24, 2024

哦原来提过了
#105

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

No branches or pull requests

1 participant