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

Set up tracing as early as possible to capture initial traces #1561

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

RebeccaMahany
Copy link
Contributor

Create an initial trace buffer (plus tracer provider, etc) as soon as possible in runLauncher, before knapsack/osquery client are available. Transfer buffer and attrs to trace exporter once available.

@@ -73,6 +74,9 @@ const (
// rungroups with the various options, and goes! If autoupdate is
// enabled, the finalizers will trigger various restarts.
func runLauncher(ctx context.Context, cancel func(), multiSlogger, systemMultiSlogger *multislogger.MultiSlogger, opts *launcher.Options) error {
initialTraceBuffer := exporter.NewInitialTraceBuffer()
ctx, startupSpan := traces.StartSpan(ctx)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we name this span?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It automatically gets the name main.runLauncher, which I felt was good enough? But we could also:

  • add an attribute to this span that would "tag" it as a span of special interest
  • add a new function to the traces package to allow for starting a span with a specific name instead of the default namespace.function name

Let me know if you have a preference? Since you've approved, I'm going to merge, but I will have another PR up very shortly to add more child spans in this area for timing so I can make this change in that PR. 🙂

@RebeccaMahany RebeccaMahany added this pull request to the merge queue Jan 29, 2024
Merged via the queue into kolide:main with commit 26ed469 Jan 29, 2024
27 checks passed
@RebeccaMahany RebeccaMahany deleted the becca/startup-spans branch January 29, 2024 15:37
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.

None yet

3 participants