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

Add example listening for sigterm to docs (APMSP-15340) #2978

Merged
merged 3 commits into from
Nov 27, 2024

Conversation

ajgajg1134
Copy link
Contributor

What does this PR do?

Add an example so customers know they can listen for SIGTERM and shutdown the tracer to avoid lost data.
I debated adding more complexity here like enforcing a timeout, or supporting a context cancellation so this go routine doesn't just hang around forever but that seems like something that "can be left as an exercise to the reader" perhaps? If others feel strongly I'm happy to update this example to be more in depth though.

Motivation

See #2976 for some motivation, at some point we may attach this sort of listener automatically but there doesn't seem to be a clean way to do so currently without risking altering some customer application behavior.

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.

Unsure? Have a question? Request a review!

@pr-commenter
Copy link

pr-commenter bot commented Nov 13, 2024

Benchmarks

Benchmark execution time: 2024-11-13 20:08:55

Comparing candidate commit 6895d33 in PR branch andrew.glaude/sigNotifyDocs with baseline commit f28ac98 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 58 metrics, 1 unstable metrics.

@ajgajg1134 ajgajg1134 marked this pull request as ready for review November 13, 2024 20:13
@ajgajg1134 ajgajg1134 requested a review from a team as a code owner November 13, 2024 20:13
@ajgajg1134 ajgajg1134 changed the title Add example listening for sigterm to docs Add example listening for sigterm to docs (APMSP-15340) Nov 27, 2024
@darccio darccio enabled auto-merge (squash) November 27, 2024 15:54
@darccio darccio merged commit 0d0d008 into main Nov 27, 2024
159 of 160 checks passed
@darccio darccio deleted the andrew.glaude/sigNotifyDocs branch November 27, 2024 16:01
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