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

Implement basic OpenTelemetry support #522

Merged
merged 10 commits into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions OpenTelemetry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# OpenTelemetry Configuration
Svix supports sending tracing information to the OpenTelemetry collector at a configured address. This can be used to interface with many services such as DataDog or Sentry.

To set this up you can follow these steps:

1. Set up an account with any service which supports receiving logs from the [OpenTelemetry Collector](https://opentelemetry.io/docs/collector/). Note some services (such as DataDog) require use of specific forks of the OpenTelemetry Collector which include "exporters" for their services. The most popular is the [opentelemetry-collector-contrib](https://github.com/open-telemetry/opentelemetry-collector-contrib).
2. Install, configure, and (re)start the OpenTelemetry Collector, noting the gRPC address it is configured to bind to. Ensure that your external service has been integrated properly by consulting their documentation for OpenTelemetry Collector exporters.
3. Configure the Svix server including the `opentelemetry_address` field to point towards the gRPC address configured above.
4. Optionally configure the `opentelemetry_sample_ratio` in the Svix server configuration. If not set, all traces will be sent to the external service.
5. Ensure the OpenTelemetry Collector is running, start the Svix server, and watch the tracing information be received.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,12 @@ SVIX_REDIS_DSN = "redis://redis:6379"
SVIX_QUEUE_TYPE = "redis"
```

### OpenTelemetry

You may send tracing information to the OpenTelemetry Collector which allows forwarding trace events to a number of external applications/services such as DataDog, Jaeger, NewRelic, Prometheus, Sentry, Signoz, and Zipkin.

You can see more in [these instructions](./OpenTelemetry.md)

### Connection Pool Size

There are two configuration variables `db_pool_max_size` and `redis_pool_max_size` which control the maximum allowed size of the connection pool for PostgreSQL and Redis respectively.
Expand Down
244 changes: 244 additions & 0 deletions server/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions server/svix-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ base64 = "0.13.0"
hyper = { version = "0.14.16", features = ["full"] }
tokio = { version = "1.15.0", features = ["full"] }
tower = "0.4.11"
tower-http = { version = "0.2.0", features = ["trace", "cors"] }
tower-http = { version = "0.2.0", features = ["trace", "cors", "request-id"] }
serde = { version = "1.0.133", features = ["derive"] }
serde_json = "1.0.74"
serde_urlencoded = "0.7.1"
Expand All @@ -35,8 +35,12 @@ enum_dispatch = "0.3.8"
regex = "1.5.5"
lazy_static = "1.4.0"
figment = { version = "0.10", features = ["toml", "env", "test"] }
tracing = "0.1.29"
tracing = "0.1.35"
tracing-subscriber = { version="0.3", features = ["env-filter", "json"] }
tracing-opentelemetry = "0.17.3"
opentelemetry = { version= "0.17", features = ["rt-tokio"] }
opentelemetry-http = "0.6.0"
opentelemetry-otlp = { version = "0.10" }
validator = { version = "0.14.0", features = ["derive"] }
jwt-simple = "0.10.8"
chrono = { version="0.4.19", features = ["serde"] }
Expand Down
Loading