Skip to content

associated type Span, Tracer as short-hand, and *Protocol types #93

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
merged 12 commits into from
Mar 15, 2023

Conversation

ktoso
Copy link
Member

@ktoso ktoso commented Mar 15, 2023

Motivation:

This is a revival of #84
where we try to KEEP compatibility with versions below 5.7 with a
compatibility "legacy" tracer type, but otherwise move towards requiring
5.7 for all the "nice" apis that use associated types and any TracerProtocol and friends

Replaces #92

Modifications:

  • Tracer -> TracerProtocol
  • Tracer is now a namespace in order to Tracer.withSpan {} easily
  • Span -> SpanProtocol
  • Introduce LegacyTracerProtocol which does not make use of associated
    type Span, and can be used in 5.6 libraries; they can deprecate and
    move away form it ASAP as they start requiring 5.7

Result:

Offer the APIs we want in 5.7 but remain compatible with 5.6 until we
drop it as soon as 5.9 is released as stable - this allows us to adopt
eagerly in libraries without having to wait for 5.9 to drop.

ktoso added 7 commits March 13, 2023 22:08
**Motivation:**

This is a revival of
#84
where we try to KEEP compatibility with versions below 5.7 with a
compatibility "legacy" tracer type, but otherwise move towards requiring
5.7 for all the "nice" apis that use associated types and `any
  TracerProtocol` and friends

**Modifications:**

- `Tracer` -> `TracerProtocol`
- `Tracer` is now a namespace in order to `Tracer.withSpan {}` easily
- `Span` -> `SpanProtocol`
- Introduce `LegacyTracerProtocol` which does not make use of associated
  type Span, and can be used in 5.6 libraries; they can deprecate and
  move away form it ASAP as they start requiring 5.7

**Result:**

Offer the APIs we want in 5.7 but remain compatible with 5.6 until we
drop it as soon as 5.9 is released as stable - this allows us to adopt
eagerly in libraries without having to wait for 5.9 to drop.
@ktoso ktoso force-pushed the wip-towards-5.7-2 branch from 9d7a9c8 to afb07cf Compare March 15, 2023 05:58
@ktoso ktoso requested a review from slashmo March 15, 2023 05:59
Copy link
Contributor

@stevapple stevapple left a comment

Choose a reason for hiding this comment

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

Really clever solution!

README.md Outdated
@@ -261,7 +261,7 @@ When instrumenting server applications there are typically three parties involve

1. [Application developers](#application-developers-setting-up-instruments) creating server-side applications
2. [Library/Framework developers](#libraryframework-developers-instrumenting-your-software) providing building blocks to create these applications
3. [Instrument developers](#instrument-developers-creating-an-instrument) providing tools to collect distributed metadata about your application
3. [InstrumentProtocol developers](#instrument-developers-creating-an-instrument) providing tools to collect distributed metadata about your application
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, a batch rename mistake?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks yeah will clean it up

Copy link
Member

@FranzBusch FranzBusch left a comment

Choose a reason for hiding this comment

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

LGTM!

@ktoso
Copy link
Member Author

ktoso commented Mar 15, 2023

Pinged some folks for more review -- if you spot anything off please comment and I'll address in follow ups! 👍

@ktoso ktoso merged commit 7586bdc into main Mar 15, 2023
@ktoso ktoso deleted the wip-towards-5.7-2 branch March 15, 2023 10:19
@ktoso
Copy link
Member Author

ktoso commented Mar 15, 2023

Resolves #78

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.

4 participants