typelevel / typelevel.github.com

Web site of typelevel.scala
https://typelevel.org
40 stars 99 forks source link

GSoC 2024: add otel4s project #500

Open iRevive opened 6 months ago

iRevive commented 6 months ago

Greetings! Here are a few GSoC ideas for the otel4s project. Last year, Sherrie prototyped the tracing SDK, which we successfully implemented using pure Scala. The SDK is available for all platforms: JVM, Scala.js, and Scala Native.

However, some features are missing. And it would be nice to implement them.

1) Environment-aware TelemetryResource configurer

OpenTelemetry Java can detect a large variety of environments (e.g. GCP, AWS ECS, etc) and add additional environment-specific attributes to the TelemetryResource. For example, when an application runs in the container, the container.id attribute can be added to the telemetry resource.

We can implement the following: a) Common: Container, Host, OS, Process b) Google Cloud: GCP c) AWS: Beanstalk, EC2, ECS, EKS, Lambda

2) Trace SDK - support span limits

The purpose is to keep the number of a) Attributes, b) Links, and c) Events under the configured limit. Details: https://github.com/typelevel/otel4s/issues/481.

3) SDK exporter - implement gRPC-client

We already have protobuf models and an HTTP OTLP client, but the gRPC client still needs to be implemented. Since we need a pure Scala implementation, we can experiment with https://github.com/http4s/http4s-grpc.

4) Context propagators

Some propagators haven't been implemented yet:

5) Prometheus metrics exporter

Note: The metrics SDK has not been implemented yet, and I doubt it will be ready by the start of GSoC.

An HTTP server that exposes metrics in Prometheus-compatible format.

https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md https://github.com/open-telemetry/opentelemetry-java/tree/main/exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus

6) Integration with cats-effect

It's more of a cats-effect project than otel4s. Perhaps some ideas from the existing PR could be reused.

7) Integration with fs2

It would be interesting to explore options to implement propagation within Stream scopes. We have Span[F].startUnmanaged, so perhaps there is a way to hack this functionality.

iRevive commented 6 months ago

@rossabaker @armanbilge please take a look.

samspills commented 6 months ago

Oops sorry @armanbilge I can't officially request a review from you it seems 😅

rossabaker commented 1 month ago

Sorry, this must have gotten lost in one of my notification bankruptcies. Do you want to keep it open for a potential 2025 revival?

iRevive commented 1 month ago

Hey @rossabaker. Some of the listed features have already been implemented. But I'm sure we will have something interesting for 2025 :)