Skip to content

Commit

Permalink
Merge pull request #278 from trace4cats/fix/otel-format-changes
Browse files Browse the repository at this point in the history
  • Loading branch information
janstenpickle committed May 17, 2023
2 parents 0447a93 + 386d79e commit f552447
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/otel-test-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ processors:

exporters:
logging:
logLevel: debug
verbosity: detailed
jaeger:
endpoint: jaeger:14250
tls:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3.8"
services:
otelcol:
image: otel/opentelemetry-collector:0.56.0
image: otel/opentelemetry-collector:0.74.0
ports:
- "4317:4317"
- "4318:4318"
Expand All @@ -14,7 +14,7 @@ services:
- jaeger

jaeger:
image: jaegertracing/all-in-one:1.36.0
image: jaegertracing/all-in-one:1.44.0
ports:
- "5775:5775/udp"
- "6831:6831/udp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,7 @@ object ResourceSpansBatch {
.map { case (service, spans) =>
ResourceSpans(
resource = Resource(attributes = List(KeyValue("service.name", AnyValue.stringValue(service)))),
instrumentation_library_spans = List(
InstrumentationLibrarySpans(
instrumentation_library = InstrumentationLibrary("trace4cats"),
spans = spans.toList
)
)
scope_spans = List(ScopeSpans(scope = InstrumentationScope("trace4cats"), spans = spans.toList))
)
}
.toList
Expand All @@ -89,7 +84,7 @@ object ResourceSpansBatch {

case class ResourceSpansBatch(resource_spans: List[ResourceSpans])

case class ResourceSpans(resource: Resource, instrumentation_library_spans: List[InstrumentationLibrarySpans])
case class ResourceSpans(resource: Resource, scope_spans: List[ScopeSpans])
object ResourceSpans {
implicit val resourceSpansEncoder: Encoder.AsObject[ResourceSpans] = deriveEncoder
}
Expand All @@ -99,14 +94,19 @@ object Resource {
implicit val resourceEncoder: Encoder.AsObject[Resource] = deriveEncoder
}

case class InstrumentationLibrarySpans(instrumentation_library: InstrumentationLibrary, spans: List[Span])
object InstrumentationLibrarySpans {
implicit val instrumentationLibrarySpansEncoder: Encoder.AsObject[InstrumentationLibrarySpans] = deriveEncoder
case class ScopeSpans(scope: InstrumentationScope, spans: List[Span])
object ScopeSpans {
implicit val scopeSpansEncoder: Encoder.AsObject[ScopeSpans] = deriveEncoder
}

case class InstrumentationLibrary(name: String, version: String = "")
object InstrumentationLibrary {
implicit val instrumentationLibraryEncoder: Encoder.AsObject[InstrumentationLibrary] = deriveEncoder
case class InstrumentationScope(
name: String,
version: String = "",
attributes: List[KeyValue] = Nil,
dropped_attributes_count: Int = 0
)
object InstrumentationScope {
implicit val instrumentationScopeEncoder: Encoder.AsObject[InstrumentationScope] = deriveEncoder
}

case class Status(message: String, code: Status.Code)
Expand Down

0 comments on commit f552447

Please sign in to comment.