Skip to content

Update vendored ConfluentKafka instrumentation to 0.3.0-alpha.4 - #19319

Open
Sébastien Ros (sebastienros) wants to merge 8 commits into
mainfrom
sebros/update-kafka-otel-0-2
Open

Sébastien Ros (sebastienros) wants to merge 8 commits into
mainfrom
sebros/update-kafka-otel-0-2

Conversation

@sebastienros

@sebastienros Sébastien Ros (sebastienros) commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Description

Updates the vendored OpenTelemetry.Instrumentation.ConfluentKafka source from 0.1.0-alpha.2 to the latest published version, 0.3.0-alpha.4 (upstream commit 4cbaa1b137fc155a3f4ff62cfe034b78137a04eb). This adopts messaging semantic conventions v1.44.0, adds best-effort asynchronous cluster-ID enrichment, records consume-error telemetry, and includes the upstream fix that stops copying exception messages into span status descriptions.

This is a source-vendoring update. Aspire's OpenTelemetry NuGet dependencies remain unchanged. The fork preserves internal visibility, explicit instrumentation identity/schema, AOT-compatible property fetching, and the local fix that records completed empty/EOF poll durations without message counts or spans. Local cluster-ID adaptations defer discovery until a recorded span needs enrichment and prevent failed lookups from evicting replacement cache entries.

Related issue: N/A (dependency refresh and review follow-up).

Release target and documentation

Rebased onto current main and retargeted from release/17.0 to main for Aspire 17.0, a release that accepts breaking changes. This is a breaking telemetry change, not a compatible servicing update. The stable Aspire integration's telemetry contract is not exempt merely because the upstream instrumentation is alpha. Public .NET registration APIs, settings, and connection-string handling are unchanged.

The package README contains a brief 17.0 breaking-change notice. Detailed release notes and Kafka telemetry migration guidance belong on aspire.dev, maintained in microsoft/aspire.dev, rather than in a separate migration document in this repository. The vendoring README and internal telemetry inventory remain accurate. No companion aspire.dev documentation PR is linked yet.

  • Document the Kafka telemetry breaking changes and migration guidance on aspire.dev before the 17.0 release.

Breaking telemetry changes

The default OpenTelemetry.Instrumentation.ConfluentKafka meter replaces messaging.publish.duration and messaging.receive.duration with messaging.client.operation.duration; filter messaging.operation.name=send or poll to retain separate latency distributions. Message counters become messaging.client.sent.messages and messaging.client.consumed.messages.

Attributes change to messaging.client.id, messaging.operation.name/.type, messaging.consumer.group.name, string messaging.destination.partition.id, and messaging.kafka.offset. Producer spans become send <topic>, receive spans become poll <topic> with Client kind, and processing spans become process <topic>. Detailed mappings and query guidance should be included in the companion aspire.dev documentation.

The legacy Aspire.Confluent.Kafka statistics meter keeps its existing schema, including messaging.publish.messages, messaging.receive.messages, messaging.client_id, tags, and units. Its librdkafka broker-traffic statistics must not be relabeled as modern send-attempt/application-delivery counters or summed with them. EnableAspire8ConfluentKafkaMetrics enables this additional meter; it does not restore the old default duration histograms or span schema.

Latest upstream releases

  • 0.3.0-alpha.4 (2026-Oct-21): upstream OpenTelemetry core dependency update to 1.20.1.
  • 0.3.0-alpha.3 (2026-Oct-15): upstream OpenTelemetry core dependency update to 1.20.0.
  • 0.3.0-alpha.2 (2026-Sep-18): removes unsanitized exception messages from Kafka span status descriptions; upstream OpenTelemetry core dependency update to 1.19.0.
  • 0.3.0-alpha.1: messaging conventions v1.44.0 and messaging.kafka.cluster.id span enrichment.

Only vendored source changes are adopted; the upstream package's dependency version bumps are not applied globally. Full upstream changelog.

Review follow-up

  • Keeps a minimal user-facing README notice, leaves detailed migration/release documentation to aspire.dev, and preserves the legacy statistics schema to address the statistics-versus-delivery semantic mismatch noted in review.
  • Retains separate send/poll histogram assertions, topic-isolated thread-safe trace capture, and completed-empty-poll coverage.
  • Adds error-status regressions for all producer and consumer overloads and message-handler failures. Error status and error.type remain, exceptions propagate, and status descriptions are empty.
  • Removes failed cluster-ID cache entries by matching key/task pair so stale waiters cannot evict pending or successful replacement tasks; regression coverage also verifies retries after a failed lookup.
  • Starts cluster discovery lazily only for recorded span enrichment, not at producer/consumer construction or during tracing-disabled operations. Tracing can still be enabled after construction, and processing spans honor the tracing opt-out.
  • Preserves the destination branch's SQLite filtering refactor and verifies modern attributes, legacy fallback, and new-over-old precedence.

Validation

Validated the Kafka review fixes at commit 2afc67496406616f7b88c1eedeeb57a1315affc8 on macOS ARM64, based on main commit 318bf5294a3402a58de23ea0468dfc790d47f4fe. These results supersede the older .NET 8/9/10 reports; current main targets .NET 10/11. The targeted cache/discovery regressions failed in all 16 cases before the fixes; the expanded instrumentation class passes all 46 cases afterward.

Kafka: passed, 370 tests, 12 existing unsupported-tracing skips, zero failures across net10.0 and net11.0. Includes real Docker brokers, keyed/unkeyed registrations, exact message-counter values and units, separate send/poll histogram samples, cluster IDs, schema metadata, legacy statistics, empty/EOF polls, cancellation, errors, stale cache waiters, and deferred discovery for both clients and all producer/consumer overloads.

MSBUILDTERMINALLOGGER=false dotnet test --project "$PWD/tests/Aspire.Confluent.Kafka.Tests/Aspire.Confluent.Kafka.Tests.csproj" --no-launch-profile -- --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'

Dashboard: passed, 11 tests, zero failures at commit 3df5b6ccf221d8879163c2b12902aeafe9a28b9a, including modern/legacy messaging summaries and SQLite text filtering. No Dashboard code has changed in subsequent commits, so these tests were not rerun for the cluster-discovery fixes. Restore emits the existing NU1903 advisory for Microsoft.DotNet.ILCompiler 11.0.0-rc.2.26504.105; this PR does not change that dependency.

MSBUILDTERMINALLOGGER=false dotnet test --project "$PWD/tests/Aspire.Dashboard.Tests/Aspire.Dashboard.Tests.csproj" --no-launch-profile -- --filter-method 'Aspire.Dashboard.Tests.TelemetryRepositoryTests.OtlpSpanTests.*' --filter-method '*.GetSpans_FilterByTextFragments_MatchesDisplaySummaries' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'

Package/API compatibility: passed against baseline 13.6.2, zero warnings/errors, rerun after the cluster-discovery fixes. Forced uncached validation during Pack; APICompat reported no breaking .NET APIs. Current main's existing exclusions ignore baseline net8.0/net9.0 assets; this PR does not change framework support.

apiCompatDir="$(mktemp -d)"
MSBUILDTERMINALLOGGER=false dotnet pack src/Components/Aspire.Confluent.Kafka/Aspire.Confluent.Kafka.csproj -c Debug --no-build --no-restore /p:_ApiCompatValidatePackageSemaphoreFile="$apiCompatDir/validation.semaphore" /v:normal
test -f "$apiCompatDir/validation.semaphore"
rm "$apiCompatDir/validation.semaphore"
rmdir "$apiCompatDir"

Compared every included vendor source with the exact upstream release and confirmed the documented adaptations; shared Guard.cs and SemanticConventions.cs match exactly. Windows/Linux runs and browser-level Dashboard rendering were not performed.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Copilot AI balanced review requested due to automatic review settings August 12, 2026 23:08
@sebastienros Sébastien Ros (sebastienros) added the breaking-change Issue or PR that represents a breaking API or functional change over a prerelease. label Aug 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 19319

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 19319"

@github-actions

This comment has been minimized.

Copilot AI 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.

Pull request overview

Updates vendored Confluent Kafka instrumentation to 0.2.0-alpha.2 and OpenTelemetry messaging conventions v1.43.

Changes:

  • Updates Kafka spans, metrics, attributes, and exception telemetry.
  • Aligns Aspire’s legacy Kafka meter with renamed signals.
  • Updates tests, telemetry documentation, and vendoring instructions.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/Aspire.Confluent.Kafka.Tests/OtelTracesTests.cs Verifies renamed spans and kinds.
tests/Aspire.Confluent.Kafka.Tests/OtelMetricsTests.cs Verifies new metric names.
tests/Aspire.Confluent.Kafka.Tests/Aspire8MetricsTests.cs Updates legacy metric assertions.
src/Vendoring/README.md Updates the vendored version and adaptations.
src/Vendoring/OpenTelemetry.Instrumentation.ConfluentKafka/TracerProviderBuilderExtensions.Producer.cs Registers the producer activity source.
src/Vendoring/OpenTelemetry.Instrumentation.ConfluentKafka/TracerProviderBuilderExtensions.Consumer.cs Registers the consumer activity source.
src/Vendoring/OpenTelemetry.Instrumentation.ConfluentKafka/Shared/SemanticConventions.cs Updates semantic-convention constants.
src/Vendoring/OpenTelemetry.Instrumentation.ConfluentKafka/Shared/Guard.cs Synchronizes validation helpers.
src/Vendoring/OpenTelemetry.Instrumentation.ConfluentKafka/OpenTelemetryConsumeResultExtensions.cs Updates process-span behavior.
src/Vendoring/OpenTelemetry.Instrumentation.ConfluentKafka/MeterProviderBuilderExtensions.Producer.cs Registers the producer meter.
src/Vendoring/OpenTelemetry.Instrumentation.ConfluentKafka/MeterProviderBuilderExtensions.Consumer.cs Registers the consumer meter.
src/Vendoring/OpenTelemetry.Instrumentation.ConfluentKafka/InstrumentedProducer.cs Updates producer telemetry.
src/Vendoring/OpenTelemetry.Instrumentation.ConfluentKafka/InstrumentedConsumerBuilder.cs Synchronizes consumer construction.
src/Vendoring/OpenTelemetry.Instrumentation.ConfluentKafka/InstrumentedConsumer.cs Updates consumer and exception telemetry.
src/Vendoring/OpenTelemetry.Instrumentation.ConfluentKafka/ConfluentKafkaInstrumentedProducerBuilderOptions.cs Adds producer builder options.
src/Vendoring/OpenTelemetry.Instrumentation.ConfluentKafka/ConfluentKafkaInstrumentedConsumerBuilderOptions.cs Adds consumer builder options.
src/Vendoring/OpenTelemetry.Instrumentation.ConfluentKafka/ConfluentKafkaCommon.cs Defines instrumentation identity and instruments.
src/Components/Telemetry.md Documents renamed Kafka metrics.
src/Components/Aspire.Confluent.Kafka/ConfluentKafkaMetrics.cs Renames legacy metrics and client tag.

Copilot AI review requested due to automatic review settings August 13, 2026 00:15
@github-actions

This comment has been minimized.

Copilot AI 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.

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated no new comments.

Suppressed comments (2)

src/Components/Aspire.Confluent.Kafka/ConfluentKafkaMetrics.cs:59

  • These names do not match the underlying librdkafka statistics. txmsgs/rxmsgs count messages transmitted to or consumed from brokers, while the v1.43 metrics represent producer send attempts and deliveries to the application. Queued or failed sends and prefetched-but-undelivered records therefore make this legacy meter disagree with the vendored meter for the same metric names. Keep the statistics under custom names, or emit these semantic-convention counters from the producer/consumer operation paths instead.
        public const string TxMessages = "messaging.client.sent.messages";
        public const string TxMessageBytes = "messaging.kafka.message.transmitted";
        public const string RxMessages = "messaging.client.consumed.messages";

tests/Aspire.Confluent.Kafka.Tests/OtelInstrumentationTests.cs:15

  • This new class can run in parallel with OtelTracesTests and OtelMetricsTests, although all three attach exporters to the same static Kafka ActivitySource/Meter. Telemetry emitted here can consequently enter another test's exporter (and its unsynchronized List), causing count assertions such as Assert.Equal(5, activities.Count) to fail nondeterministically. Put all Kafka telemetry tests in one serialized collection or otherwise disable parallel execution between them.
public class OtelInstrumentationTests

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

This comment has been minimized.

Copilot AI 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.

Pull request overview

Copilot reviewed 24 out of 24 changed files in this pull request and generated no new comments.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@adamint Adam Ratzman (adamint) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you take a look at these? I think they need to be fixed before merging.

@martincostello

Copy link
Copy Markdown
Contributor

FYI we shipped 0.3.0-alpha.1 last week.

@github-actions
github-actions Bot requested a balanced review from Copilot September 9, 2026 19:45
@sebastienros

Sébastien Ros (sebastienros) commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Local validation of Aspire PR #19319

Latest update: 0.3.0-alpha.1

Committed and pushed as ee2c106814f8db521d9c7b855f8f632dcafdaed6, incorporating the release mentioned in the upstream-version comment.

  • Vendored source matches release tag Instrumentation.ConfluentKafka-0.3.0-alpha.1 (upstream commit 1df0046ddc8ec4373d48f3efc2fcf9f5f3faf4c9), apart from the documented Aspire adaptations. The empty-poll fix is preserved.
  • Instrumentation version is now 0.3.0.0; the exported trace and metric schema is https://opentelemetry.io/schemas/1.44.0.
  • Real-broker tests verify messaging.kafka.cluster.id on send, poll, and process spans against the broker's independently queried cluster ID. They cover synchronous/asynchronous production and keyed/unkeyed registration, and verify message payloads and ordering.
  • Cluster discovery is asynchronous and best-effort. The attribute is only attached after discovery succeeds; it can be absent on early spans or when discovery fails.
  • Full Kafka suite on .NET 8/9/10: 516 passed, 18 existing skips, 0 failures. The focused telemetry run also passed all 42 cases.
  • Fresh package/API compatibility validation passed against the repository's 13.4.6 baseline, with 0 warnings/errors.
  • The new bounded trace test initially exposed interference from reused consumer groups; unique groups now isolate both metrics and trace tests on the shared broker.
  • This is a source-vendoring update, not an upgrade of Aspire's OpenTelemetry NuGet dependencies. It builds and runs with the repository's current dependency versions.

The 0.3 update adds cluster-ID enrichment and updates schema metadata without further metric renames relative to 0.2. The telemetry migration warning below still applies to the PR as a whole.

Evidence for this update: kafka-030-telemetry-isolated.log, kafka-030-full-validation.log, and kafka-030-package-validation.log. Executed on macOS ARM64; Windows/Linux and browser-level Dashboard rendering were not rerun. The earlier standalone smoke captures and Dashboard results below belong to the 0.2-based commit, not the upgraded commit.


Earlier validation: 0.2.0-alpha.2 plus review fixes

Result: Functional and API compatibility validation passed. Telemetry backward compatibility does not hold: this PR intentionally replaces metric names, attributes, and span conventions.

Tested state

  • Tested source is now committed and pushed as 3b913fb2718351db25054004bacf72733c590166, on top of PR head 5084334ca20fa32e70fb7f6427a05d81e46a5816.
  • Tested on macOS ARM64 on September 9, 2026, including all review fixes in that commit.
  • Used locally compiled source rather than dogfood CLI artifacts.

Review fixes included

  • Completed empty and partition-EOF polls record operation duration without creating message counts or spans; cancellation remains excluded.
  • Trace assertions use thread-safe capture and unique-topic filtering.
  • Send and poll histogram samples are asserted independently.
  • Regression coverage includes empty/EOF polls, disabled metrics, cancellation, and consume exceptions across all three consumer overloads.

Validation results

Validation Result
Complete Kafka suite on .NET 8, 9, and 10 516 passed, 18 existing unsupported-tracing conformance skips, 0 failures
Dashboard span-summary and waterfall-filter regressions 53 passed
Package creation and fresh API compatibility validation Passed against the repository's 13.4.6 baseline, 0 warnings/errors
Independent real-Kafka smoke: default metrics Passed
Independent real-Kafka smoke: Aspire 8 statistics opt-in Passed
Independent real-Kafka smoke: DisableMetrics with legacy opt-in enabled Passed; neither meter emitted measurements

The smoke application used public client-registration APIs and the repository's real Kafka broker fixture. It exercised both synchronous Produce and ProduceAsync, successful consumption, partition EOF, null/timeouts, cancellation, and a real deserialization failure.

Observed metrics

For one topic, the application sent three messages using Produce and two using ProduceAsync, then consumed all five with their payloads and order preserved:

Signal Observed
messaging.client.sent.messages 5, unit {message}
messaging.client.consumed.messages 5, unit {message}
messaging.client.operation.duration, operation send 5 histogram samples, unit s
Same histogram, operation poll 8 samples: 5 messages, 1 partition EOF, 2 empty timeouts

The two 120 ms empty polls contributed about 0.243 seconds. Total recorded poll duration was about 1.292 seconds versus about 1.299 seconds measured around the calls. Cancellation did not add a successful poll measurement.

A separate message deliberately failed value deserialization. Its consumer emitted one duration sample and one consumed-record count, both tagged error.type=Local_ValueDeserialization.

Verified:

  • Exported schema URL: https://opentelemetry.io/schemas/1.43.0.
  • Instrumentation version: 0.2.0.0.
  • messaging.system=kafka, separate operation name/type, consumer-group attributes, and string partition IDs.
  • Histogram boundaries: 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 seconds, plus infinity.
  • Legacy statistics meter remains opt-in. It reported six transmitted messages across the successful and failing-deserialization topics, and five successfully consumed messages for the main consumer, with the expected units and operation attributes.

The legacy statistics counters and modern instrumentation counters retain their distinct meanings around deserialization failures; they should not be summed together without considering instrumentation scope.

Backward compatibility

Public registration APIs, settings, configuration schema, and connection-string handling are unchanged from the PR merge base. Package API compatibility passed against 13.4.6. Dashboard summary parsing and filtering accept both the old and new messaging-operation attributes, with the new attribute taking precedence.

However, existing telemetry dashboards, alerts, and queries require migration:

Previous signal Replacement
messaging.publish.duration / messaging.receive.duration messaging.client.operation.duration, distinguished by operation attributes
messaging.publish.messages messaging.client.sent.messages
messaging.receive.messages messaging.client.consumed.messages
messaging.client_id messaging.client.id
messaging.operation messaging.operation.name and messaging.operation.type
messaging.kafka.consumer.group messaging.consumer.group.name
Numeric messaging.kafka.destination.partition String messaging.destination.partition.id
messaging.kafka.message.offset messaging.kafka.offset

Producer spans change from <topic> publish to send <topic>. Receive spans change from <topic> receive with Consumer kind to poll <topic> with Client kind. Message keys now use supported canonical string representations.

The EnableAspire8ConfluentKafkaMetrics switch does not preserve the previous telemetry schema. The legacy Aspire.Confluent.Kafka meter also changes its message-counter names and client-ID attribute. No aliases for the previous names are emitted.

If zero telemetry breaking changes are required, the PR does not meet that requirement. A compatibility mode preserving the old instruments/attributes would be needed, especially for the legacy opt-in meter. Otherwise, the documented migration must be accepted.

Scope and evidence

  • Validation ran before committing; the pushed commit contains the same validated source and review fixes.
  • Executed on macOS ARM64; Windows/Linux runs and browser-level Dashboard rendering were not performed.
  • No repository source changes were made during this validation pass.
  • Temporary smoke application and its Kafka containers were cleaned up.
  • Retained local evidence: kafka-full-validation.log, kafka-dashboard-validation.log, kafka-api-compat.log, and kafka-metrics-default.json, kafka-metrics-legacy.json, kafka-metrics-disabled.json.

@martincostello

Copy link
Copy Markdown
Contributor

FYI we shipped 0.3.0-alpha.2 this week, which contains some specific changes to this instrumentation.

@maddymontaquila
Maddy Montaquila (maddymontaquila) changed the base branch from release/14.0 to release/17.0 September 28, 2026 23:24
@maddymontaquila
Maddy Montaquila (maddymontaquila) changed the base branch from release/17.0 to release/14.0 September 28, 2026 23:26
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 908e2f89-e34c-451e-bb4e-d239dd7b566c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 908e2f89-e34c-451e-bb4e-d239dd7b566c
Record duration for completed empty and EOF polls without counting messages or creating spans. Cover cancellation and consume failures, isolate trace capture by topic, and assert send and poll histograms independently.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sync the tagged upstream source and shared helpers, preserving Aspire adaptations. Add cluster ID span enrichment and v1.44.0 schema metadata, with real-broker coverage and isolated consumer groups.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve the Aspire 8 statistics schema instead of applying application-delivery metric names to broker statistics. Include the upstream error-status fix, regression coverage, and a user-facing breaking-change release note and migration guide.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@sebastienros
Sébastien Ros (sebastienros) changed the base branch from release/17.0 to main November 4, 2026 20:31
@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot November 4, 2026 20:31
@sebastienros Sébastien Ros (sebastienros) changed the title Update vendored ConfluentKafka instrumentation to 0.3.0-alpha.1 Update vendored ConfluentKafka instrumentation to 0.3.0-alpha.4 Nov 4, 2026
@github-actions

This comment has been minimized.

Leave detailed breaking-change and migration guidance to aspire.dev while retaining a concise README notice and accurate telemetry inventory.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI 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.

🟡 Changes recommended

Active issues allow failed discovery continuations to evict newer cache entries and trigger unnecessary cluster discovery when tracing is disabled for producers and consumers.

2 open issues
1 resolved since last review

Review effort: Balanced

@github-actions

This comment has been minimized.

Copilot AI 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.

🟢 Approval recommended

There are no active review issues blocking the Kafka instrumentation update.

2 open issues

Review effort: Balanced

Start discovery only when a recorded span needs enrichment, retain tracing enablement after client construction, and respect tracing opt-out for message processing. Remove failed cache entries by key/task pair so stale waiters cannot evict newer lookups.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Tests selector

15 / 101 PR test projects · 2 PR jobs, from 26 changed files.

Selected PR test projects (15 / 101)

Aspire.Confluent.Kafka.Tests, Aspire.Dashboard.Components.Tests, Aspire.Dashboard.Tests, Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Tests, Aspire.Hosting.Blazor.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Hosting.DotnetTool.Tests, Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Kafka.Tests, Aspire.Hosting.Radius.Tests, Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Playground.Tests, Aspire.Templates.Tests

Selected PR jobs (2)

extension-e2e, native-dashboard-validation


How these were chosen — grouped by what changed

⚠️ 11 of the 15 selected test projects come from a single change — src/Aspire.Dashboard/Otlp/Model/OtlpSpan.cs.

🔧 src/Aspire.Dashboard/Otlp/Model/OtlpSpan.cs (changed source)
→ 11 via the project graph: Aspire.Dashboard.Components.Tests, Aspire.Hosting.Azure.Kubernetes.Tests (3 hops), Aspire.Hosting.Azure.Tests (2 hops), Aspire.Hosting.Blazor.Tests (2 hops), Aspire.Hosting.Dotnet.Tests (2 hops), Aspire.Hosting.DotnetTool.Tests (2 hops), Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Radius.Tests (2 hops), Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Playground.Tests (2 hops)

🔧 src/Components/Aspire.Confluent.Kafka/AssemblyInfo.cs (changed source)
→ 1 directly: Aspire.Confluent.Kafka.Tests
→ 1 via the project graph: Aspire.Hosting.Kafka.Tests

📦 affected project Aspire.Dashboard
→ 1 test: Aspire.Templates.Tests

🔧 src/Components/Aspire.Confluent.Kafka/ConfluentKafkaMetrics.cs (changed source)
→ 1 directly: Aspire.Confluent.Kafka.Tests

🧪 tests/Aspire.Confluent.Kafka.Tests/Aspire8MetricsTests.cs (changed test)
→ 1 directly: Aspire.Confluent.Kafka.Tests

🧪 tests/Aspire.Confluent.Kafka.Tests/OtelInstrumentationTests.cs (changed test)
→ 1 directly: Aspire.Confluent.Kafka.Tests

🧪 tests/Aspire.Confluent.Kafka.Tests/OtelMetricsTests.cs (changed test)
→ 1 directly: Aspire.Confluent.Kafka.Tests

🧪 tests/Aspire.Confluent.Kafka.Tests/OtelTracesTests.cs (changed test)
→ 1 directly: Aspire.Confluent.Kafka.Tests

🧪 tests/Aspire.Confluent.Kafka.Tests/TestServices/FakeKafkaConsumer.cs (changed test)
→ 1 directly: Aspire.Confluent.Kafka.Tests

🧪 tests/Aspire.Confluent.Kafka.Tests/TestServices/FakeKafkaProducer.cs (changed test)
→ 1 directly: Aspire.Confluent.Kafka.Tests

🧪 tests/Aspire.Confluent.Kafka.Tests/TestServices/MetricTestHelpers.cs (changed test)
→ 1 directly: Aspire.Confluent.Kafka.Tests

🧪 tests/Aspire.Confluent.Kafka.Tests/TestServices/TestActivityExporter.cs (changed test)
→ 1 directly: Aspire.Confluent.Kafka.Tests

🧪 tests/Aspire.Dashboard.Tests/TelemetryRepositoryTests/OtlpSpanTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

🧪 tests/Aspire.Dashboard.Tests/TelemetryRepositoryTests/TraceTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

Job reasons

Job Triggered by
extension-e2e • src/Aspire.Dashboard/Otlp/Model/OtlpSpan.cs
• affected project Aspire.Dashboard
native-dashboard-validation affected project Aspire.Dashboard

Selection computed for commit 2afc674.

Copilot AI 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.

🔵 Needs a closer look

Human review is needed because current tests would miss regressions in producer error labeling when metrics are enabled without tracing.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

{
var messagingSystem = OtlpHelpers.GetValue(span.Attributes, "messaging.system");
var messagingOperation = OtlpHelpers.GetValue(span.Attributes, "messaging.operation");
var messagingOperation = span.Attributes.GetValueWithFallback("messaging.operation.name", "messaging.operation");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

do we need this? shouldn't we just follow the standards?

Comment on lines +57 to +58
// Keep the Aspire 8 schema: librdkafka txmsgs/rxmsgs count broker traffic,
// not producer send attempts or messages delivered at the Consume boundary.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this the right thing to do?

This branch has not been deployed

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

Labels

area-integrations Issues pertaining to Aspire Integrations packages breaking-change Issue or PR that represents a breaking API or functional change over a prerelease.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants