forked from open-telemetry/opentelemetry-java
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
512 additions
and
409 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...a/io/opentelemetry/exporter/otlp/internal/OtlpGrpcLogRecordExporterComponentProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.exporter.otlp.internal; | ||
|
||
import static io.opentelemetry.exporter.otlp.internal.OtlpConfigUtil.DATA_TYPE_LOGS; | ||
|
||
import io.opentelemetry.exporter.otlp.logs.OtlpGrpcLogRecordExporter; | ||
import io.opentelemetry.exporter.otlp.logs.OtlpGrpcLogRecordExporterBuilder; | ||
import io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider; | ||
import io.opentelemetry.sdk.autoconfigure.spi.internal.StructuredConfigProperties; | ||
import io.opentelemetry.sdk.logs.export.LogRecordExporter; | ||
|
||
/** | ||
* Declarative configuration SPI implementation for {@link OtlpGrpcLogRecordExporter}. | ||
* | ||
* <p>This class is internal and is hence not for public use. Its APIs are unstable and can change | ||
* at any time. | ||
*/ | ||
public class OtlpGrpcLogRecordExporterComponentProvider | ||
implements ComponentProvider<LogRecordExporter> { | ||
|
||
@Override | ||
public Class<LogRecordExporter> getType() { | ||
return LogRecordExporter.class; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "otlp_grpc"; | ||
} | ||
|
||
@Override | ||
public LogRecordExporter create(StructuredConfigProperties config) { | ||
OtlpGrpcLogRecordExporterBuilder builder = grpcBuilder(); | ||
|
||
OtlpConfigUtil.configureOtlpExporterBuilder( | ||
DATA_TYPE_LOGS, | ||
config, | ||
builder::setEndpoint, | ||
builder::addHeader, | ||
builder::setCompression, | ||
builder::setTimeout, | ||
builder::setTrustedCertificates, | ||
builder::setClientTls, | ||
builder::setRetryPolicy, | ||
builder::setMemoryMode, | ||
/* isHttpProtobuf= */ false); | ||
|
||
return builder.build(); | ||
} | ||
|
||
// Visible for testing | ||
OtlpGrpcLogRecordExporterBuilder grpcBuilder() { | ||
return OtlpGrpcLogRecordExporter.builder(); | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
...java/io/opentelemetry/exporter/otlp/internal/OtlpGrpcMetricExporterComponentProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.exporter.otlp.internal; | ||
|
||
import static io.opentelemetry.exporter.otlp.internal.OtlpConfigUtil.DATA_TYPE_METRICS; | ||
|
||
import io.opentelemetry.exporter.internal.ExporterBuilderUtil; | ||
import io.opentelemetry.exporter.otlp.metrics.OtlpGrpcMetricExporter; | ||
import io.opentelemetry.exporter.otlp.metrics.OtlpGrpcMetricExporterBuilder; | ||
import io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider; | ||
import io.opentelemetry.sdk.autoconfigure.spi.internal.StructuredConfigProperties; | ||
import io.opentelemetry.sdk.metrics.export.MetricExporter; | ||
|
||
/** | ||
* Declarative configuration SPI implementation for {@link OtlpGrpcMetricExporter}. | ||
* | ||
* <p>This class is internal and is hence not for public use. Its APIs are unstable and can change | ||
* at any time. | ||
*/ | ||
public class OtlpGrpcMetricExporterComponentProvider implements ComponentProvider<MetricExporter> { | ||
|
||
@Override | ||
public Class<MetricExporter> getType() { | ||
return MetricExporter.class; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "otlp_grpc"; | ||
} | ||
|
||
@Override | ||
public MetricExporter create(StructuredConfigProperties config) { | ||
OtlpGrpcMetricExporterBuilder builder = grpcBuilder(); | ||
|
||
OtlpConfigUtil.configureOtlpExporterBuilder( | ||
DATA_TYPE_METRICS, | ||
config, | ||
builder::setEndpoint, | ||
builder::addHeader, | ||
builder::setCompression, | ||
builder::setTimeout, | ||
builder::setTrustedCertificates, | ||
builder::setClientTls, | ||
builder::setRetryPolicy, | ||
builder::setMemoryMode, | ||
/* isHttpProtobuf= */ false); | ||
ExporterBuilderUtil.configureOtlpAggregationTemporality( | ||
config, builder::setAggregationTemporalitySelector); | ||
ExporterBuilderUtil.configureOtlpHistogramDefaultAggregation( | ||
config, builder::setDefaultAggregationSelector); | ||
|
||
return builder.build(); | ||
} | ||
|
||
// Visible for testing | ||
OtlpGrpcMetricExporterBuilder grpcBuilder() { | ||
return OtlpGrpcMetricExporter.builder(); | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
...n/java/io/opentelemetry/exporter/otlp/internal/OtlpGrpcSpanExporterComponentProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.exporter.otlp.internal; | ||
|
||
import static io.opentelemetry.exporter.otlp.internal.OtlpConfigUtil.DATA_TYPE_TRACES; | ||
|
||
import io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter; | ||
import io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporterBuilder; | ||
import io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider; | ||
import io.opentelemetry.sdk.autoconfigure.spi.internal.StructuredConfigProperties; | ||
import io.opentelemetry.sdk.trace.export.SpanExporter; | ||
|
||
/** | ||
* Declarative configuration SPI implementation for {@link OtlpGrpcSpanExporter}. | ||
* | ||
* <p>This class is internal and is hence not for public use. Its APIs are unstable and can change | ||
* at any time. | ||
*/ | ||
public class OtlpGrpcSpanExporterComponentProvider implements ComponentProvider<SpanExporter> { | ||
|
||
@Override | ||
public Class<SpanExporter> getType() { | ||
return SpanExporter.class; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "otlp_grpc"; | ||
} | ||
|
||
@Override | ||
public SpanExporter create(StructuredConfigProperties config) { | ||
OtlpGrpcSpanExporterBuilder builder = grpcBuilder(); | ||
|
||
OtlpConfigUtil.configureOtlpExporterBuilder( | ||
DATA_TYPE_TRACES, | ||
config, | ||
builder::setEndpoint, | ||
builder::addHeader, | ||
builder::setCompression, | ||
builder::setTimeout, | ||
builder::setTrustedCertificates, | ||
builder::setClientTls, | ||
builder::setRetryPolicy, | ||
builder::setMemoryMode, | ||
/* isHttpProtobuf= */ false); | ||
|
||
return builder.build(); | ||
} | ||
|
||
// Visible for testing | ||
OtlpGrpcSpanExporterBuilder grpcBuilder() { | ||
return OtlpGrpcSpanExporter.builder(); | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
...a/io/opentelemetry/exporter/otlp/internal/OtlpHttpLogRecordExporterComponentProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.exporter.otlp.internal; | ||
|
||
import static io.opentelemetry.exporter.otlp.internal.OtlpConfigUtil.DATA_TYPE_LOGS; | ||
|
||
import io.opentelemetry.exporter.otlp.http.logs.OtlpHttpLogRecordExporter; | ||
import io.opentelemetry.exporter.otlp.http.logs.OtlpHttpLogRecordExporterBuilder; | ||
import io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider; | ||
import io.opentelemetry.sdk.autoconfigure.spi.internal.StructuredConfigProperties; | ||
import io.opentelemetry.sdk.logs.export.LogRecordExporter; | ||
|
||
/** | ||
* Declarative configuration SPI implementation for {@link OtlpHttpLogRecordExporter}. | ||
* | ||
* <p>This class is internal and is hence not for public use. Its APIs are unstable and can change | ||
* at any time. | ||
*/ | ||
public class OtlpHttpLogRecordExporterComponentProvider | ||
implements ComponentProvider<LogRecordExporter> { | ||
|
||
@Override | ||
public Class<LogRecordExporter> getType() { | ||
return LogRecordExporter.class; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "otlp_http"; | ||
} | ||
|
||
@Override | ||
public LogRecordExporter create(StructuredConfigProperties config) { | ||
OtlpHttpLogRecordExporterBuilder builder = httpBuilder(); | ||
|
||
OtlpConfigUtil.configureOtlpExporterBuilder( | ||
DATA_TYPE_LOGS, | ||
config, | ||
builder::setEndpoint, | ||
builder::addHeader, | ||
builder::setCompression, | ||
builder::setTimeout, | ||
builder::setTrustedCertificates, | ||
builder::setClientTls, | ||
builder::setRetryPolicy, | ||
builder::setMemoryMode, | ||
/* isHttpProtobuf= */ true); | ||
|
||
return builder.build(); | ||
} | ||
|
||
// Visible for testing | ||
OtlpHttpLogRecordExporterBuilder httpBuilder() { | ||
return OtlpHttpLogRecordExporter.builder(); | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
...java/io/opentelemetry/exporter/otlp/internal/OtlpHttpMetricExporterComponentProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.exporter.otlp.internal; | ||
|
||
import static io.opentelemetry.exporter.otlp.internal.OtlpConfigUtil.DATA_TYPE_METRICS; | ||
|
||
import io.opentelemetry.exporter.internal.ExporterBuilderUtil; | ||
import io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporter; | ||
import io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporterBuilder; | ||
import io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider; | ||
import io.opentelemetry.sdk.autoconfigure.spi.internal.StructuredConfigProperties; | ||
import io.opentelemetry.sdk.metrics.export.MetricExporter; | ||
|
||
/** | ||
* Declarative configuration SPI implementation for {@link OtlpHttpMetricExporter}. | ||
* | ||
* <p>This class is internal and is hence not for public use. Its APIs are unstable and can change | ||
* at any time. | ||
*/ | ||
public class OtlpHttpMetricExporterComponentProvider implements ComponentProvider<MetricExporter> { | ||
|
||
@Override | ||
public Class<MetricExporter> getType() { | ||
return MetricExporter.class; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "otlp_http"; | ||
} | ||
|
||
@Override | ||
public MetricExporter create(StructuredConfigProperties config) { | ||
OtlpHttpMetricExporterBuilder builder = httpBuilder(); | ||
|
||
OtlpConfigUtil.configureOtlpExporterBuilder( | ||
DATA_TYPE_METRICS, | ||
config, | ||
builder::setEndpoint, | ||
builder::addHeader, | ||
builder::setCompression, | ||
builder::setTimeout, | ||
builder::setTrustedCertificates, | ||
builder::setClientTls, | ||
builder::setRetryPolicy, | ||
builder::setMemoryMode, | ||
/* isHttpProtobuf= */ true); | ||
ExporterBuilderUtil.configureOtlpAggregationTemporality( | ||
config, builder::setAggregationTemporalitySelector); | ||
ExporterBuilderUtil.configureOtlpHistogramDefaultAggregation( | ||
config, builder::setDefaultAggregationSelector); | ||
|
||
return builder.build(); | ||
} | ||
|
||
// Visible for testing | ||
OtlpHttpMetricExporterBuilder httpBuilder() { | ||
return OtlpHttpMetricExporter.builder(); | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
...n/java/io/opentelemetry/exporter/otlp/internal/OtlpHttpSpanExporterComponentProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.exporter.otlp.internal; | ||
|
||
import static io.opentelemetry.exporter.otlp.internal.OtlpConfigUtil.DATA_TYPE_TRACES; | ||
|
||
import io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporter; | ||
import io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporterBuilder; | ||
import io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider; | ||
import io.opentelemetry.sdk.autoconfigure.spi.internal.StructuredConfigProperties; | ||
import io.opentelemetry.sdk.trace.export.SpanExporter; | ||
|
||
/** | ||
* Declarative configuration SPI implementation for {@link OtlpHttpSpanExporter}. | ||
* | ||
* <p>This class is internal and is hence not for public use. Its APIs are unstable and can change | ||
* at any time. | ||
*/ | ||
public class OtlpHttpSpanExporterComponentProvider implements ComponentProvider<SpanExporter> { | ||
|
||
@Override | ||
public Class<SpanExporter> getType() { | ||
return SpanExporter.class; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "otlp_http"; | ||
} | ||
|
||
@Override | ||
public SpanExporter create(StructuredConfigProperties config) { | ||
OtlpHttpSpanExporterBuilder builder = httpBuilder(); | ||
|
||
OtlpConfigUtil.configureOtlpExporterBuilder( | ||
DATA_TYPE_TRACES, | ||
config, | ||
builder::setEndpoint, | ||
builder::addHeader, | ||
builder::setCompression, | ||
builder::setTimeout, | ||
builder::setTrustedCertificates, | ||
builder::setClientTls, | ||
builder::setRetryPolicy, | ||
builder::setMemoryMode, | ||
/* isHttpProtobuf= */ true); | ||
|
||
return builder.build(); | ||
} | ||
|
||
// Visible for testing | ||
OtlpHttpSpanExporterBuilder httpBuilder() { | ||
return OtlpHttpSpanExporter.builder(); | ||
} | ||
} |
Oops, something went wrong.