Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Ruoss committed Feb 20, 2022
1 parent 652abfa commit 4797d2b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- `K8s.Client.Runner.Watch.stream/3` - watches a resource and returns an elixir [Stream](https://hexdocs.pm/elixir/1.12/Stream.html) of events #121
- `K8s.Client.apply/3` - Create a [server-side apply](https://kubernetes.io/docs/reference/using-api/server-side-apply/) operation
- `K8s.Sys.OpenTelemetry` - BETA! - Connects telemetry spans to an OpenTelemetry tracer
- `K8s.Sys.Spandex` - BETA! - Connects telemetry spans to a Spandex tracer

### Changed

Expand Down
22 changes: 21 additions & 1 deletion guides/observability.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,24 @@ them.

## Tracing

Tracing has not been implemented yet.
There are two connectors to `:telemetry` spans/events.

### OpenTelemetry

If you're [OpenTelemetry](https://opentelemetry.io/docs/instrumentation/erlang/), attach
`:telemetry` spans/events to the OpenTelemetry handler:

```elixir
K8s.Sys.OpenTelemetry.attach()
```

### Spandex


If you're using a [Spandex](https://github.com/spandex-project/spandex) tracer, Attach
`:telemetry` spans/events to the Spandex handler. Pass the tracer you created according
to the Spandex documentation as argument to the `attach/1` function.

```elixir
K8s.Sys.Spandex.attach(MyApp.Tracer)
```
10 changes: 9 additions & 1 deletion lib/k8s/sys/open_telemetry.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
defmodule K8s.Sys.OpenTelemetry do
@moduledoc "Converts telemetry spans to opentelemetry tracing spans"
@moduledoc """
This module is still in beta! It has not been tested well and feedback is welcome!
Converts telemetry spans to opentelemetry tracing spans
### Usage
K8s.Sys.OpenTelemetry.attach()
"""

@doc """
Attaches telemetry spans to the opentelemetry processor
Expand Down

0 comments on commit 4797d2b

Please sign in to comment.