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 span events for admission blocked/released events #242

Closed
wants to merge 1 commit into from

Conversation

jmacd
Copy link
Contributor

@jmacd jmacd commented Sep 4, 2024

Make a span event when a request is blocked by admission control.

(And whitespace changes: note this repo does not have go fmt checking, and at least one of our editors is formatting differently than go fmt does for me.)

@@ -85,8 +86,11 @@ func (bq *BoundedQueue) Acquire(ctx context.Context, pendingBytes int64) error {

bq.lock.Unlock()

trace.SpanFromContext(ctx).AddEvent("request blocked, pending bytes at limit")
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm why add instrumentation in this package directly instead of adding instrumentation in the calling code?

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 guess the calling code could unconditionally emit "requesting admission" and then "admission accepted" -- we would know the admission was blocked by the duration between these events. I thought that by instrumenting this package, we could limit the annotation to only the case where the request is blocked. Closed in favor of a different approach.

I've seen a span used to annotate the block

@jmacd jmacd closed this Sep 4, 2024
jmacd added a commit that referenced this pull request Sep 5, 2024
Alternative to #242
Allow us to monitor when requests are being blocked by admission limits.
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