Skip to content

Avoid using go embedded messages in Config #12718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

bogdandrutu
Copy link
Member

@bogdandrutu bogdandrutu commented Mar 24, 2025

This PR:

  • Helps with [confmap] Embedded structs fail to unmarshal #12709, to avoid the situation where we need to add Unmarshal for a struct and if used as embedded will not work.
  • Helps with avoiding name conflicts between variables. Will allow for example to have a "Timeout" member in both QueueConfig and ClientConfig, even though that was a valid YAML config since QueueConfig is under "seding_queue".
  • This is a breaking change only if devs are created manually the OTLP configs which should be very rare, and unfortunately this is hard to do using deprecation steps.

@bogdandrutu bogdandrutu requested a review from a team as a code owner March 24, 2025 19:07
@bogdandrutu bogdandrutu force-pushed the avoid-embedings-in-conifg branch 3 times, most recently from bdde9b4 to cf1a228 Compare March 24, 2025 19:23
@bogdandrutu bogdandrutu enabled auto-merge March 24, 2025 19:23
@bogdandrutu bogdandrutu force-pushed the avoid-embedings-in-conifg branch from cf1a228 to af2f840 Compare March 24, 2025 19:37
@bogdandrutu bogdandrutu force-pushed the avoid-embedings-in-conifg branch from af2f840 to 3ece557 Compare March 24, 2025 20:25
@bogdandrutu bogdandrutu force-pushed the avoid-embedings-in-conifg branch from 3ece557 to 61893b4 Compare March 24, 2025 20:29
@dmitryax
Copy link
Member

I guess, we should add this as a guideline in https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/coding-guidelines.md#configuration-structs

Copy link

codecov bot commented Mar 24, 2025

Codecov Report

Attention: Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.

Project coverage is 91.54%. Comparing base (abcee1f) to head (61893b4).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
receiver/otlpreceiver/otlp.go 0.00% 0 Missing and 1 partial ⚠️

❌ Your patch status has failed because the patch coverage (93.75%) 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   #12718   +/-   ##
=======================================
  Coverage   91.54%   91.54%           
=======================================
  Files         480      480           
  Lines       26456    26456           
=======================================
  Hits        24218    24218           
  Misses       1772     1772           
  Partials      466      466           

☔ 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.

@bogdandrutu bogdandrutu added this pull request to the merge queue Mar 24, 2025
Merged via the queue into open-telemetry:main with commit 58370e5 Mar 24, 2025
52 of 56 checks passed
@bogdandrutu bogdandrutu deleted the avoid-embedings-in-conifg branch March 24, 2025 21:14
dmitryax added a commit to dmitryax/opentelemetry-collector-contrib that referenced this pull request Mar 29, 2025
dmitryax added a commit to dmitryax/opentelemetry-collector-contrib that referenced this pull request Mar 31, 2025
- exporterhelper.QueueConfig -> exporterhelper.QueueBatchConfig
- Update exporter/alertmanager tests
- Address open-telemetry/opentelemetry-collector#12718
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants