Skip to content

Commit

Permalink
sdk-exporter: implement gRPC exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
iRevive committed Sep 12, 2024
1 parent ed30ddb commit 5c1db8c
Show file tree
Hide file tree
Showing 25 changed files with 1,549 additions and 1,046 deletions.
1 change: 1 addition & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ lazy val `sdk-exporter-common` =
name := "otel4s-sdk-exporter-common",
startYear := Some(2023),
libraryDependencies ++= Seq(
"co.fs2" %%% "fs2-scodec" % FS2Version,
"org.http4s" %%% "http4s-ember-client" % Http4sVersion,
"org.http4s" %%% "http4s-circe" % Http4sVersion,
"io.github.scalapb-json" %%% "scalapb-circe" % ScalaPBCirceVersion,
Expand Down
4 changes: 4 additions & 0 deletions docs/sdk/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,13 @@ Target-specific properties are prioritized. E.g. `otel.exporter.otlp.metrics.end

| System property | Environment variable | Description |
|----------------------------------------|------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| otel.exporter.otlp.protocol | OTEL\\_EXPORTER\\_OTLP\\_PROTOCOL | The transport protocol to use. Options include `grpc`, `http/protobuf`, and `http/json`. Default is `http/protobuf`. |
| otel.exporter.otlp.endpoint | OTEL\\_EXPORTER\\_OTLP\\_ENDPOINT | The OTLP traces, metrics, and logs endpoint to connect to. Must be a **base** URL with a scheme of either http or https based on the use of TLS. Default is `http://localhost:4318/`. |
| otel.exporter.otlp.headers | OTEL\\_EXPORTER\\_OTLP\\_HEADERS | Key-value pairs separated by commas to pass as request headers on OTLP trace, metric, and log requests. |
| otel.exporter.otlp.compression | OTEL\\_EXPORTER\\_OTLP\\_COMPRESSION | The compression type to use on OTLP trace, metric, and log requests. Options include gzip. By default, no compression will be used. |
| otel.exporter.otlp.timeout | OTEL\\_EXPORTER\\_OTLP\\_TIMEOUT | The maximum waiting time to send each OTLP trace, metric, and log batch. Default is `10 seconds`. |
| **Target specific:** | | |
| otel.exporter.otlp.metrics.protocol | OTEL\\_EXPORTER\\_OTLP\\_METRICS\\_PROTOCOL | The transport protocol to use. Options include `grpc`, `http/protobuf`, and `http/json`. Default is `http/protobuf`. |
| otel.exporter.otlp.metrics.endpoint | OTEL\\_EXPORTER\\_OTLP\\_METRICS\\_ENDPOINT | The OTLP metrics endpoint to connect to. Default is `http://localhost:4318/v1/metrics`. |
| otel.exporter.otlp.metrics.headers | OTEL\\_EXPORTER\\_OTLP\\_METRICS\\_HEADERS | Key-value pairs separated by commas to pass as request headers on OTLP trace requests. |
| otel.exporter.otlp.metrics.compression | OTEL\\_EXPORTER\\_OTLP\\_METRICS\\_COMPRESSION | The compression type to use on OTLP trace requests. Options include gzip. By default, no compression will be used. |
Expand Down Expand Up @@ -150,11 +152,13 @@ Target-specific properties are prioritized. E.g. `otel.exporter.otlp.traces.endp

| System property | Environment variable | Description |
|---------------------------------------|-----------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| otel.exporter.otlp.protocol | OTEL\\_EXPORTER\\_OTLP\\_PROTOCOL | The transport protocol to use. Options include `grpc`, `http/protobuf`, and `http/json`. Default is `http/protobuf`. |
| otel.exporter.otlp.endpoint | OTEL\\_EXPORTER\\_OTLP\\_ENDPOINT | The OTLP traces, metrics, and logs endpoint to connect to. Must be a **base** URL with a scheme of either http or https based on the use of TLS. Default is `http://localhost:4318/`. |
| otel.exporter.otlp.headers | OTEL\\_EXPORTER\\_OTLP\\_HEADERS | Key-value pairs separated by commas to pass as request headers on OTLP trace, metric, and log requests. |
| otel.exporter.otlp.compression | OTEL\\_EXPORTER\\_OTLP\\_COMPRESSION | The compression type to use on OTLP trace, metric, and log requests. Options include gzip. By default, no compression will be used. |
| otel.exporter.otlp.timeout | OTEL\\_EXPORTER\\_OTLP\\_TIMEOUT | The maximum waiting time to send each OTLP trace, metric, and log batch. Default is `10 seconds`. |
| **Target specific:** | | |
| otel.exporter.otlp.metrics.protocol | OTEL\\_EXPORTER\\_OTLP\\_TRACES\\_PROTOCOL | The transport protocol to use. Options include `grpc`, `http/protobuf`, and `http/json`. Default is `http/protobuf`. |
| otel.exporter.otlp.traces.endpoint | OTEL\\_EXPORTER\\_OTLP\\_TRACES\\_ENDPOINT | The OTLP traces endpoint to connect to. Default is `http://localhost:4318/v1/traces`. |
| otel.exporter.otlp.traces.headers | OTEL\\_EXPORTER\\_OTLP\\_TRACES\\_HEADERS | Key-value pairs separated by commas to pass as request headers on OTLP trace requests. |
| otel.exporter.otlp.traces.compression | OTEL\\_EXPORTER\\_OTLP\\_TRACES\\_COMPRESSION | The compression type to use on OTLP trace requests. Options include gzip. By default, no compression will be used. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,21 @@

package org.typelevel.otel4s.sdk.exporter.otlp

sealed trait HttpPayloadEncoding
import cats.Show

object HttpPayloadEncoding {
private[otlp] sealed trait HttpPayloadEncoding {
override def toString: String =
Show[HttpPayloadEncoding].show(this)
}

private[otlp] object HttpPayloadEncoding {
case object Json extends HttpPayloadEncoding
case object Protobuf extends HttpPayloadEncoding

implicit val httpPayloadEncodingShow: Show[HttpPayloadEncoding] =
Show.show {
case Json => "json"
case Protobuf => "protobuf"
}

}
Loading

0 comments on commit 5c1db8c

Please sign in to comment.