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: New bootstrap function #430

Merged
merged 3 commits into from
Dec 16, 2024
Merged

Conversation

nhhagen
Copy link
Member

@nhhagen nhhagen commented Nov 27, 2024

Bootstrap function that checks for the required configuration and return a
function to stop the Datadog integration.

Closes: #427

@nhhagen
Copy link
Member Author

nhhagen commented Nov 28, 2024

@bendiknesbo, @hadrienk and @hawi74 here is an early draft of the implementation.

So far the implementation:

  • returns a context, cancel func and error
  • official Datadog options is set though environment variables, the minimal config is validated if it is present.
  • our custom options have default with overloads from environmental variables and functional options, no functional options are implemented to override the options.

We should discuss if the are other ways of ensuring that we can guarantee that the stop functions are called other than returning a cancelable context and a cancel func.

I have not yet looked into metrics as I wanted to get this pattern right first, should we do metrics as a separate PR?

bootstrap2.go Outdated Show resolved Hide resolved
@nhhagen nhhagen force-pushed the new-bootstrap-2024-11-27-12-16-36 branch from fd34c50 to 16abe6f Compare November 28, 2024 22:39
@nhhagen nhhagen mentioned this pull request Nov 29, 2024
@nhhagen
Copy link
Member Author

nhhagen commented Nov 29, 2024

@bendiknesbo, @hadrienk, @hawi74 should we introduce metrics improvements in this PR?

Ref:

@nhhagen
Copy link
Member Author

nhhagen commented Nov 29, 2024

I have added an error handler as discussed in #433 (comment)

@nhhagen nhhagen force-pushed the new-bootstrap-2024-11-27-12-16-36 branch from d264342 to 79bfb06 Compare December 2, 2024 11:40
@nhhagen nhhagen marked this pull request as ready for review December 4, 2024 13:07
options.go Outdated Show resolved Hide resolved
AtzeDeVries
AtzeDeVries previously approved these changes Dec 4, 2024
bootstrap2.go Outdated Show resolved Hide resolved
@AtzeDeVries AtzeDeVries dismissed their stale review December 4, 2024 13:15

i was just commenting..

bootstrap2.go Outdated Show resolved Hide resolved
@nhhagen nhhagen force-pushed the new-bootstrap-2024-11-27-12-16-36 branch from e0b7ea2 to 2baf280 Compare December 6, 2024 08:01
bootstrap2.go Outdated Show resolved Hide resolved
@nhhagen nhhagen force-pushed the new-bootstrap-2024-11-27-12-16-36 branch 4 times, most recently from 1d5c8c3 to f3476f7 Compare December 16, 2024 11:13
bendiknesbo
bendiknesbo previously approved these changes Dec 16, 2024
go.mod Outdated Show resolved Hide resolved
Bootstrap function that checks for the required configuration and return a
function to stop the Datadog integration.

Closes: #427
@nhhagen nhhagen force-pushed the new-bootstrap-2024-11-27-12-16-36 branch from f3476f7 to 696bcf7 Compare December 16, 2024 12:20
bootstrap.go Show resolved Hide resolved
@nhhagen nhhagen force-pushed the new-bootstrap-2024-11-27-12-16-36 branch from 97e508a to 1448895 Compare December 16, 2024 12:40
docs/index.md Outdated Show resolved Hide resolved
@nhhagen nhhagen force-pushed the new-bootstrap-2024-11-27-12-16-36 branch from 1448895 to c8ea8db Compare December 16, 2024 12:43
bootstrap.go Show resolved Hide resolved
@nhhagen nhhagen dismissed arunpoudel’s stale review December 16, 2024 13:46

Change request is not applicable

@nhhagen nhhagen enabled auto-merge (squash) December 16, 2024 13:58
@nhhagen nhhagen disabled auto-merge December 16, 2024 13:58
@nhhagen nhhagen enabled auto-merge (squash) December 16, 2024 13:58
@nhhagen nhhagen merged commit 3c17e6b into main Dec 16, 2024
19 checks passed
@nhhagen nhhagen deleted the new-bootstrap-2024-11-27-12-16-36 branch December 16, 2024 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improved setup/start/bootstrap and teardown/shutdown functions
7 participants