diff --git a/buildSrc/src/main/kotlin/otel.errorprone-conventions.gradle.kts b/buildSrc/src/main/kotlin/otel.errorprone-conventions.gradle.kts index e96a95f7992..be908aaae88 100644 --- a/buildSrc/src/main/kotlin/otel.errorprone-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/otel.errorprone-conventions.gradle.kts @@ -10,6 +10,7 @@ plugins { dependencies { errorprone("com.google.errorprone:error_prone_core") errorprone("com.uber.nullaway:nullaway") + errorprone(project(":custom-checks")) } val disableErrorProne = properties["disableErrorProne"]?.toString()?.toBoolean() ?: false @@ -86,9 +87,11 @@ tasks { // cognitive load is dubious. disable("YodaCondition") - if (name.contains("Jmh") || name.contains("Test")) { + if ((name.contains("Jmh") || name.contains("Test") || project.name.contains("testing-internal")) && !project.name.equals("custom-checks")) { // Allow underscore in test-type method names disable("MemberName") + // Internal javadoc not needed for test or jmh classes + disable("OtelInternalJavadoc") } option("NullAway:CustomContractAnnotations", "io.opentelemetry.api.internal.Contract") diff --git a/custom-checks/build.gradle.kts b/custom-checks/build.gradle.kts new file mode 100644 index 00000000000..5167a979be0 --- /dev/null +++ b/custom-checks/build.gradle.kts @@ -0,0 +1,82 @@ +plugins { + id("otel.java-conventions") +} + +dependencies { + implementation("com.google.errorprone:error_prone_core") + + testImplementation("com.google.errorprone:error_prone_test_helpers") +} + +otelJava.moduleName.set("io.opentelemetry.javaagent.customchecks") + +// We cannot use "--release" javac option here because that will forbid exporting com.sun.tools package. +// We also can't seem to use the toolchain without the "--release" option. So disable everything. + +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + toolchain { + languageVersion.set(null as JavaLanguageVersion?) + } +} + +tasks { + withType().configureEach { + with(options) { + release.set(null as Int?) + + compilerArgs.addAll( + listOf( + "--add-exports", + "jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED", + "--add-exports", + "jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED", + "--add-exports", + "jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED", + "--add-exports", + "jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED", + "--add-exports", + "jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED", + ), + ) + } + } + + // only test on java 17+ + val testJavaVersion: String? by project + if (testJavaVersion != null && Integer.valueOf(testJavaVersion) < 17) { + test { + enabled = false + } + } +} + +tasks.withType().configureEach { + // required on jdk17 + jvmArgs("--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED") + jvmArgs("--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED") + jvmArgs("--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED") + jvmArgs("--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED") + jvmArgs("--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED") + jvmArgs("--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED") + jvmArgs("--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED") + jvmArgs("--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED") + jvmArgs("-XX:+IgnoreUnrecognizedVMOptions") +} + +tasks.withType().configureEach { + // using com.sun.tools.javac.api.JavacTrees breaks javadoc generation + enabled = false +} + +// Our conventions apply this project as a dependency in the errorprone configuration, which would cause +// a circular dependency if trying to compile this project with that still there. So we filter this +// project out. +configurations { + named("errorprone") { + dependencies.removeIf { + it is ProjectDependency && it.dependencyProject == project + } + } +} diff --git a/custom-checks/src/main/java/io/opentelemetry/gradle/customchecks/OtelInternalJavadoc.java b/custom-checks/src/main/java/io/opentelemetry/gradle/customchecks/OtelInternalJavadoc.java new file mode 100644 index 00000000000..3ac6b964dac --- /dev/null +++ b/custom-checks/src/main/java/io/opentelemetry/gradle/customchecks/OtelInternalJavadoc.java @@ -0,0 +1,72 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.gradle.customchecks; + +import static com.google.errorprone.BugPattern.SeverityLevel.WARNING; + +import com.google.errorprone.BugPattern; +import com.google.errorprone.VisitorState; +import com.google.errorprone.bugpatterns.BugChecker; +import com.google.errorprone.matchers.Description; +import com.sun.source.doctree.DocCommentTree; +import com.sun.source.tree.ClassTree; +import com.sun.source.tree.PackageTree; +import com.sun.tools.javac.api.JavacTrees; +import java.util.regex.Pattern; +import javax.annotation.Nullable; +import javax.lang.model.element.Modifier; + +@BugPattern( + summary = + "This public internal class doesn't end with the javadoc disclaimer: \"" + + OtelInternalJavadoc.EXPECTED_INTERNAL_COMMENT + + "\"", + severity = WARNING) +public class OtelInternalJavadoc extends BugChecker implements BugChecker.ClassTreeMatcher { + + private static final long serialVersionUID = 1L; + + private static final Pattern INTERNAL_PACKAGE_PATTERN = Pattern.compile("\\binternal\\b"); + + static final String EXPECTED_INTERNAL_COMMENT = + "This class is internal and is hence not for public use." + + " Its APIs are unstable and can change at any time."; + + @Override + public Description matchClass(ClassTree tree, VisitorState state) { + if (!isPublic(tree) || !isInternal(state) || tree.getSimpleName().toString().endsWith("Test")) { + return Description.NO_MATCH; + } + String javadoc = getJavadoc(state); + if (javadoc != null && javadoc.contains(EXPECTED_INTERNAL_COMMENT)) { + return Description.NO_MATCH; + } + return describeMatch(tree); + } + + private static boolean isPublic(ClassTree tree) { + return tree.getModifiers().getFlags().contains(Modifier.PUBLIC); + } + + private static boolean isInternal(VisitorState state) { + PackageTree packageTree = state.getPath().getCompilationUnit().getPackage(); + if (packageTree == null) { + return false; + } + String packageName = state.getSourceForNode(packageTree.getPackageName()); + return packageName != null && INTERNAL_PACKAGE_PATTERN.matcher(packageName).find(); + } + + @Nullable + private static String getJavadoc(VisitorState state) { + DocCommentTree docCommentTree = + JavacTrees.instance(state.context).getDocCommentTree(state.getPath()); + if (docCommentTree == null) { + return null; + } + return docCommentTree.toString().replace("\n", ""); + } +} diff --git a/custom-checks/src/main/java/io/opentelemetry/gradle/customchecks/OtelPrivateConstructorForUtilityClass.java b/custom-checks/src/main/java/io/opentelemetry/gradle/customchecks/OtelPrivateConstructorForUtilityClass.java new file mode 100644 index 00000000000..5aff2f1db4c --- /dev/null +++ b/custom-checks/src/main/java/io/opentelemetry/gradle/customchecks/OtelPrivateConstructorForUtilityClass.java @@ -0,0 +1,38 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.gradle.customchecks; + +import static com.google.errorprone.BugPattern.SeverityLevel.WARNING; +import static com.google.errorprone.matchers.Description.NO_MATCH; + +import com.google.errorprone.BugPattern; +import com.google.errorprone.VisitorState; +import com.google.errorprone.bugpatterns.BugChecker; +import com.google.errorprone.bugpatterns.PrivateConstructorForUtilityClass; +import com.google.errorprone.matchers.Description; +import com.sun.source.tree.ClassTree; + +@BugPattern( + summary = + "Classes which are not intended to be instantiated should be made non-instantiable with a private constructor. This includes utility classes (classes with only static members), and the main class.", + severity = WARNING) +public class OtelPrivateConstructorForUtilityClass extends BugChecker + implements BugChecker.ClassTreeMatcher { + + private static final long serialVersionUID = 1L; + + private final PrivateConstructorForUtilityClass delegate = + new PrivateConstructorForUtilityClass(); + + @Override + public Description matchClass(ClassTree tree, VisitorState state) { + Description description = delegate.matchClass(tree, state); + if (description == NO_MATCH) { + return description; + } + return describeMatch(tree); + } +} diff --git a/custom-checks/src/main/resources/META-INF/services/com.google.errorprone.bugpatterns.BugChecker b/custom-checks/src/main/resources/META-INF/services/com.google.errorprone.bugpatterns.BugChecker new file mode 100644 index 00000000000..e73ad8bbe73 --- /dev/null +++ b/custom-checks/src/main/resources/META-INF/services/com.google.errorprone.bugpatterns.BugChecker @@ -0,0 +1,2 @@ +io.opentelemetry.gradle.customchecks.OtelInternalJavadoc +io.opentelemetry.gradle.customchecks.OtelPrivateConstructorForUtilityClass diff --git a/custom-checks/src/test/java/io/opentelemetry/gradle/customchecks/OtelInternalJavadocTest.java b/custom-checks/src/test/java/io/opentelemetry/gradle/customchecks/OtelInternalJavadocTest.java new file mode 100644 index 00000000000..ae26844ca72 --- /dev/null +++ b/custom-checks/src/test/java/io/opentelemetry/gradle/customchecks/OtelInternalJavadocTest.java @@ -0,0 +1,24 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.gradle.customchecks; + +import com.google.errorprone.CompilationTestHelper; +import org.junit.jupiter.api.Test; + +class OtelInternalJavadocTest { + + @Test + void test() { + doTest("internal/InternalJavadocPositiveCases.java"); + doTest("internal/InternalJavadocNegativeCases.java"); + } + + private static void doTest(String path) { + CompilationTestHelper.newInstance(OtelInternalJavadoc.class, OtelInternalJavadocTest.class) + .addSourceFile(path) + .doTest(); + } +} diff --git a/custom-checks/src/test/resources/io/opentelemetry/gradle/customchecks/internal/InternalJavadocNegativeCases.java b/custom-checks/src/test/resources/io/opentelemetry/gradle/customchecks/internal/InternalJavadocNegativeCases.java new file mode 100644 index 00000000000..973c13aa2a3 --- /dev/null +++ b/custom-checks/src/test/resources/io/opentelemetry/gradle/customchecks/internal/InternalJavadocNegativeCases.java @@ -0,0 +1,21 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.gradle.customchecks.internal; + +/** + * This class is internal and is hence not for public use. Its APIs are unstable and can change at + * any time. + */ +public class InternalJavadocNegativeCases { + + /** + * This class is internal and is hence not for public use. Its APIs are unstable and can change at + * any time. + */ + public static class One {} + + static class Two {} +} diff --git a/custom-checks/src/test/resources/io/opentelemetry/gradle/customchecks/internal/InternalJavadocPositiveCases.java b/custom-checks/src/test/resources/io/opentelemetry/gradle/customchecks/internal/InternalJavadocPositiveCases.java new file mode 100644 index 00000000000..dc36e5ef636 --- /dev/null +++ b/custom-checks/src/test/resources/io/opentelemetry/gradle/customchecks/internal/InternalJavadocPositiveCases.java @@ -0,0 +1,17 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.gradle.customchecks.internal; + +// BUG: Diagnostic contains: doesn't end with the javadoc disclaimer +public class InternalJavadocPositiveCases { + + // BUG: Diagnostic contains: doesn't end with the javadoc disclaimer + public static class One {} + + /** Doesn't have the disclaimer. */ + // BUG: Diagnostic contains: doesn't end with the javadoc disclaimer + public static class Two {} +} diff --git a/dependencyManagement/build.gradle.kts b/dependencyManagement/build.gradle.kts index 5acf1a368f5..7b6c1d0a55b 100644 --- a/dependencyManagement/build.gradle.kts +++ b/dependencyManagement/build.gradle.kts @@ -38,6 +38,7 @@ val DEPENDENCIES = listOf( "com.google.auto.value:auto-value-annotations:${autoValueVersion}", "com.google.errorprone:error_prone_annotations:${errorProneVersion}", "com.google.errorprone:error_prone_core:${errorProneVersion}", + "com.google.errorprone:error_prone_test_helpers:${errorProneVersion}", "io.opencensus:opencensus-api:${opencensusVersion}", "io.opencensus:opencensus-impl-core:${opencensusVersion}", "io.opencensus:opencensus-impl:${opencensusVersion}", diff --git a/exporters/common/src/main/java/io/opentelemetry/exporter/internal/FailedExportException.java b/exporters/common/src/main/java/io/opentelemetry/exporter/internal/FailedExportException.java index 74f66dbfa1f..3d229514108 100644 --- a/exporters/common/src/main/java/io/opentelemetry/exporter/internal/FailedExportException.java +++ b/exporters/common/src/main/java/io/opentelemetry/exporter/internal/FailedExportException.java @@ -46,7 +46,12 @@ public static GrpcExportException grpcFailedExceptionally(Throwable cause) { /** Returns true if the export failed with a response from the server. */ public abstract boolean failedWithResponse(); - /** Represents the failure of an HTTP exporter. */ + /** + * Represents the failure of an HTTP exporter. + * + *

This class is internal and is hence not for public use. Its APIs are unstable and can change + * at any time. + */ public static final class HttpExportException extends FailedExportException { private static final long serialVersionUID = -6787390183017184775L; @@ -85,7 +90,12 @@ public Throwable getCause() { } } - /** Represents the failure of a gRPC exporter. */ + /** + * Represents the failure of a gRPC exporter. + * + *

This class is internal and is hence not for public use. Its APIs are unstable and can change + * at any time. + */ public static final class GrpcExportException extends FailedExportException { private static final long serialVersionUID = -9157548250286695364L; diff --git a/exporters/common/src/main/java/io/opentelemetry/exporter/internal/InstrumentationUtil.java b/exporters/common/src/main/java/io/opentelemetry/exporter/internal/InstrumentationUtil.java index 5eddab53b76..9a88fe85060 100644 --- a/exporters/common/src/main/java/io/opentelemetry/exporter/internal/InstrumentationUtil.java +++ b/exporters/common/src/main/java/io/opentelemetry/exporter/internal/InstrumentationUtil.java @@ -9,7 +9,7 @@ /** * This class is internal and is hence not for public use. Its APIs are unstable and can change at - * any time + * any time. * * @deprecated use {@link io.opentelemetry.api.internal.InstrumentationUtil} instead. This class * should be removed once instrumentation does not refer to it anymore. diff --git a/exporters/common/src/main/java/io/opentelemetry/exporter/internal/http/HttpSender.java b/exporters/common/src/main/java/io/opentelemetry/exporter/internal/http/HttpSender.java index dc5c775a530..aec50288ebd 100644 --- a/exporters/common/src/main/java/io/opentelemetry/exporter/internal/http/HttpSender.java +++ b/exporters/common/src/main/java/io/opentelemetry/exporter/internal/http/HttpSender.java @@ -41,7 +41,12 @@ void send( /** Shutdown the sender. */ CompletableResultCode shutdown(); - /** The HTTP response. */ + /** + * The HTTP response. + * + *

This class is internal and is hence not for public use. Its APIs are unstable and can change + * at any time. + */ interface Response { /** The HTTP status code. */ diff --git a/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/MarshalerContext.java b/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/MarshalerContext.java index a9f69459e47..80d01e84392 100644 --- a/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/MarshalerContext.java +++ b/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/MarshalerContext.java @@ -21,6 +21,9 @@ * objects, that we call data. Both integers and objects can be read from the state in the order * they were added (first in, first out). Additionally, this class provides various pools and caches * for objects that can be reused between marshalling attempts. + * + *

This class is internal and is hence not for public use. Its APIs are unstable and can change + * at any time. */ public final class MarshalerContext { private final boolean marshalStringNoAllocation; @@ -203,6 +206,10 @@ public void reset() { private static final AtomicInteger KEY_INDEX = new AtomicInteger(); + /** + * This class is internal and is hence not for public use. Its APIs are unstable and can change at + * any time. + */ public static class Key { final int index = KEY_INDEX.getAndIncrement(); } diff --git a/exporters/otlp/common/src/main/java/io/opentelemetry/exporter/internal/otlp/KeyValueStatelessMarshaler.java b/exporters/otlp/common/src/main/java/io/opentelemetry/exporter/internal/otlp/KeyValueStatelessMarshaler.java index cd7defa9aa6..09607917322 100644 --- a/exporters/otlp/common/src/main/java/io/opentelemetry/exporter/internal/otlp/KeyValueStatelessMarshaler.java +++ b/exporters/otlp/common/src/main/java/io/opentelemetry/exporter/internal/otlp/KeyValueStatelessMarshaler.java @@ -12,7 +12,12 @@ import io.opentelemetry.exporter.internal.marshal.StatelessMarshalerUtil; import java.io.IOException; -/** A Marshaler of key value pairs. See {@link AnyValueMarshaler}. */ +/** + * A Marshaler of key value pairs. See {@link AnyValueMarshaler}. + * + *

This class is internal and is hence not for public use. Its APIs are unstable and can change + * at any time. + */ public final class KeyValueStatelessMarshaler implements StatelessMarshaler { public static final KeyValueStatelessMarshaler INSTANCE = new KeyValueStatelessMarshaler(); diff --git a/exporters/otlp/common/src/main/java/io/opentelemetry/exporter/internal/otlp/traces/SpanFlags.java b/exporters/otlp/common/src/main/java/io/opentelemetry/exporter/internal/otlp/traces/SpanFlags.java index 06c57b90541..571be523492 100644 --- a/exporters/otlp/common/src/main/java/io/opentelemetry/exporter/internal/otlp/traces/SpanFlags.java +++ b/exporters/otlp/common/src/main/java/io/opentelemetry/exporter/internal/otlp/traces/SpanFlags.java @@ -11,6 +11,9 @@ * Represents the 32 bit span flags as * specified in the proto definition. + * + *

This class is internal and is hence not for public use. Its APIs are unstable and can change + * at any time. */ public final class SpanFlags { // As defined at: diff --git a/sdk-extensions/autoconfigure-spi/src/main/java/io/opentelemetry/sdk/autoconfigure/spi/internal/AutoConfigureListener.java b/sdk-extensions/autoconfigure-spi/src/main/java/io/opentelemetry/sdk/autoconfigure/spi/internal/AutoConfigureListener.java index af27105cb4f..e181447adb5 100644 --- a/sdk-extensions/autoconfigure-spi/src/main/java/io/opentelemetry/sdk/autoconfigure/spi/internal/AutoConfigureListener.java +++ b/sdk-extensions/autoconfigure-spi/src/main/java/io/opentelemetry/sdk/autoconfigure/spi/internal/AutoConfigureListener.java @@ -13,6 +13,9 @@ * *

This is not a standalone SPI. Instead, implementations of other SPIs can also implement this * interface to receive a callback with the configured SDK. + * + *

This class is internal and is hence not for public use. Its APIs are unstable and can change + * at any time. */ public interface AutoConfigureListener { 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 b7f93b615db..4724a3d1954 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 @@ -23,6 +23,9 @@ * used, and {@link #create(StructuredConfigProperties)} is (currently) called with an empty {@link * StructuredConfigProperties}. * + *

This class is internal and is hence not for public use. Its APIs are unstable and can change + * at any time. + * * @param the type of the SDK extension component. See {@link #getType()}. Supported values * include: {@link SpanExporter}, {@link MetricExporter}, {@link LogRecordExporter}, {@link * SpanProcessor}, {@link LogRecordProcessor}, {@link TextMapPropagator}, {@link Sampler}, diff --git a/sdk-extensions/autoconfigure-spi/src/main/java/io/opentelemetry/sdk/autoconfigure/spi/internal/StructuredConfigProperties.java b/sdk-extensions/autoconfigure-spi/src/main/java/io/opentelemetry/sdk/autoconfigure/spi/internal/StructuredConfigProperties.java index 99eff27f00b..ced88005614 100644 --- a/sdk-extensions/autoconfigure-spi/src/main/java/io/opentelemetry/sdk/autoconfigure/spi/internal/StructuredConfigProperties.java +++ b/sdk-extensions/autoconfigure-spi/src/main/java/io/opentelemetry/sdk/autoconfigure/spi/internal/StructuredConfigProperties.java @@ -21,6 +21,9 @@ * reading scalar properties, {@link #getStructured(String)} for reading children which are * themselves mappings, and {@link #getStructuredList(String)} for reading children which are * sequences of mappings. + * + *

This class is internal and is hence not for public use. Its APIs are unstable and can change + * at any time. */ public interface StructuredConfigProperties { diff --git a/sdk-extensions/autoconfigure/src/main/java/io/opentelemetry/sdk/autoconfigure/internal/EnvironmentResourceProvider.java b/sdk-extensions/autoconfigure/src/main/java/io/opentelemetry/sdk/autoconfigure/internal/EnvironmentResourceProvider.java index 98af5c0d7e5..ba61f957399 100644 --- a/sdk-extensions/autoconfigure/src/main/java/io/opentelemetry/sdk/autoconfigure/internal/EnvironmentResourceProvider.java +++ b/sdk-extensions/autoconfigure/src/main/java/io/opentelemetry/sdk/autoconfigure/internal/EnvironmentResourceProvider.java @@ -13,6 +13,9 @@ /** * {@link ResourceProvider} for automatically configuring {@link * ResourceConfiguration#createEnvironmentResource(ConfigProperties)}. + * + *

This class is internal and is hence not for public use. Its APIs are unstable and can change + * at any time. */ public final class EnvironmentResourceProvider implements ResourceProvider { @Override diff --git a/sdk/common/src/main/java/io/opentelemetry/sdk/internal/DynamicPrimitiveLongList.java b/sdk/common/src/main/java/io/opentelemetry/sdk/internal/DynamicPrimitiveLongList.java index e2bd0412391..7dc138ae0b5 100644 --- a/sdk/common/src/main/java/io/opentelemetry/sdk/internal/DynamicPrimitiveLongList.java +++ b/sdk/common/src/main/java/io/opentelemetry/sdk/internal/DynamicPrimitiveLongList.java @@ -43,8 +43,8 @@ * elements to zero. * * - *

This class is an internal part of the OpenTelemetry SDK and is not intended for public use. - * Its API is unstable and subject to change. + *

This class is internal and is hence not for public use. Its APIs are unstable and can change + * at any time. * *

This class is not thread-safe. */ diff --git a/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/internal/LoggerConfig.java b/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/internal/LoggerConfig.java index 39825686c86..8fb0f7dac2e 100644 --- a/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/internal/LoggerConfig.java +++ b/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/internal/LoggerConfig.java @@ -17,6 +17,9 @@ /** * A collection of configuration options which define the behavior of a {@link Logger}. * + *

This class is internal and is hence not for public use. Its APIs are unstable and can change + * at any time. + * * @see SdkLoggerProviderUtil#setLoggerConfigurator(SdkLoggerProviderBuilder, ScopeConfigurator) * @see SdkLoggerProviderUtil#addLoggerConfiguratorCondition(SdkLoggerProviderBuilder, Predicate, * LoggerConfig) diff --git a/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/internal/SdkEventLoggerProvider.java b/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/internal/SdkEventLoggerProvider.java index 391547201df..7a2972056a3 100644 --- a/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/internal/SdkEventLoggerProvider.java +++ b/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/internal/SdkEventLoggerProvider.java @@ -21,6 +21,9 @@ * *

Delegates all calls to the configured {@link LoggerProvider}, and its {@link LoggerBuilder}s, * {@link Logger}s. + * + *

This class is internal and is hence not for public use. Its APIs are unstable and can change + * at any time. */ public final class SdkEventLoggerProvider implements EventLoggerProvider { diff --git a/sdk/metrics/src/jmh/java/io/opentelemetry/sdk/metrics/internal/aggregator/ExponentialHistogramIndexerBenchmark.java b/sdk/metrics/src/jmh/java/io/opentelemetry/sdk/metrics/internal/aggregator/ExponentialHistogramIndexerBenchmark.java index 66c3d579e4f..304087f734f 100644 --- a/sdk/metrics/src/jmh/java/io/opentelemetry/sdk/metrics/internal/aggregator/ExponentialHistogramIndexerBenchmark.java +++ b/sdk/metrics/src/jmh/java/io/opentelemetry/sdk/metrics/internal/aggregator/ExponentialHistogramIndexerBenchmark.java @@ -21,7 +21,12 @@ import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.Warmup; -/** Measures runtime cost of computing bucket indexes for exponential histograms. */ +/** + * Measures runtime cost of computing bucket indexes for exponential histograms. + * + *

This class is internal and is hence not for public use. Its APIs are unstable and can change + * at any time. + */ @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) @Measurement(iterations = 5, time = 1) diff --git a/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/MeterConfig.java b/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/MeterConfig.java index 12d2c1df1b1..ededd6acdad 100644 --- a/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/MeterConfig.java +++ b/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/MeterConfig.java @@ -17,6 +17,9 @@ /** * A collection of configuration options which define the behavior of a {@link Meter}. * + *

This class is internal and is hence not for public use. Its APIs are unstable and can change + * at any time. + * * @see SdkMeterProviderUtil#setMeterConfigurator(SdkMeterProviderBuilder, ScopeConfigurator) * @see SdkMeterProviderUtil#addMeterConfiguratorCondition(SdkMeterProviderBuilder, Predicate, * MeterConfig) diff --git a/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/data/ImmutableSummaryData.java b/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/data/ImmutableSummaryData.java index 7f145269341..0c1f4db1bd6 100644 --- a/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/data/ImmutableSummaryData.java +++ b/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/data/ImmutableSummaryData.java @@ -25,7 +25,7 @@ * instruments. * *

This class is internal and is hence not for public use. Its APIs are unstable and can change - * at any time + * at any time. */ @Immutable @AutoValue diff --git a/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/data/ImmutableSummaryPointData.java b/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/data/ImmutableSummaryPointData.java index 447ad45963d..54597c1acb9 100644 --- a/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/data/ImmutableSummaryPointData.java +++ b/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/data/ImmutableSummaryPointData.java @@ -17,7 +17,7 @@ * A single data point that summarizes the values in a time series of numeric values. * *

This class is internal and is hence not for public use. Its APIs are unstable and can change - * at any time + * at any time. */ @Immutable @AutoValue diff --git a/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/data/ImmutableValueAtQuantile.java b/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/data/ImmutableValueAtQuantile.java index 01995b28aa4..d8f31391cb8 100644 --- a/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/data/ImmutableValueAtQuantile.java +++ b/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/data/ImmutableValueAtQuantile.java @@ -13,7 +13,7 @@ * A summary metric value. * *

This class is internal and is hence not for public use. Its APIs are unstable and can change - * at any time + * at any time. */ @Immutable @AutoValue diff --git a/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/descriptor/Advice.java b/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/descriptor/Advice.java index 96302ecfbe4..768b3afc297 100644 --- a/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/descriptor/Advice.java +++ b/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/descriptor/Advice.java @@ -13,6 +13,10 @@ import javax.annotation.Nullable; import javax.annotation.concurrent.Immutable; +/** + * This class is internal and is hence not for public use. Its APIs are unstable and can change at + * any time. + */ @AutoValue @Immutable public abstract class Advice { @@ -39,6 +43,10 @@ public boolean hasAttributes() { return getAttributes() != null; } + /** + * This class is internal and is hence not for public use. Its APIs are unstable and can change at + * any time. + */ @AutoValue.Builder public abstract static class AdviceBuilder { diff --git a/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/internal/TracerConfig.java b/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/internal/TracerConfig.java index d019055b36a..535760cbfd4 100644 --- a/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/internal/TracerConfig.java +++ b/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/internal/TracerConfig.java @@ -17,6 +17,9 @@ /** * A collection of configuration options which define the behavior of a {@link Tracer}. * + *

This class is internal and is hence not for public use. Its APIs are unstable and can change + * at any time. + * * @see SdkTracerProviderUtil#setTracerConfigurator(SdkTracerProviderBuilder, ScopeConfigurator) * @see SdkTracerProviderUtil#addTracerConfiguratorCondition(SdkTracerProviderBuilder, Predicate, * TracerConfig) diff --git a/settings.gradle.kts b/settings.gradle.kts index c3542d49948..5952dc4a118 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -29,6 +29,7 @@ include(":api:testing-internal") include(":bom") include(":bom-alpha") include(":context") +include(":custom-checks") include(":dependencyManagement") include(":extensions:kotlin") include(":extensions:trace-propagators")