Skip to content

Commit

Permalink
add a few comments for later improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
SylvainJuge committed Oct 27, 2023
1 parent d843113 commit 765a270
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions custom/src/main/java/co/elastic/otel/ElasticSpanExporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ public Attributes getAttributes() {
@Override
public Resource getResource() {
Resource original = span.getResource();
// TODO once we implement asynchronous cloud resource loading, this is the place where
// we can merge them to make it as if they were available through the otel SDK
// if the original resource is immutable, we can probably keep a map and cache to prevent too
// much allocation
return Resource.create(original.getAttributes(), original.getSchemaUrl());
}
});
Expand Down
3 changes: 3 additions & 0 deletions resources/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ dependencies {
}
dependencies {
// AWS cloud resource providers transitive dependencies
// TODO remove the static version dependencies, either by automatically getting the
// transitive dependencies of the shaded artifacts, or by reusing the common versions that
// are very likely provided through transitive dependencies
implementation("com.fasterxml.jackson.core:jackson-core:2.15.2")
implementation("com.squareup.okhttp3:okhttp:4.11.0")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ private void testResourceProvider(ResourceAttributesCheck check) {
}

private static void mockEc2Metadata() {
// TODO when testing async resource loading, we need to configure extra delay on response, which
// should not slow down the app startup if the async loading works as expected

mockServerClient
.when(HttpRequest.request().withMethod("PUT").withPath("/latest/api/token"))
Expand Down

0 comments on commit 765a270

Please sign in to comment.