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

feat: SSAPI mvp #1951

Draft
wants to merge 22 commits into
base: release/v1.64.0
Choose a base branch
from
Draft

feat: SSAPI mvp #1951

wants to merge 22 commits into from

Conversation

Caleb-Hurshman
Copy link

Proposed Change

Copy the MVP of the SSAPI (formerly SHMR) to the bindplane-agent repo.
Adds query validation to the config, along with a new limit option.

Checklist
  • Changes are tested
  • CI has passed

@CLAassistant
Copy link

CLAassistant commented Nov 8, 2024

CLA assistant check
All committers have signed the CLA.

receiver/splunksearchapireceiver/api.go Outdated Show resolved Hide resolved
if err != nil {
return SearchResults{}, err
}
req.SetBasicAuth(config.Username, config.Password)
Copy link
Contributor

Choose a reason for hiding this comment

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

I should also note that we should do some oauth token authentication as well. Not sure if you have a future task pending for that

Copy link
Author

Choose a reason for hiding this comment

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

I don't have a ticket for that right now, but I'll make one

docs/receivers.md Outdated Show resolved Hide resolved
receiver/splunksearchapireceiver/config.go Outdated Show resolved Hide resolved
receiver/splunksearchapireceiver/config.go Outdated Show resolved Hide resolved

// wait for search to complete
for {
done, err := ssapir.isSearchCompleted(ssapir.config, searchID)
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like it would be wise to use a ticker approach if we're going to poll; this approach will likely be too much/overload their host if network/performance boxes are adequate/efficient.

I imagine we should have some kind of configurable job_completion_poll_interval perhaps? Know you're also working on pagination right now but do want to call out that this code needs to be refactored to not do the time.Sleeps

ssapir.logger.Info("search completed")
return nil
}
ssapir.logger.Info("search not completed yet")
Copy link
Contributor

Choose a reason for hiding this comment

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

This may bee too much for Info level; think we should use debug level for these

for {
select {
case <-t.C:
ssapir.logger.Info("polling for search completion")
Copy link
Contributor

Choose a reason for hiding this comment

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

Same thing for this one

logsConsumer: consumer,
config: ssapirConfig,
settings: params.TelemetrySettings,
wg: &sync.WaitGroup{},
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you have any plans for the waitgroup yet? Might be useful down the road but I think we should be careful with any async code for this receiver

Copy link
Author

Choose a reason for hiding this comment

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

Whoops, that was left over from copying the m365 ticker, shouldn't be necessary for this.

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.

3 participants