Skip to content
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

[config] add NewSDK func #4414

Merged
merged 8 commits into from Oct 20, 2023
Merged

Conversation

codeboten
Copy link
Contributor

@codeboten codeboten commented Oct 11, 2023

For now it's returning a noop tracer/meter provider if no configuration is found. Otherwise it returns an unconfigured SDK meter/tracer provider.

This PR is mostly to start putting the pieces together for the interface. For reviewers: I decided to go w/ passing in options rather than specific parameters into NewSDK.

Related to #4371

@codeboten codeboten requested a review from a team as a code owner October 11, 2023 16:54
@codecov
Copy link

codecov bot commented Oct 11, 2023

Codecov Report

Merging #4414 (0d7a16f) into main (488b204) will decrease coverage by 1.5%.
The diff coverage is 100.0%.

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #4414     +/-   ##
=======================================
- Coverage   82.3%   80.8%   -1.5%     
=======================================
  Files        144     148      +4     
  Lines      10019   10240    +221     
=======================================
+ Hits        8248    8283     +35     
- Misses      1633    1819    +186     
  Partials     138     138             
Files Coverage Δ
config/config.go 100.0% <100.0%> (ø)
config/metric.go 100.0% <100.0%> (ø)
config/trace.go 100.0% <100.0%> (ø)

... and 1 file with indirect coverage changes

Copy link
Member

@pellared pellared left a comment

Choose a reason for hiding this comment

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

Overall looks good 👍

config/config_test.go Show resolved Hide resolved
config/config_test.go Outdated Show resolved Hide resolved
config/config_test.go Outdated Show resolved Hide resolved
Comment on lines +67 to +74
// WithOpenTelemetryConfiguration sets the OpenTelemetryConfiguration used
// to produce the SDK.
func WithOpenTelemetryConfiguration(cfg OpenTelemetryConfiguration) ConfigurationOption {
return configurationOptionFunc(func(c configOptions) configOptions {
c.opentelemetryConfig = cfg
return c
})
}
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't cfg OpenTelemetryConfiguration be a required parameter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It could definitely be, i suppose not setting it would be useful for someone who wants a noop SDK... not sure if that's a realistic use-case, but i figured it would be easier to be consistent w/ all options.

Copy link
Member

Choose a reason for hiding this comment

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

i suppose not setting it would be useful for someone who wants a noop SDK...

Interesting use case. For me you can leave it as it is. You can resolve the comment or ask/wait for other opinions.

@pellared
Copy link
Member

Please add a changelog entry 😉

Alex Boten and others added 4 commits October 11, 2023 11:23
For now it's returning a noop tracer/meter provider if no configuration
is found. Otherwise it returns an unconfigured SDK meter/tracer provider.

This PR is mostly to start putting the pieces together for the interface.

Signed-off-by: Alex Boten <aboten@lightstep.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
Signed-off-by: Alex Boten <aboten@lightstep.com>
Signed-off-by: Alex Boten <aboten@lightstep.com>
@codeboten
Copy link
Contributor Author

The failing tests appear unrelated...

@pellared
Copy link
Member

The failing tests appear unrelated...

True. I created #4416

CHANGELOG.md Outdated Show resolved Hide resolved
@codeboten
Copy link
Contributor Author

Anything else needed for this PR before merging?

@pellared pellared merged commit 8918009 into open-telemetry:main Oct 20, 2023
21 of 22 checks passed
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.

None yet

3 participants