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

Documentation with latest guidance, and adjust types accordingly #69

Closed
wants to merge 17 commits into from

Conversation

ktoso
Copy link
Member

@ktoso ktoso commented Nov 3, 2022

Work in progress


Revamp the docs and do the final renames before heading towards 1.0

Resolves #80

@slashmo
Copy link
Contributor

slashmo commented Nov 3, 2022

@ktoso Thanks for getting this started 🙏 I really like having the different DocC guides for the three different implementation use cases 👍

@ktoso
Copy link
Member Author

ktoso commented Nov 3, 2022

Yup, we'll separate it out and give lots of examples.

I'll spend time tomorrow on this and will ask for a review.

@ktoso ktoso marked this pull request as draft November 3, 2022 09:27
@ktoso
Copy link
Member Author

ktoso commented Nov 4, 2022

Today I rewrote the Instrument Your Library or Framework please have a look 👍

### Libraries & Frameworks
## Libraries & Frameworks

For distributed tracing to be most useful, it needs to be integrated in libraries, especially those serving to inter-connect different processes such as HTTP, or other RPC clients/servers. This then enables end users to reap the benefits of automatic trace propagation across nodes in a system, as well as restoring baggage when incoming messages are received by such library/framework.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
For distributed tracing to be most useful, it needs to be integrated in libraries, especially those serving to inter-connect different processes such as HTTP, or other RPC clients/servers. This then enables end users to reap the benefits of automatic trace propagation across nodes in a system, as well as restoring baggage when incoming messages are received by such library/framework.
For distributed tracing to be most useful, it needs to be integrated in libraries, especially those serving to inter-connect different processes such as HTTP or other RPC clients/servers. This then enables end users to reap the benefits of automatic trace propagation across nodes in a system, as well as restoring baggage when incoming messages are received by such library/framework.


For distributed tracing to be most useful, it needs to be integrated in libraries, especially those serving to inter-connect different processes such as HTTP, or other RPC clients/servers. This then enables end users to reap the benefits of automatic trace propagation across nodes in a system, as well as restoring baggage when incoming messages are received by such library/framework.

The table below illustrates the
Copy link
Member

Choose a reason for hiding this comment

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

...

README.md Outdated Show resolved Hide resolved
Sources/Tracing/Docs.docc/Guides/ImplementATracer.md Outdated Show resolved Hide resolved

Distributed tracing offers two types of instrumentation protocols: an instrument, and a tracer.

A tracer is-an instrument as well, and further refines it with the ability to start a trace ``Span``.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
A tracer is-an instrument as well, and further refines it with the ability to start a trace ``Span``.
A tracer is an instrument as well, and further refines it with the ability to start a trace ``Span``.

Sources/Tracing/Docs.docc/Guides/InstrumentYourLibrary.md Outdated Show resolved Hide resolved
Sources/Tracing/Docs.docc/Guides/InstrumentYourLibrary.md Outdated Show resolved Hide resolved
Sources/Tracing/Docs.docc/Guides/InstrumentYourLibrary.md Outdated Show resolved Hide resolved
Sources/Tracing/Docs.docc/Guides/InstrumentYourLibrary.md Outdated Show resolved Hide resolved

When your library/framework can benefit from tracing, you should make use of it by integrating the `Tracing` library.

In order to work with the tracer [configured by the end-user](#Bootstrapping-the-Instrumentation-System), it adds a property to `InstrumentationSystem` that gives you back a `Tracer`. You can then use that tracer to start `Span`s. In an HTTP client you e.g.
Copy link
Member

Choose a reason for hiding this comment

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

Inconsistent use of end-user vs "end user"

.target(
name: "MyApplication",
dependencies: [
.product(name: "OpenTelemetry", package: "opentelemetry-swift"),
Copy link

Choose a reason for hiding this comment

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

Maybe should include OtlpGRPCSpanExporting from very start?

Copy link
Member Author

Choose a reason for hiding this comment

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

For what it's worth this might better be "SomeTracingSystem" and not the otel not to confuse people. We just happen to use otel in the examples below, but this just explains adding a dependency 🤔 I'll think some more how to do this well.


A typical bootstrap could look something like this:

```swift
Copy link

Choose a reason for hiding this comment

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

Maybe keep this as a full example (with MultiThreadedEventLoopGroup) and remove the bootstrapping the tracer above since this is a more complete example and having the two very close to each other is duplication?

Copy link

Choose a reason for hiding this comment

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

And also add a note about BatchSpanProcessor vs SimpleSpanProcessor. As simple processor is not suitable for hot code execution as will lead to 700+ byte message being sent each time the span is executed.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm a bit torn about this... This isn't the otel tracer's guide. For what it's worth this should be "go and read a specific tracer impls docs" but I want something good enough here to get someone started.

I'll see how to improve this bit though

The primary way you interact with distributed tracing is by starting ``Span``s.

Spans form hierarchies with their parent spans, and end up being visualized using various tools, usually in a format similar to gant charts. So for example, if we had multiple operations that compose making dinner, they would be modelled as child spans of a main `makeDinner` span. Any sub tasks are again modelled as child spans of any given operation, and so on.

Copy link

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeha might as well, We're not "limited to" otel but they have some good guides, I'll add a links

@ktoso ktoso changed the title WIP: revamp docs and final type renames Prepare 1.0 docs and final renames Dec 13, 2022
@ktoso ktoso changed the title Prepare 1.0 docs and final renames Update documentation to latest patterns using locals, and adjust types accordingly Jan 30, 2023
@ktoso ktoso changed the title Update documentation to latest patterns using locals, and adjust types accordingly Documentation with latest guidance, and adjust types accordingly Jan 30, 2023
@ktoso ktoso added this to the 0.4.0 milestone Jan 30, 2023
@ktoso ktoso modified the milestones: 0.4.0, 1.0.0 Mar 9, 2023
@ktoso ktoso removed this from the 1.0.0 milestone Mar 20, 2023
@ktoso
Copy link
Member Author

ktoso commented Apr 13, 2023

I'm going to revive the docs now, but probably by making it a new PR

@ktoso
Copy link
Member Author

ktoso commented Apr 13, 2023

Replaced by #121

@ktoso ktoso deleted the wip-docs-1.0 branch April 13, 2023 10:21
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.

Span references LoggingContext in its docs
5 participants