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

Convert XConfigure into constructors #1155

Merged
merged 4 commits into from
Sep 10, 2020
Merged

Convert XConfigure into constructors #1155

merged 4 commits into from
Sep 10, 2020

Conversation

rakyll
Copy link
Contributor

@rakyll rakyll commented Sep 10, 2020

Previously, we discussed the possibility of converting
the config types into internal ones. But due to the
cyclic dependencies it introduces, we are only
converting XConfigure into constructors and document that
XConfig types are most likely are not going to be directly
used by developers.

By naming, it makes it clear the constructors are tightly
related to the config types and not yet another way
to configure the package. It should improve the mental overhead.

Fixes #1130.

Previously, we discussed the possibility of converting
the config types into internal ones. But due to the
cyclic dependencies it introduces, we are only
converting XConfigure into constructors and document that
XConfig types are most likely are not going to be directly
used by developers.

In package documents, constructors will be nicely listed
under the config types and they won't be yet another
standalone symbol developers need to learn about.

Fixes #1130.
@codecov
Copy link

codecov bot commented Sep 10, 2020

Codecov Report

Merging #1155 into master will decrease coverage by 0.3%.
The diff coverage is 100.0%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #1155     +/-   ##
========================================
- Coverage    78.0%   77.7%   -0.4%     
========================================
  Files         135     135             
  Lines        7124    7153     +29     
========================================
  Hits         5559    5559             
- Misses       1321    1350     +29     
  Partials      244     244             
Impacted Files Coverage Δ
api/trace/api.go 65.5% <100.0%> (ø)
api/trace/tracetest/mock_tracer.go 65.0% <100.0%> (ø)
api/trace/tracetest/provider.go 100.0% <100.0%> (ø)
api/trace/tracetest/span.go 96.1% <100.0%> (ø)
api/trace/tracetest/tracer.go 100.0% <100.0%> (ø)
bridge/opentracing/internal/mock.go 67.8% <100.0%> (ø)
sdk/trace/provider.go 91.7% <100.0%> (ø)
sdk/trace/span.go 92.2% <100.0%> (ø)
sdk/trace/tracer.go 100.0% <100.0%> (ø)
label/type_string.go 12.5% <0.0%> (-37.5%) ⬇️
... and 3 more

@Aneurysm9
Copy link
Member

Please provide a CHANGELOG.md entry documenting the change.

@rakyll
Copy link
Contributor Author

rakyll commented Sep 10, 2020

Added changes to the CHANGELOG, PTAL.

Copy link
Contributor

@MrAlias MrAlias left a comment

Choose a reason for hiding this comment

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

This naming seems to be in conflict with the existing style guide. However, based on what you pointed out about the grouping of this as a constructor for the related struct it seems like this is a better design. I think we need a follow-on issue to update to this if we all agree this is the prefered approach.

@MrAlias
Copy link
Contributor

MrAlias commented Sep 10, 2020

It seems like the existing *Configure naming also associates with the related specification in the docs:

20200910_091955

If we decide to move to this naming pattern it seems like it would be more motivated to align with the canonical Go approach.

@rakyll
Copy link
Contributor Author

rakyll commented Sep 10, 2020

@MrAlias, you are right. It's already aligning it -- the PR description need to be edited. I think due to the name, it looks like it's something else. If we want to go with this merge, it may improve that perception.

@rakyll
Copy link
Contributor Author

rakyll commented Sep 10, 2020

Updated the description.

@MrAlias MrAlias mentioned this pull request Sep 10, 2020
7 tasks
@MrAlias
Copy link
Contributor

MrAlias commented Sep 10, 2020

I think this is the correct direction. Opened #1160 to address the change.

@Aneurysm9 Aneurysm9 merged commit 9f45258 into open-telemetry:master Sep 10, 2020
@rakyll rakyll deleted the config branch September 14, 2020 22:40
MrAlias added a commit that referenced this pull request Sep 15, 2020
* Convert XConfigure into constructor for metrics

A follow up of #1155.

* Add to CHANGELOG

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
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.

Moving SpanConfig and TracerConfig to internal
4 participants