Skip to content

fix for armeria 1.40#11827

Open
vandonr wants to merge 2 commits into
masterfrom
vandonr/fix2
Open

fix for armeria 1.40#11827
vandonr wants to merge 2 commits into
masterfrom
vandonr/fix2

Conversation

@vandonr

@vandonr vandonr commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

armeria 1.40 adds an extra argument to instrumented (private) method ArmeriaClientCall.close, now takes a throwable as third arg.
Fixed by relaxing the constraint on takesArgument(2), replaced by a constraint on the type of the first 2 to keep it narrow enough.

Motivation

latest dep tests failed

Additional Notes

not sure if we should use that Throwable to set as error on the current span ?
Just changing the selector is enough to get the tests to pass so I think we should merge this as a quick fix, and reflect on this maybe later.

Contributor Checklist

  • Format the title according to the contribution guidelines
  • Assign the type: and (comp: or inst:) labels in addition to any other useful labels
  • Avoid using close, fix, or any linking keywords when referencing an issue
    Use solves instead, and assign the PR milestone to the issue
  • Update the CODEOWNERS file on source file addition, migration, or deletion
  • Update public documentation with any new configuration flags or behaviors
  • Add your completed PR to the merge queue by commenting /merge. You can also:
    • Customize the commit message associated with the merge with /merge --commit-message "..."
    • Remove your PR from the merge queue with /merge -c
    • Skip all merge queue checks with /merge -f --reason "reason"; please use this judiciously, as some checks do not run at the PR-level (note: the PR still needs to be mergeable, this will only skip the pre-merge build)
    • Get more information in this doc

Jira ticket: [PROJ-IDENT]

@vandonr vandonr requested review from a team as code owners July 1, 2026 11:46
@vandonr vandonr requested review from ValentinZakharov and removed request for a team July 1, 2026 11:46
@vandonr vandonr added type: bug Bug report and fix inst: armeria Armeria Instrumentation labels Jul 1, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cf18f6c445

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +63 to +66
named("close")
.and(isMethod())
.and(takesArgument(0, named("io.grpc.Status")))
.and(takesArgument(1, named("io.grpc.Metadata"))),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Defer span removal until Armeria actually closes

On Armeria 1.40 this matcher also instruments close(Status, Metadata, Throwable), but that method can now return immediately when this.closeCause != closeCause to ignore a transport close while an exception-handler close is still pending. Because CloseObserver removes the span on method enter and finishes it on exit, an ignored close can consume and finish the client span before the later real close runs, so calls that hit listener/deserialization errors or async exception handling lose the final gRPC status/error metadata. The advice needs to avoid removing/finishing the span until the Armeria close actually proceeds.

Useful? React with 👍 / 👎.

@datadog-official

datadog-official Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 55.01% (-0.03%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: fdbd9a1 | Docs | Datadog PR Page | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 13.98 s 14.02 s [-1.3%; +0.7%] (no difference)
startup:insecure-bank:tracing:Agent 12.88 s 13.01 s [-1.7%; -0.3%] (maybe better)
startup:petclinic:appsec:Agent 16.82 s 16.64 s [+0.1%; +2.1%] (maybe worse)
startup:petclinic:iast:Agent 16.35 s 16.99 s [-8.2%; +0.7%] (no difference)
startup:petclinic:profiling:Agent 16.79 s 16.92 s [-2.0%; +0.3%] (no difference)
startup:petclinic:sca:Agent 16.88 s 16.80 s [-0.4%; +1.4%] (no difference)
startup:petclinic:tracing:Agent 16.03 s 16.10 s [-1.5%; +0.5%] (no difference)

Commit: fdbd9a1e · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@vandonr vandonr left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@codex review

@Advice.OnMethodEnter
public static AgentScope before(@Advice.This ClientCall<?, ?> call) {
// could create a message span here for the request
AgentSpan span = InstrumentationContext.get(ClientCall.class, AgentSpan.class).get(call);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

compared to the "original" advice, we do a get here instead of a remove call (because we don't know yet if we're going to need to remove the span yet)

if (null != scope) {
if (closed) {
AgentSpan span =
InstrumentationContext.get(ClientCall.class, AgentSpan.class).remove(call);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the span is removed from the context here instead, once we can read the value of "closed"

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: fdbd9a1eeb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inst: armeria Armeria Instrumentation type: bug Bug report and fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant