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

Decouple API from SDK #977

Merged
merged 11 commits into from
Jul 28, 2020
Merged

Conversation

MrAlias
Copy link
Contributor

@MrAlias MrAlias commented Jul 27, 2020

  • Remove all SDK dependencies from the API package (not including the instrumentation package).
    • Remove SDK benchmarks in the global package. When it makes sense (the metric SDK move the benchmark to the SDK).
    • Remove SDK benchmarks from the kv package. Instead test overhead of the package functions directly.
    • Use the api/trace/testtrace package instead of the SDK in the global/internal/trace_test.go tests.
  • Update the api/trace/testtrace package to include a Provider and extensible functionality in how it records spans.

@MrAlias MrAlias added pkg:API Related to an API package pkg:testing Related to testing or a testing package area:trace Part of OpenTelemetry tracing release:required-for-ga labels Jul 27, 2020
@MrAlias MrAlias self-assigned this Jul 27, 2020
Copy link
Contributor

@jmacd jmacd left a comment

Choose a reason for hiding this comment

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

That had to be tiresome! Thank you.
This will make testing API changes so much easier, not to have a cyclic dependency on the SDK.

@MrAlias MrAlias mentioned this pull request Jul 28, 2020
7 tasks
@lizthegrey
Copy link
Member

I assume after this we'll add a separate go.mod for api?

@MrAlias
Copy link
Contributor Author

MrAlias commented Jul 28, 2020

I assume after this we'll add a separate go.mod for api?

Sort of. The idea is to add a go.mod for the sdk/ subdirectory and have the API be the main entry point to go.opentelemetry.io/otel (#964). How the restructuring of the api package will look is still not 100% nailed down, but the separation of the SDK is the main goal (#940). Still need to resolve the instrumentation package issues prior to the new SDK package (https://github.com/open-telemetry/opentelemetry-go/issues/976, #974)

@MrAlias MrAlias merged commit 2833212 into open-telemetry:master Jul 28, 2020
@MrAlias MrAlias deleted the decouple-api-sdk branch July 28, 2020 17:47
@MrAlias MrAlias mentioned this pull request Jul 28, 2020
@lizthegrey
Copy link
Member

I assume after this we'll add a separate go.mod for api?

Sort of. The idea is to add a go.mod for the sdk/ subdirectory and have the API be the main entry point to go.opentelemetry.io/otel (#964). How the restructuring of the api package will look is still not 100% nailed down, but the separation of the SDK is the main goal (#940). Still need to resolve the instrumentation package issues prior to the new SDK package (#976, #974)

Ah, got it. I'd prefer that we go ahead and do that work before we cut another minor release version

// Create an http.Client that uses the othttp.Transport
// wrapped around the http.DefaultTransport
client := http.Client{
_ = http.Client{
Copy link
Member

Choose a reason for hiding this comment

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

This isn't a very useful example anymore, perhaps it would be best to simply delete it or move it into a README.md.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is going to be included in the godocs and I think it is a decent example of how to use it for a new users:

20200728_143741

Additionally, with it actually existing as Go code it is validated with the compiler resulting in valid code. This is something I noticed was not true in some other places where we tried to keep code in docs (1, 2, ...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That said, I'm not super tied to this example if we want to remove or expand it.

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 that does remain a decent example. Out of context it looks off, but I'm not against keeping it.

@MrAlias MrAlias mentioned this pull request Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:trace Part of OpenTelemetry tracing pkg:API Related to an API package pkg:testing Related to testing or a testing package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants