Skip to content

feat: Allow for custom endpoints in chronicleexporter/http_exporter #2167

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shazlehu
Copy link
Contributor

Removes the requirement for Config.Location to be set so that users can use a custom endpoint. If Location is set, we construct the endpoint for backwards compatibility.

Checklist
  • Changes are tested
  • CI has passed

@shazlehu shazlehu requested review from dpaasman00 and a team as code owners February 14, 2025 23:09
Comment on lines -140 to -141
if cfg.Location == "" {
return errors.New("location is required when protocol is https")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is still required because this parameter is used for every log that's sent in the constructed forwarder string. We'll probably need a different way/new parameter to indicate a custom endpoint. https://github.com/observIQ/bindplane-otel-collector/blob/main/exporter/chronicleexporter/marshal.go#L532-L535

@@ -156,6 +156,9 @@ func (exp *httpExporter) uploadToChronicleHTTP(ctx context.Context, logs *api.Im
// URL for the request: https://{region}-chronicle.googleapis.com/{version}/projects/{project}/location/{region}/instances/{customerID}
// Override for testing
var httpEndpoint = func(cfg *Config, logType string) string {
if cfg.Location == "" {
return fmt.Sprintf("https://%s/v1alpha/projects/%s/instances/%s/logTypes/%s/logs:import", cfg.Endpoint, cfg.Project, cfg.CustomerID, logType)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still require the location value in the URL? Asked Travis about this and he was going to test it out.

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