Skip to content

Fix Ameria 1.40 instrumentation compatibility#11827

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
masterfrom
vandonr/fix2
Jul 2, 2026
Merged

Fix Ameria 1.40 instrumentation compatibility#11827
gh-worker-dd-mergequeue-cf854d[bot] merged 3 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 fix Bug 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.02% (-0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: f3d2126 | 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 14.04 s 13.96 s [-0.0%; +1.3%] (no difference)
startup:insecure-bank:tracing:Agent 12.98 s 13.06 s [-1.3%; +0.1%] (no difference)
startup:petclinic:appsec:Agent 16.90 s 16.58 s [+0.9%; +3.0%] (maybe worse)
startup:petclinic:iast:Agent 16.86 s 16.95 s [-1.3%; +0.3%] (no difference)
startup:petclinic:profiling:Agent 16.81 s 16.92 s [-1.5%; +0.3%] (no difference)
startup:petclinic:sca:Agent 16.90 s 16.02 s [+1.2%; +9.7%] (significantly worse)
startup:petclinic:tracing:Agent 16.06 s 15.56 s [-1.2%; +7.6%] (no difference)

Commit: f3d21268 · 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".

}

/**
* After armeria 1.40 and <a href="https://github.com/line/armeria/pull/6717">this PR</a>, it is

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this correct link?

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.

yes

@ValentinZakharov ValentinZakharov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@vandonr vandonr added this pull request to the merge queue Jul 2, 2026
@dd-octo-sts

dd-octo-sts Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Jul 2, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-07-02 09:30:54 UTC ℹ️ Start processing command /merge


2026-07-02 09:30:58 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 2h (p90).


2026-07-02 10:31:31 UTC ℹ️ MergeQueue: This merge request was merged

@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 2, 2026
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot merged commit 6a2f484 into master Jul 2, 2026
585 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot deleted the vandonr/fix2 branch July 2, 2026 10:31
@github-actions github-actions Bot added this to the 1.64.0 milestone Jul 2, 2026
@PerfectSlayer PerfectSlayer changed the title fix for armeria 1.40 Fix Ameria 1.40 instrumentation compatibility Jul 7, 2026
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 fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants