-
Notifications
You must be signed in to change notification settings - Fork 835
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate the SDK into separate publishable artifacts (#1525)
* Split single "sdk" module into separate pieces for common, correlationcontext, metrics, tracing, and the combination of them all * Modify comment to not reference implementation class * Moved JMH code to /sdk/all * Move new files to adjusted location * Move new files from rebase
- Loading branch information
1 parent
94eaef4
commit 2659726
Showing
183 changed files
with
308 additions
and
73 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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,65 @@ | ||
plugins { | ||
id "java" | ||
id "maven-publish" | ||
|
||
id "ru.vyarus.animalsniffer" | ||
} | ||
|
||
description = 'OpenTelemetry SDK Common' | ||
ext.moduleName = "io.opentelemetry.sdk.common" | ||
ext.propertiesDir = "build/generated/properties/io/opentelemetry/sdk/common" | ||
|
||
dependencies { | ||
api project(':opentelemetry-api') | ||
|
||
implementation libraries.guava | ||
|
||
annotationProcessor libraries.auto_value | ||
|
||
testAnnotationProcessor libraries.auto_value | ||
testCompileOnly libraries.auto_value_annotation | ||
|
||
testImplementation project(':opentelemetry-testing-internal') | ||
testImplementation libraries.junit_pioneer | ||
|
||
signature "org.codehaus.mojo.signature:java17:1.0@signature" | ||
signature "net.sf.androidscents.signature:android-api-level-24:7.0_r2@signature" | ||
} | ||
|
||
sourceSets { | ||
main { | ||
output.dir("build/generated/properties", builtBy: 'generateVersionResource') | ||
} | ||
} | ||
|
||
animalsniffer { | ||
// Don't check sourceSets.jmh and sourceSets.test | ||
sourceSets = [ | ||
sourceSets.main | ||
] | ||
} | ||
|
||
configurations { | ||
testClasses { | ||
extendsFrom(testRuntime) | ||
} | ||
} | ||
|
||
task testJar(type: Jar) { | ||
archiveClassifier.set("test") | ||
from sourceSets.test.output | ||
} | ||
|
||
// add the jar generated by the testJar task to the testClasses dependency | ||
artifacts { | ||
testClasses testJar | ||
} | ||
|
||
task generateVersionResource { | ||
doLast { | ||
def folder = file(propertiesDir) | ||
folder.mkdirs() | ||
def propertiesFile = new File(folder.getAbsolutePath(), "version.properties") | ||
propertiesFile.write("sdk.version=${project.version}") | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
143 changes: 71 additions & 72 deletions
143
...dk/common/InstrumentationLibraryInfo.java → ...dk/common/InstrumentationLibraryInfo.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 |
---|---|---|
@@ -1,72 +1,71 @@ | ||
/* | ||
* Copyright 2019, OpenTelemetry Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.opentelemetry.sdk.common; | ||
|
||
import com.google.auto.value.AutoValue; | ||
import io.opentelemetry.sdk.trace.TracerSdkProvider; | ||
import io.opentelemetry.trace.Tracer; | ||
import javax.annotation.Nullable; | ||
import javax.annotation.concurrent.Immutable; | ||
|
||
/** | ||
* Holds information about the instrumentation library specified when creating an instance of {@link | ||
* Tracer} using {@link TracerSdkProvider}. | ||
*/ | ||
@AutoValue | ||
@Immutable | ||
public abstract class InstrumentationLibraryInfo { | ||
private static final InstrumentationLibraryInfo EMPTY = create("", null); | ||
|
||
/** | ||
* Creates a new instance of {@link InstrumentationLibraryInfo}. | ||
* | ||
* @param name name of the instrumentation library (e.g., "io.opentelemetry.contrib.mongodb"), | ||
* must not be null | ||
* @param version version of the instrumentation library (e.g., "semver:1.0.0"), might be null | ||
* @return the new instance | ||
*/ | ||
public static InstrumentationLibraryInfo create(String name, @Nullable String version) { | ||
return new AutoValue_InstrumentationLibraryInfo(name, version); | ||
} | ||
|
||
/** | ||
* Returns an "empty" {@code InstrumentationLibraryInfo}. | ||
* | ||
* @return an "empty" {@code InstrumentationLibraryInfo}. | ||
*/ | ||
public static InstrumentationLibraryInfo getEmpty() { | ||
return EMPTY; | ||
} | ||
|
||
/** | ||
* Returns the name of the instrumentation library. | ||
* | ||
* @return the name of the instrumentation library. | ||
*/ | ||
public abstract String getName(); | ||
|
||
/** | ||
* Returns the version of the instrumentation library, or {@code null} if not available. | ||
* | ||
* @return the version of the instrumentation library, or {@code null} if not available. | ||
*/ | ||
@Nullable | ||
public abstract String getVersion(); | ||
|
||
// Package protected ctor to avoid others to extend this class. | ||
InstrumentationLibraryInfo() {} | ||
} | ||
/* | ||
* Copyright 2019, OpenTelemetry Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.opentelemetry.sdk.common; | ||
|
||
import com.google.auto.value.AutoValue; | ||
import io.opentelemetry.trace.Tracer; | ||
import javax.annotation.Nullable; | ||
import javax.annotation.concurrent.Immutable; | ||
|
||
/** | ||
* Holds information about the instrumentation library specified when creating an instance of {@link | ||
* Tracer} using the Tracer Provider. | ||
*/ | ||
@AutoValue | ||
@Immutable | ||
public abstract class InstrumentationLibraryInfo { | ||
private static final InstrumentationLibraryInfo EMPTY = create("", null); | ||
|
||
/** | ||
* Creates a new instance of {@link InstrumentationLibraryInfo}. | ||
* | ||
* @param name name of the instrumentation library (e.g., "io.opentelemetry.contrib.mongodb"), | ||
* must not be null | ||
* @param version version of the instrumentation library (e.g., "semver:1.0.0"), might be null | ||
* @return the new instance | ||
*/ | ||
public static InstrumentationLibraryInfo create(String name, @Nullable String version) { | ||
return new AutoValue_InstrumentationLibraryInfo(name, version); | ||
} | ||
|
||
/** | ||
* Returns an "empty" {@code InstrumentationLibraryInfo}. | ||
* | ||
* @return an "empty" {@code InstrumentationLibraryInfo}. | ||
*/ | ||
public static InstrumentationLibraryInfo getEmpty() { | ||
return EMPTY; | ||
} | ||
|
||
/** | ||
* Returns the name of the instrumentation library. | ||
* | ||
* @return the name of the instrumentation library. | ||
*/ | ||
public abstract String getName(); | ||
|
||
/** | ||
* Returns the version of the instrumentation library, or {@code null} if not available. | ||
* | ||
* @return the version of the instrumentation library, or {@code null} if not available. | ||
*/ | ||
@Nullable | ||
public abstract String getVersion(); | ||
|
||
// Package protected ctor to avoid others to extend this class. | ||
InstrumentationLibraryInfo() {} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,50 @@ | ||
plugins { | ||
id "java" | ||
id "maven-publish" | ||
|
||
id "ru.vyarus.animalsniffer" | ||
} | ||
|
||
description = 'OpenTelemetry SDK Correlation Context' | ||
ext.moduleName = "io.opentelemetry.sdk.correlationcontext" | ||
ext.propertiesDir = "build/generated/properties/io/opentelemetry/sdk/correlationcontext" | ||
|
||
dependencies { | ||
api project(':opentelemetry-api'), | ||
project(':opentelemetry-sdk-common') | ||
|
||
implementation libraries.guava | ||
|
||
annotationProcessor libraries.auto_value | ||
|
||
testAnnotationProcessor libraries.auto_value | ||
testCompileOnly libraries.auto_value_annotation | ||
|
||
testImplementation project(':opentelemetry-testing-internal') | ||
testImplementation libraries.junit_pioneer | ||
|
||
signature "org.codehaus.mojo.signature:java17:1.0@signature" | ||
signature "net.sf.androidscents.signature:android-api-level-24:7.0_r2@signature" | ||
} | ||
|
||
sourceSets { | ||
main { | ||
output.dir("build/generated/properties", builtBy: 'generateVersionResource') | ||
} | ||
} | ||
|
||
animalsniffer { | ||
// Don't check sourceSets.jmh and sourceSets.test | ||
sourceSets = [ | ||
sourceSets.main | ||
] | ||
} | ||
|
||
task generateVersionResource { | ||
doLast { | ||
def folder = file(propertiesDir) | ||
folder.mkdirs() | ||
def propertiesFile = new File(folder.getAbsolutePath(), "version.properties") | ||
propertiesFile.write("sdk.version=${project.version}") | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,53 @@ | ||
plugins { | ||
id "java" | ||
id "maven-publish" | ||
|
||
id "me.champeau.gradle.jmh" | ||
id "ru.vyarus.animalsniffer" | ||
} | ||
|
||
description = 'OpenTelemetry SDK Metrics' | ||
ext.moduleName = "io.opentelemetry.sdk.metrics" | ||
ext.propertiesDir = "build/generated/properties/io/opentelemetry/sdk/metrics" | ||
|
||
dependencies { | ||
api project(':opentelemetry-api'), | ||
project(':opentelemetry-sdk-common') | ||
|
||
implementation libraries.guava | ||
|
||
annotationProcessor libraries.auto_value | ||
|
||
testAnnotationProcessor libraries.auto_value | ||
testCompileOnly libraries.auto_value_annotation | ||
|
||
testCompile project(path: ':opentelemetry-sdk-common', configuration: 'testClasses') | ||
|
||
testImplementation project(':opentelemetry-testing-internal') | ||
testImplementation libraries.junit_pioneer | ||
|
||
signature "org.codehaus.mojo.signature:java17:1.0@signature" | ||
signature "net.sf.androidscents.signature:android-api-level-24:7.0_r2@signature" | ||
} | ||
|
||
sourceSets { | ||
main { | ||
output.dir("build/generated/properties", builtBy: 'generateVersionResource') | ||
} | ||
} | ||
|
||
animalsniffer { | ||
// Don't check sourceSets.jmh and sourceSets.test | ||
sourceSets = [ | ||
sourceSets.main | ||
] | ||
} | ||
|
||
task generateVersionResource { | ||
doLast { | ||
def folder = file(propertiesDir) | ||
folder.mkdirs() | ||
def propertiesFile = new File(folder.getAbsolutePath(), "version.properties") | ||
propertiesFile.write("sdk.version=${project.version}") | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,53 @@ | ||
plugins { | ||
id "java" | ||
id "maven-publish" | ||
|
||
id "me.champeau.gradle.jmh" | ||
id "ru.vyarus.animalsniffer" | ||
} | ||
|
||
description = 'OpenTelemetry SDK Tracing' | ||
ext.moduleName = "io.opentelemetry.sdk.tracing" | ||
ext.propertiesDir = "build/generated/properties/io/opentelemetry/sdk/tracing" | ||
|
||
dependencies { | ||
api project(':opentelemetry-api'), | ||
project(':opentelemetry-sdk-common') | ||
|
||
implementation libraries.guava | ||
|
||
annotationProcessor libraries.auto_value | ||
|
||
testAnnotationProcessor libraries.auto_value | ||
testCompileOnly libraries.auto_value_annotation | ||
|
||
testCompile project(path: ':opentelemetry-sdk-common', configuration: 'testClasses') | ||
|
||
testImplementation project(':opentelemetry-testing-internal') | ||
testImplementation libraries.junit_pioneer | ||
|
||
signature "org.codehaus.mojo.signature:java17:1.0@signature" | ||
signature "net.sf.androidscents.signature:android-api-level-24:7.0_r2@signature" | ||
} | ||
|
||
sourceSets { | ||
main { | ||
output.dir("build/generated/properties", builtBy: 'generateVersionResource') | ||
} | ||
} | ||
|
||
animalsniffer { | ||
// Don't check sourceSets.jmh and sourceSets.test | ||
sourceSets = [ | ||
sourceSets.main | ||
] | ||
} | ||
|
||
task generateVersionResource { | ||
doLast { | ||
def folder = file(propertiesDir) | ||
folder.mkdirs() | ||
def propertiesFile = new File(folder.getAbsolutePath(), "version.properties") | ||
propertiesFile.write("sdk.version=${project.version}") | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.