Skip to content

Conversation

@dmitryax
Copy link
Member

@dmitryax dmitryax commented Jan 5, 2026

Related to #14208

This change allows component authors to register one optional deprecated alias per component type, enabling smooth migrations when renaming components. When an alias is used in configuration, the collector will automatically resolve it to the original component and log a deprecation warning.

Changes:

  • Add WithDeprecatedTypeAlias factory option to experimental modules (xreceiver, xexporter, xprocessor, xconnector)
  • Generate alias expansion code in builder template that:
    • Populates factory maps with aliases pointing to original factories
    • Updates module information maps for aliased types
    • Validates that aliases don't conflict with existing component types
  • Add deprecation warnings that log when an alias is used: "Using deprecated alias ; use instead"

Extensions are left aside for now.

@dmitryax dmitryax requested review from a team, dmathieu and mx-psi as code owners January 5, 2026 02:32
@dmitryax dmitryax marked this pull request as draft January 5, 2026 05:47
@codecov
Copy link

codecov bot commented Jan 5, 2026

Codecov Report

❌ Patch coverage is 91.94631% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.20%. Comparing base (20802fb) to head (fcbda4d).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
connector/connector.go 36.84% 6 Missing and 6 partials ⚠️

❌ Your patch status has failed because the patch coverage (91.94%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14349      +/-   ##
==========================================
+ Coverage   92.19%   92.20%   +0.01%     
==========================================
  Files         669      670       +1     
  Lines       41383    41472      +89     
==========================================
+ Hits        38152    38239      +87     
- Misses       2194     2195       +1     
- Partials     1037     1038       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 6, 2026

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

✅ 62 untouched benchmarks
⏩ 20 skipped benchmarks1


Comparing dmitryax:component-aliases (fcbda4d) with main (20802fb)

Open in CodSpeed

Footnotes

  1. 20 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@dmitryax dmitryax force-pushed the component-aliases branch 5 times, most recently from 3dfb4ce to e63f0ca Compare January 6, 2026 05:15
@dmitryax dmitryax marked this pull request as ready for review January 6, 2026 05:18
@dmitryax dmitryax force-pushed the component-aliases branch 3 times, most recently from 8578ef4 to 220f2aa Compare January 6, 2026 05:52
@dmitryax dmitryax force-pushed the component-aliases branch 3 times, most recently from 774c6af to 11f8fdb Compare January 7, 2026 03:59
Copy link

@osullivandonal osullivandonal left a comment

Choose a reason for hiding this comment

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

2026-01-07T09:30:04.939Z	warn	builders/builders.go:40	"olddebug" alias is deprecated; use "debug" instead	{"resource": {"service.instance.id": "0868e402-b25d-4acf-a11d-ecbe8a431bac", "service.name": "otelcorecol", "service.version": "0.143.0-dev"}, "otelcol.component.id": "olddebug", "otelcol.component.kind": "exporter", "otelcol.signal": "logs"}

Verified locally 🚀

This change allows component authors to register one optional deprecated alias per component type, enabling smooth migrations when renaming components. When an alias is used in configuration, the collector will automatically resolve it to the original component and log a deprecation warning.

Changes:
- Add `WithDeprecatedTypeAlias` factory option to experimental modules (xreceiver, xexporter, xprocessor, xconnector)
- Add `DeprecatedAlias()` method to factory interfaces
- Generate alias expansion code in builder template that:
  - Populates factory maps with aliases pointing to original factories
  - Updates module information maps for aliased types
  - Validates that aliases don't conflict with existing component types
- Add deprecation warnings that log when an alias is used: "Using deprecated alias <alias>; use <original> instead"

Extensions are left aside for now.
@dmitryax dmitryax added this pull request to the merge queue Jan 8, 2026
Merged via the queue into open-telemetry:main with commit ae38f54 Jan 8, 2026
62 of 63 checks passed
@dmitryax dmitryax deleted the component-aliases branch January 8, 2026 00:21
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.

6 participants