Skip to content

Commit

Permalink
Phoenix Otel semconv 1.27 updates (#374)
Browse files Browse the repository at this point in the history
* Otel semconv 1.26 updates

* Test HTTP1 and HTTP2

* Format

* bump semconv

* otel http tmp

* phx format

* Only run integration on OTP 27+

* try this

* Try disabling retries on most

* fmt

* Try to sleep

* revert

* detach handlers in test

* update deps

* Update deps

* Update deps and bandit config

* Update deps

* Mark release as an rc

* Unused alias

* Update changelog

* formatting
  • Loading branch information
bryannaegele authored Oct 16, 2024
1 parent 2a3f0ff commit 98d7010
Show file tree
Hide file tree
Showing 11 changed files with 822 additions and 1,647 deletions.
2 changes: 1 addition & 1 deletion instrumentation/opentelemetry_bandit/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ erl_crash.dump
/tmp/
.DS_Store

/priv/plts/*
/priv/plts/*
50 changes: 35 additions & 15 deletions instrumentation/opentelemetry_phoenix/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,92 @@
# Changelog

## 2.0.0-rc.1

### Features

- Added Bandit instrumentation support
- Semantic Conventions v1.27 support

### Breaking Changes

- Specifying an adapter is now required. Simply add the instrumentation
library as a dep and follow its setup instructions, then specify your
your adapter.
- Various HTTP Semantic Convention changes are included in the cowboy
and bandit libraries. One major change regards span naming. This may
affect your observability tools when keying on span names. The key
change there is the HTTP method is now a prefix, e.g. "GET /users/:user_id"

# Changes

- OpenTelemetry API v1.4 required

## 1.2.0

### Features

* Add support for LiveView courtesy of @derekkraan
- Add support for LiveView courtesy of @derekkraan

### Fixes

* Do not set a span as errored for exceptions, only based on 5xx HTTP status
- Do not set a span as errored for exceptions, only based on 5xx HTTP status

### Changed

* Minimum supported Elixir version changed to 1.11.
- Minimum supported Elixir version changed to 1.11.

## 1.1.1

### Fixes

* [Relax nimble_options
- [Relax nimble_options
requirement](https://github.com/open-telemetry/opentelemetry-erlang-contrib/pull/161)

## 1.1.0

### Features

* Add support for opentelemetry_cowboy to capture the full request lifecycle
- Add support for opentelemetry_cowboy to capture the full request lifecycle
when using the Plug.Cowboy adapter

## 1.0.0

### Fixes

* Prevent attempting to record an exception when no active span present
* Only mark 5xx level status codes as errored
- Prevent attempting to record an exception when no active span present
- Only mark 5xx level status codes as errored

## 1.0.0-rc.7

### Changed

* Opentelemetry 1.0 support
- Opentelemetry 1.0 support

## 1.0.0-rc.6

### Changed

* Opentelemetry 1.0.0-rc.4 support
- Opentelemetry 1.0.0-rc.4 support

### Fixes

* pass attributes on span start for better sampling options
* fix http status attribute to match spec
- pass attributes on span start for better sampling options
- fix http status attribute to match spec

## 1.0.0-rc.4

### Changed

* Opentelemetry dependency is locked to rc2 or lower in prep for breaking changes in rc3
- Opentelemetry dependency is locked to rc2 or lower in prep for breaking changes in rc3

## 1.0.0-rc.3

### Changed

* Update dependencies to allow telemetry 1.0.0
- Update dependencies to allow telemetry 1.0.0

## 0.2.0

### Changed

* Upgraded to Opentelemetry v0.5.0

- Upgraded to Opentelemetry v0.5.0
22 changes: 5 additions & 17 deletions instrumentation/opentelemetry_phoenix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ After installing, setup the handler in your application behaviour before your
top-level supervisor starts.

```elixir
OpentelemetryPhoenix.setup()
OpentelemetryPhoenix.setup(adapter: :bandit)
```

See the documentation for `OpentelemetryPhoenix.setup/1` for additional options that
Expand All @@ -22,30 +22,18 @@ may be supplied.
```elixir
def deps do
[
{:opentelemetry_phoenix, "~> 1.2"}
{:opentelemetry_phoenix, "~> 2.0.0-beta.1"}
]
end
```

It is high recommended to also install [OpentelemetryCowboy](https://hex.pm/packages/opentelemetry_cowboy) to capture the full

[OpentelemetryBandit](https://hex.pm/packages/opentelemetry_bandit) or [OpentelemetryCowboy](https://hex.pm/packages/opentelemetry_cowboy) must be installed to capture the full
request lifecycle. Phoenix only handles part of the request lifecycle which can lead
to incomplete request durations and lost traces for requests terminated at the socket
level or before reaching Phoenix.

## Compatibility Matrix

| OpentelemetryPhoenix Version | Otel Version | Notes |
| :--------------------------- | :----------- | :---- |
| | | |
| v0.1.0 | <= v.0.5.0 | |
| v1.0.0-rc.3 | v1.0.0-rc.1 | |
| | v1.0.0-rc.2 | |
| v1.0.0-rc.4 | v1.0.0-rc.2 | Otel rc.3 will be a breaking change |
| v1.0.0-rc.5 | v1.0.0-rc.3 | |
| v1.0.0-rc.6 | v1.0.0-rc.4 | |
| v1.0 | v1.0 | |

## Note on phoenix integration
## Note on Phoenix integration

`OpentelemetryPhoenix` requires phoenix to use `Plug.Telemetry` in order to correctly trace endpoint calls.

Expand Down
Loading

0 comments on commit 98d7010

Please sign in to comment.