Skip to content

fix(otel): preserve configured service name - #593

Open
zhongkechen wants to merge 2 commits into
mainfrom
codex/preserve-otel-service-name
Open

fix(otel): preserve configured service name#593
zhongkechen wants to merge 2 commits into
mainfrom
codex/preserve-otel-service-name

Conversation

@zhongkechen

@zhongkechen zhongkechen commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • stop ExecutionOtelPlugin from overriding the caller-configured OpenTelemetry resource service.name
  • keep service identity owned by application/provider configuration, matching InvocationOtelPlugin, Python, and TypeScript
  • verify workflow and invocation spans retain the configured resource service name

Testing

  • mvn -pl otel-plugin test (145 tests)
  • mvn -pl otel-plugin spotless:apply
  • git diff --check

Related change

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@zhongkechen
zhongkechen deployed to ai-pr-review August 4, 2026 23:46 — with GitHub Actions Active
@zhongkechen
zhongkechen temporarily deployed to ai-pr-review-runtime August 4, 2026 23:46 — with GitHub Actions Inactive
@zhongkechen
zhongkechen temporarily deployed to ai-pr-review-runtime August 4, 2026 23:46 — with GitHub Actions Inactive
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@zhongkechen
zhongkechen marked this pull request as ready for review August 4, 2026 23:51
@zhongkechen
zhongkechen requested a review from a team August 4, 2026 23:51
@zhongkechen
zhongkechen deployed to ai-pr-review-runtime August 4, 2026 23:51 — with GitHub Actions Active
@zhongkechen
zhongkechen temporarily deployed to ai-pr-review-runtime August 4, 2026 23:51 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Claude AI review

I reviewed the complete SHA-anchored diff (ExecutionOtelPlugin.java and ExecutionOtelPluginTest.java) plus the surrounding code. This is a small, correct, well-scoped fix.

Change: removes the plugin-forced service.name=workflow resource override in ExecutionOtelPlugin so the caller/provider-configured OTel resource service.name is preserved.

  • Previously tracerProviderBuilder.addResource(...) merged in service.name=workflow; OTel resource-merge semantics let the added resource win, clobbering caller config. Removing it correctly hands service identity to application/provider config, matching InvocationOtelPlugin (which never sets service.name) and the stated Python/TS parity.
  • Import removals (Attributes, Resource, ServiceAttributes) and the SERVICE_NAME constant are removed cleanly; grep confirms no remaining references in the module — no dangling symbols or unused-import compile break.
  • Renamed test spans_preserveConfiguredServiceName configures a resource via setResource(...) and asserts every finished span retains the configured value, correctly inverting the old assertion.

No correctness, replay-semantics, concurrency, lifecycle, or serialization regressions. No blocking findings.

Residual test risk (non-blocking, not on changed lines):

  • Test only covers the case where a caller does configure service.name. The default path (no resource configured) — where spans now fall back to OTel's unknown_service:java instead of workflow — is untested. The behavior change is intentional but any downstream grouping that relied on the old workflow node is affected.
  • otel-plugin/pom.xml still declares io.opentelemetry:opentelemetry-semconv, which appears to become unused after this change (its only symbol usage was the removed import). Candidate for follow-up cleanup; the file is outside this diff.

Reviewed commit 00b8aff28bf25dec4ee099ccb696c2d538f3f371. Workflow run

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codex AI review

No actionable findings.

Residual risk: tests were not run due to the read-only review constraint; the added unit test directly covers configured service.name preservation.

Reviewed commit 00b8aff28bf25dec4ee099ccb696c2d538f3f371. Workflow run

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.

1 participant