Skip to content

[configgrpc] modify optional fields to use configoptional.Optional#13252

Merged
mx-psi merged 6 commits into
open-telemetry:mainfrom
DataDog:jackgopack4/use-configoptional-in-configgrpc
Jul 8, 2025
Merged

[configgrpc] modify optional fields to use configoptional.Optional#13252
mx-psi merged 6 commits into
open-telemetry:mainfrom
DataDog:jackgopack4/use-configoptional-in-configgrpc

Conversation

@jackgopack4
Copy link
Copy Markdown
Contributor

Description

replace optional fields in configgrpc with configoptional.Optional

Link to tracking issue

Fixes #13250

Testing

updated existing tests

Documentation

Will add chloggen

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.50%. Comparing base (5079823) to head (bc3e5c6).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13252      +/-   ##
==========================================
- Coverage   91.53%   91.50%   -0.03%     
==========================================
  Files         526      526              
  Lines       29436    29436              
==========================================
- Hits        26944    26936       -8     
- Misses       1965     1971       +6     
- Partials      527      529       +2     

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

@jackgopack4 jackgopack4 marked this pull request as ready for review June 24, 2025 14:35
@jackgopack4 jackgopack4 requested a review from a team as a code owner June 24, 2025 14:35
@jackgopack4 jackgopack4 requested a review from bogdandrutu June 24, 2025 14:35
@mx-psi
Copy link
Copy Markdown
Member

mx-psi commented Jul 8, 2025

Needs make crosslink and addressing:

Error: receiver/otlpreceiver/config_test.go:166:6: func ptr is unused (unused)

@mx-psi
Copy link
Copy Markdown
Member

mx-psi commented Jul 8, 2025

I think you just need make gotidy

@mx-psi mx-psi added this pull request to the merge queue Jul 8, 2025
Merged via the queue into open-telemetry:main with commit 74cb2f3 Jul 8, 2025
52 of 56 checks passed
@mx-psi mx-psi deleted the jackgopack4/use-configoptional-in-configgrpc branch July 8, 2025 15:37
github-merge-queue Bot pushed a commit that referenced this pull request Jul 15, 2025
#13364)

… EnforcementPolicy to configoptional

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
converts `configgrpc.KeepaliveServerConfig.ServerParameters` and
`configgrpc.KeepaliveServerConfig.EnforcementPolicy` from pointers to
`configoptional` type
<!-- Issue number if applicable -->
#### Link to tracking issue
Fixes #13250 and follow-up to missed code in #13252 

<!--Describe what testing was performed and which tests were added.-->
#### Testing
existing unit/ci tests
<!--Describe the documentation added.-->
#### Documentation
update chloggen from #13252
<!--Please delete paragraphs that you did not use before submitting.-->
sky333999 added a commit to aws/amazon-cloudwatch-agent that referenced this pull request Feb 12, 2026
otlpreceiver.Config.GRPC and .HTTP are now configoptional.Optional[T]
initialized in the Default flavor by CreateDefaultConfig(). Default.Get()
returns nil, so the previous code using .Get() silently skipped endpoint
and TLS assignment.

Replaced .Get() with .GetOrInsertDefault() which promotes Default → Some
and returns a mutable pointer. Extracted TLS config into a shared variable
that defaults to None (zero value) when no cert/key files are provided.

Upstream PRs:
- open-telemetry/opentelemetry-collector#13044 (configoptional module)
- open-telemetry/opentelemetry-collector#13119 (otlpreceiver migration)
- open-telemetry/opentelemetry-collector#13252 (configgrpc TLS migration)
sky333999 added a commit to aws/amazon-cloudwatch-agent that referenced this pull request Feb 15, 2026
otlpreceiver.Config.GRPC and .HTTP are now configoptional.Optional[T]
initialized in the Default flavor by CreateDefaultConfig(). Default.Get()
returns nil, so the previous code using .Get() silently skipped endpoint
and TLS assignment.

Replaced .Get() with .GetOrInsertDefault() which promotes Default → Some
and returns a mutable pointer. Extracted TLS config into a shared variable
that defaults to None (zero value) when no cert/key files are provided.

Upstream PRs:
- open-telemetry/opentelemetry-collector#13044 (configoptional module)
- open-telemetry/opentelemetry-collector#13119 (otlpreceiver migration)
- open-telemetry/opentelemetry-collector#13252 (configgrpc TLS migration)
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.

[configgrpc] Implement configoptional.Optional for optional fields

3 participants