typelevel.github.com icon indicating copy to clipboard operation
typelevel.github.com copied to clipboard

GSoC 2024: add otel4s project

Open iRevive opened this issue 1 year ago • 5 comments

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 avatar Mar 12 '24 16:03 iRevive

@rossabaker @armanbilge please take a look.

iRevive avatar Mar 12 '24 16:03 iRevive

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

samspills avatar Mar 17 '24 22:03 samspills

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

rossabaker avatar Aug 29 '24 20:08 rossabaker

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

iRevive avatar Aug 30 '24 06:08 iRevive