From e81d911f35283f12a7c0fcb922987ac4be2ea248 Mon Sep 17 00:00:00 2001
From: jack-berg <34418638+jack-berg@users.noreply.github.com>
Date: Fri, 22 Jan 2021 10:35:11 -0600
Subject: [PATCH] merge telemetry module into telemetry-core to help reduce
split module issue
---
CONTRIBUTING.md | 1 -
README.md | 18 ++++++-----------
build.gradle.kts | 2 +-
settings.gradle.kts | 1 -
telemetry-all/build.gradle.kts | 6 ------
.../java/com/newrelic/telemetry/Backoff.java | 0
.../newrelic/telemetry/LimitingScheduler.java | 0
.../telemetry/LoggingNotificationHandler.java | 0
.../telemetry/NotificationHandler.java | 0
.../newrelic/telemetry/TelemetryClient.java | 0
.../com/newrelic/telemetry/BackoffTest.java | 0
.../telemetry/LimitingSchedulerTest.java | 0
.../telemetry/NotificationHandlerTest.java | 0
.../telemetry/TelemetryClientTest.java | 0
telemetry-http-java11/build.gradle.kts | 1 -
telemetry-http-okhttp/build.gradle.kts | 1 -
telemetry/README.md | 20 -------------------
telemetry/build.gradle.kts | 17 ----------------
telemetry_examples/build.gradle.kts | 1 -
19 files changed, 7 insertions(+), 61 deletions(-)
rename {telemetry => telemetry-core}/src/main/java/com/newrelic/telemetry/Backoff.java (100%)
rename {telemetry => telemetry-core}/src/main/java/com/newrelic/telemetry/LimitingScheduler.java (100%)
rename {telemetry => telemetry-core}/src/main/java/com/newrelic/telemetry/LoggingNotificationHandler.java (100%)
rename {telemetry => telemetry-core}/src/main/java/com/newrelic/telemetry/NotificationHandler.java (100%)
rename {telemetry => telemetry-core}/src/main/java/com/newrelic/telemetry/TelemetryClient.java (100%)
rename {telemetry => telemetry-core}/src/test/java/com/newrelic/telemetry/BackoffTest.java (100%)
rename {telemetry => telemetry-core}/src/test/java/com/newrelic/telemetry/LimitingSchedulerTest.java (100%)
rename {telemetry => telemetry-core}/src/test/java/com/newrelic/telemetry/NotificationHandlerTest.java (100%)
rename {telemetry => telemetry-core}/src/test/java/com/newrelic/telemetry/TelemetryClientTest.java (100%)
delete mode 100644 telemetry/README.md
delete mode 100644 telemetry/build.gradle.kts
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 32833c66..8a776aa9 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -60,7 +60,6 @@ The Telemetry SDK comes with tests in:.
`integration_test`
`telemetry-core/src/test`
-`telemetry/src/test`
`telemetry-http-okhttp/src/test`
You can run all of these tests, and verify that your code is formatted correctly by running
diff --git a/README.md b/README.md
index 8aaac1f4..b7dd24c4 100644
--- a/README.md
+++ b/README.md
@@ -36,7 +36,7 @@ Maven dependencies:
```
com.newrelic.telemetry
- telemetry
+ telemetry-core
0.10.0
@@ -49,7 +49,7 @@ Maven dependencies:
Gradle dependencies:
```
-implementation("com.newrelic.telemetry:telemetry:0.10.0")
+implementation("com.newrelic.telemetry:telemetry-core:0.10.0")
implementation("com.newrelic.telemetry:telemetry-http-okhttp:0.10.0")
```
@@ -121,7 +121,9 @@ be applied automatically before commits by moving it into `.git/hooks/pre-commit
### Module structure:
#### `telemetry_core`
-This is the core module for sending dimensional metrics and spans to New Relic. The library is published under maven coordinates:
+This is the core module for sending dimensional metrics and spans to New Relic. It contains low level APIs as well as
+ higher level "best practice" implementations that compose interactions with the lower level modules. The library is
+ published under maven coordinates:
`com.newrelic.telemetry:telemetry-core`
@@ -129,14 +131,6 @@ In order to send metrics and spans to New Relic, you will also need an Insights
Please see [New Relic Api Keys](https://docs.newrelic.com/docs/apis/getting-started/intro-apis/understand-new-relic-api-keys#user-api-key)
for more information.
-#### `telemetry`
-This module contains code for using all New Relic telemetry modules, gathered in one place, as well as what we
-consider "best practice" implementations of how to interact with the lower-level modules.
-
-The `telemetry` library is published under the maven coordinates:
-
-`com.newrelic.telemetry:telemetry`
-
#### `telemetry-http-java11`
This is an implementation of the required http client interface using Java 11 JDK classes as the underlying library.
The `telemetry-http-java11` library is published under the maven coordinates:
@@ -215,7 +209,7 @@ After the release job has run successfully it will publish the new artifact to a
## [0.6.0]
- Miscellaneous bug fixes and tweaks
```
-* Update the [Usage](#usage) example in the [README](README.md) with the newly released version (e.g. `implementation("com.newrelic.telemetry:telemetry:0.6.0")`).
+* Update the [Usage](#usage) example in the [README](README.md) with the newly released version (e.g. `implementation("com.newrelic.telemetry:telemetry-core:0.6.0")`).
2. Update the release notes with the changelog details.
diff --git a/build.gradle.kts b/build.gradle.kts
index 14426944..e2d2b534 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -26,7 +26,7 @@ allprojects {
}
}
-listOf(":telemetry", ":telemetry-http-okhttp", ":telemetry-http-java11" , ":telemetry-all").forEach {
+listOf(":telemetry-http-okhttp", ":telemetry-http-java11" , ":telemetry-all").forEach {
project(it) {
apply(plugin = "java-library")
apply(plugin = "maven-publish")
diff --git a/settings.gradle.kts b/settings.gradle.kts
index 04f90930..c48deeaa 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -1,6 +1,5 @@
rootProject.name = "newrelic-telemetry-sdk-java"
-include (":telemetry")
include (":telemetry-all")
include (":telemetry_examples")
include (":telemetry-core")
diff --git a/telemetry-all/build.gradle.kts b/telemetry-all/build.gradle.kts
index 43b4472e..63f642e3 100644
--- a/telemetry-all/build.gradle.kts
+++ b/telemetry-all/build.gradle.kts
@@ -46,18 +46,12 @@ tasks.register("copySources") {
from ("../telemetry-core/src/main/java") {
into ("java")
}
- from ("../telemetry/src/main/java") {
- into ("java")
- }
from ("../telemetry-http-java11/src/main/java") {
into ("java")
}
from ("../telemetry-core/src/main/resources") {
into ("resources")
}
- from ("../telemetry/src/main/resources") {
- into ("resources")
- }
from ("../telemetry-http-java11/src/main/resources") {
into ("resources")
}
diff --git a/telemetry/src/main/java/com/newrelic/telemetry/Backoff.java b/telemetry-core/src/main/java/com/newrelic/telemetry/Backoff.java
similarity index 100%
rename from telemetry/src/main/java/com/newrelic/telemetry/Backoff.java
rename to telemetry-core/src/main/java/com/newrelic/telemetry/Backoff.java
diff --git a/telemetry/src/main/java/com/newrelic/telemetry/LimitingScheduler.java b/telemetry-core/src/main/java/com/newrelic/telemetry/LimitingScheduler.java
similarity index 100%
rename from telemetry/src/main/java/com/newrelic/telemetry/LimitingScheduler.java
rename to telemetry-core/src/main/java/com/newrelic/telemetry/LimitingScheduler.java
diff --git a/telemetry/src/main/java/com/newrelic/telemetry/LoggingNotificationHandler.java b/telemetry-core/src/main/java/com/newrelic/telemetry/LoggingNotificationHandler.java
similarity index 100%
rename from telemetry/src/main/java/com/newrelic/telemetry/LoggingNotificationHandler.java
rename to telemetry-core/src/main/java/com/newrelic/telemetry/LoggingNotificationHandler.java
diff --git a/telemetry/src/main/java/com/newrelic/telemetry/NotificationHandler.java b/telemetry-core/src/main/java/com/newrelic/telemetry/NotificationHandler.java
similarity index 100%
rename from telemetry/src/main/java/com/newrelic/telemetry/NotificationHandler.java
rename to telemetry-core/src/main/java/com/newrelic/telemetry/NotificationHandler.java
diff --git a/telemetry/src/main/java/com/newrelic/telemetry/TelemetryClient.java b/telemetry-core/src/main/java/com/newrelic/telemetry/TelemetryClient.java
similarity index 100%
rename from telemetry/src/main/java/com/newrelic/telemetry/TelemetryClient.java
rename to telemetry-core/src/main/java/com/newrelic/telemetry/TelemetryClient.java
diff --git a/telemetry/src/test/java/com/newrelic/telemetry/BackoffTest.java b/telemetry-core/src/test/java/com/newrelic/telemetry/BackoffTest.java
similarity index 100%
rename from telemetry/src/test/java/com/newrelic/telemetry/BackoffTest.java
rename to telemetry-core/src/test/java/com/newrelic/telemetry/BackoffTest.java
diff --git a/telemetry/src/test/java/com/newrelic/telemetry/LimitingSchedulerTest.java b/telemetry-core/src/test/java/com/newrelic/telemetry/LimitingSchedulerTest.java
similarity index 100%
rename from telemetry/src/test/java/com/newrelic/telemetry/LimitingSchedulerTest.java
rename to telemetry-core/src/test/java/com/newrelic/telemetry/LimitingSchedulerTest.java
diff --git a/telemetry/src/test/java/com/newrelic/telemetry/NotificationHandlerTest.java b/telemetry-core/src/test/java/com/newrelic/telemetry/NotificationHandlerTest.java
similarity index 100%
rename from telemetry/src/test/java/com/newrelic/telemetry/NotificationHandlerTest.java
rename to telemetry-core/src/test/java/com/newrelic/telemetry/NotificationHandlerTest.java
diff --git a/telemetry/src/test/java/com/newrelic/telemetry/TelemetryClientTest.java b/telemetry-core/src/test/java/com/newrelic/telemetry/TelemetryClientTest.java
similarity index 100%
rename from telemetry/src/test/java/com/newrelic/telemetry/TelemetryClientTest.java
rename to telemetry-core/src/test/java/com/newrelic/telemetry/TelemetryClientTest.java
diff --git a/telemetry-http-java11/build.gradle.kts b/telemetry-http-java11/build.gradle.kts
index b03b3d85..aba05be3 100644
--- a/telemetry-http-java11/build.gradle.kts
+++ b/telemetry-http-java11/build.gradle.kts
@@ -7,7 +7,6 @@ configure {
}
dependencies {
- implementation(project(":telemetry"))
api(project(":telemetry-core"))
testImplementation("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
diff --git a/telemetry-http-okhttp/build.gradle.kts b/telemetry-http-okhttp/build.gradle.kts
index ff94b072..fc87b8e6 100644
--- a/telemetry-http-okhttp/build.gradle.kts
+++ b/telemetry-http-okhttp/build.gradle.kts
@@ -8,7 +8,6 @@ configure {
}
dependencies {
- implementation(project(":telemetry"))
api(project(":telemetry-core"))
api("com.squareup.okhttp3:okhttp:${okhttpVersion}")
diff --git a/telemetry/README.md b/telemetry/README.md
deleted file mode 100644
index b2c7b33a..00000000
--- a/telemetry/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-### Telemetry Module
-
-This module provides high-level APIs for sending telemetry to New Relic.
-
-Javadoc can be found here: [![Javadocs][javadoc-image]][javadoc-url]
-
-See the `telemetry-examples` module for sample usage.
-
-This library can be consumed via the following maven coordinates:
-
-`com.newrelic.telemetry:telemetry`
-
-Since the underlying code that this depends on requires implementations for an HTTP client,
-you can get our reference implementations of the `HttpPoster` interface
-from the `telemetry-http-okhttp` module and library:
-
-`com.newrelic.telemetry:telemetry-http-okhttp`
-
-[javadoc-image]: https://www.javadoc.io/badge/com.newrelic.telemetry/telemetry.svg
-[javadoc-url]: https://www.javadoc.io/doc/com.newrelic.telemetry/telemetry
\ No newline at end of file
diff --git a/telemetry/build.gradle.kts b/telemetry/build.gradle.kts
deleted file mode 100644
index e2babe6d..00000000
--- a/telemetry/build.gradle.kts
+++ /dev/null
@@ -1,17 +0,0 @@
-val junitVersion: String by project
-val mockitoVersion: String by project
-val slf4jVersion: String by project
-
-configure {
- sourceCompatibility = JavaVersion.VERSION_1_8
- targetCompatibility = JavaVersion.VERSION_1_8
-}
-
-dependencies {
- api(project(":telemetry-core"))
-
- testImplementation("org.slf4j:slf4j-simple:${slf4jVersion}")
- testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")
- testImplementation("org.mockito:mockito-core:${mockitoVersion}")
- testImplementation("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
-}
\ No newline at end of file
diff --git a/telemetry_examples/build.gradle.kts b/telemetry_examples/build.gradle.kts
index 12c3b94f..f2d96cc0 100644
--- a/telemetry_examples/build.gradle.kts
+++ b/telemetry_examples/build.gradle.kts
@@ -16,7 +16,6 @@ plugins {
apply(plugin = "java-library")
dependencies {
- implementation(project(":telemetry"))
implementation(project(":telemetry-http-okhttp"))
implementation(project(":telemetry-http-java11"))
runtimeOnly("org.slf4j:slf4j-simple:${Versions.slf4j}")