diff --git a/sdk-extensions/autoconfigure-spi/src/main/java/io/opentelemetry/sdk/autoconfigure/spi/internal/ComponentProvider.java b/sdk-extensions/autoconfigure-spi/src/main/java/io/opentelemetry/sdk/autoconfigure/spi/internal/ComponentProvider.java
index fe1e310abc9..335c9a7c0ab 100644
--- a/sdk-extensions/autoconfigure-spi/src/main/java/io/opentelemetry/sdk/autoconfigure/spi/internal/ComponentProvider.java
+++ b/sdk-extensions/autoconfigure-spi/src/main/java/io/opentelemetry/sdk/autoconfigure/spi/internal/ComponentProvider.java
@@ -5,19 +5,29 @@
package io.opentelemetry.sdk.autoconfigure.spi.internal;
+import io.opentelemetry.context.propagation.TextMapPropagator;
+import io.opentelemetry.sdk.logs.LogRecordProcessor;
import io.opentelemetry.sdk.logs.export.LogRecordExporter;
import io.opentelemetry.sdk.metrics.export.MetricExporter;
+import io.opentelemetry.sdk.resources.Resource;
+import io.opentelemetry.sdk.trace.SpanProcessor;
import io.opentelemetry.sdk.trace.export.SpanExporter;
+import io.opentelemetry.sdk.trace.samplers.Sampler;
/**
* Provides configured instances of SDK extension components. {@link ComponentProvider} allows SDK
* extension components which are not part of the core SDK to be referenced in file based
* configuration.
*
+ *
NOTE: when {@link #getType()} is {@link Resource}, the {@link #getName()} is not (currently)
+ * used, and {@link #create(StructuredConfigProperties)} is (currently) called with an empty {@link
+ * StructuredConfigProperties}.
+ *
* @param the type of the SDK extension component. See {@link #getType()}. Supported values
- * include: {@link SpanExporter}, {@link MetricExporter}, {@link LogRecordExporter}.
+ * include: {@link SpanExporter}, {@link MetricExporter}, {@link LogRecordExporter}, {@link
+ * SpanProcessor}, {@link LogRecordProcessor}, {@link TextMapPropagator}, {@link Sampler},
+ * {@link Resource}.
*/
-// TODO: add support for Sampler, LogRecordProcessor, SpanProcessor, MetricReader
public interface ComponentProvider {
/**
@@ -31,7 +41,8 @@ public interface ComponentProvider {
* instances of a custom span exporter for the "acme" protocol, the name might be "acme".
*
* This name MUST not be the same as any other component provider name which returns components
- * of the same {@link #getType() type}.
+ * of the same {@link #getType() type}. In other words, {@link #getType()} and name form a
+ * composite key uniquely identifying the provider.
*/
String getName();
diff --git a/sdk-extensions/incubator/build.gradle.kts b/sdk-extensions/incubator/build.gradle.kts
index 847a3b039e6..f562360655e 100644
--- a/sdk-extensions/incubator/build.gradle.kts
+++ b/sdk-extensions/incubator/build.gradle.kts
@@ -26,6 +26,7 @@ dependencies {
// io.opentelemetry.sdk.extension.incubator.fileconfig
implementation("com.fasterxml.jackson.core:jackson-databind")
+ api("com.fasterxml.jackson.core:jackson-annotations")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml")
implementation(project(":sdk-extensions:autoconfigure"))
diff --git a/sdk-extensions/incubator/src/main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/FileConfiguration.java b/sdk-extensions/incubator/src/main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/FileConfiguration.java
index 1a28935086b..ec7fe6407ac 100644
--- a/sdk-extensions/incubator/src/main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/FileConfiguration.java
+++ b/sdk-extensions/incubator/src/main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/FileConfiguration.java
@@ -123,8 +123,7 @@ static Object loadYaml(InputStream inputStream, Map environmentV
}
/**
- * Convert the {@code model} to a generic {@link StructuredConfigProperties}, which can be used to
- * read configuration not part of the model.
+ * Convert the {@code model} to a generic {@link StructuredConfigProperties}.
*
* @param model the configuration model
* @return a generic {@link StructuredConfigProperties} representation of the model
@@ -133,6 +132,17 @@ public static StructuredConfigProperties toConfigProperties(OpenTelemetryConfigu
return toConfigProperties((Object) model);
}
+ /**
+ * Convert the {@code configuration} YAML to a generic {@link StructuredConfigProperties}.
+ *
+ * @param configuration configuration YAML
+ * @return a generic {@link StructuredConfigProperties} representation of the model
+ */
+ public static StructuredConfigProperties toConfigProperties(InputStream configuration) {
+ Object yamlObj = loadYaml(configuration, System.getenv());
+ return toConfigProperties(yamlObj);
+ }
+
static StructuredConfigProperties toConfigProperties(Object model) {
Map configurationMap =
MAPPER.convertValue(model, new TypeReference