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 spans around (pre)certificate signing #7707

Merged
merged 4 commits into from
Oct 2, 2024
Merged

Add spans around (pre)certificate signing #7707

merged 4 commits into from
Oct 2, 2024

Conversation

mcpherrinm
Copy link
Contributor

This adds custom spans around one of the more important parts of the issuance stack - actually signing the (pre)certificates. We only have automatic tracing right now, so this is just a small step towards adding more customization there.

One specific note: I didn't include the regID in the span attributes, though it is in the nearby log lines. I think that's something we likely want to handle holistically (eg, via baggage propagation) rather than one-off in manual spans like this.

@beautifulentropy beautifulentropy requested review from a team and jsha and removed request for a team September 23, 2024 22:15
Copy link
Contributor

@jsha jsha left a comment

Choose a reason for hiding this comment

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

Looks good, thanks.

@@ -272,6 +277,7 @@ func NewCertificateAuthorityImpl(
keyPolicy: keyPolicy,
log: logger,
metrics: metrics,
tracer: otel.GetTracerProvider().Tracer("github.com/letsencrypt/boulder/ca"),
Copy link
Contributor

Choose a reason for hiding this comment

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

https://pkg.go.dev/go.opentelemetry.io/otel/trace#TracerProvider

// The passed name needs to uniquely identify instrumentation code.
// Therefore, it is recommended that name is the Go package name of the
// library providing instrumentation (note: not the code being
// instrumented).

This is a little confusing - does "instrumentation code" here refer to otel? Surely not or it would be defaulted. I guess in our case, github.com/letsencrypt/boulder/ca is both the library providing instrumentation and the code being instrumented. 🤷🏻

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this distinction is only important in the case of, eg, a middleware adding instrumentation to something else. I think in this case it is instrumenting itself. I did a bit of a survey on Github to see what other projects are doing, and it does look like this is consistent with other packages instrumenting themselves.

@jsha jsha merged commit a731497 into main Oct 2, 2024
12 checks passed
@jsha jsha deleted the mattm-adding-spans branch October 2, 2024 19:00
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