-
Notifications
You must be signed in to change notification settings - Fork 879
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move experimental things out of public api
- Loading branch information
Showing
22 changed files
with
611 additions
and
0 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
51 changes: 51 additions & 0 deletions
51
...in/java/io/opentelemetry/instrumentation/apachehttpclient/v4_3/internal/Experimental.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,51 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.instrumentation.apachehttpclient.v4_3.internal; | ||
|
||
import static java.util.logging.Level.FINE; | ||
|
||
import io.opentelemetry.instrumentation.apachehttpclient.v4_3.ApacheHttpClientTelemetryBuilder; | ||
import java.lang.reflect.InvocationTargetException; | ||
import java.lang.reflect.Method; | ||
import java.util.logging.Logger; | ||
import javax.annotation.Nullable; | ||
|
||
/** | ||
* This class is internal and is hence not for public use. Its APIs are unstable and can change at | ||
* any time. | ||
*/ | ||
// TODO (trask) update the above javadoc similar to | ||
// https://github.com/open-telemetry/opentelemetry-java/pull/6886 | ||
public class Experimental { | ||
|
||
private static final Logger logger = Logger.getLogger(Experimental.class.getName()); | ||
|
||
@Nullable | ||
private static final Method emitExperimentalHttpClientMetricsMethod = | ||
getEmitExperimentalHttpClientMetricsMethod(); | ||
|
||
static Method getEmitExperimentalHttpClientMetricsMethod() { | ||
try { | ||
return ApacheHttpClientTelemetryBuilder.class.getMethod( | ||
"setEmitExperimentalHttpClientMetrics", boolean.class); | ||
} catch (NoSuchMethodException e) { | ||
logger.log(FINE, e.getMessage(), e); | ||
return null; | ||
} | ||
} | ||
|
||
public void setEmitExperimentalHttpClientMetrics( | ||
ApacheHttpClientTelemetryBuilder builder, boolean emitExperimentalHttpClientMetrics) { | ||
|
||
if (emitExperimentalHttpClientMetricsMethod != null) { | ||
try { | ||
emitExperimentalHttpClientMetricsMethod.invoke(builder, emitExperimentalHttpClientMetrics); | ||
} catch (IllegalAccessException | InvocationTargetException e) { | ||
logger.log(FINE, e.getMessage(), e); | ||
} | ||
} | ||
} | ||
} |
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
51 changes: 51 additions & 0 deletions
51
...in/java/io/opentelemetry/instrumentation/apachehttpclient/v5_2/internal/Experimental.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,51 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.instrumentation.apachehttpclient.v5_2.internal; | ||
|
||
import static java.util.logging.Level.FINE; | ||
|
||
import io.opentelemetry.instrumentation.apachehttpclient.v5_2.ApacheHttpClient5TelemetryBuilder; | ||
import java.lang.reflect.InvocationTargetException; | ||
import java.lang.reflect.Method; | ||
import java.util.logging.Logger; | ||
import javax.annotation.Nullable; | ||
|
||
/** | ||
* This class is internal and is hence not for public use. Its APIs are unstable and can change at | ||
* any time. | ||
*/ | ||
// TODO (trask) update the above javadoc similar to | ||
// https://github.com/open-telemetry/opentelemetry-java/pull/6886 | ||
public class Experimental { | ||
|
||
private static final Logger logger = Logger.getLogger(Experimental.class.getName()); | ||
|
||
@Nullable | ||
private static final Method emitExperimentalHttpClientMetricsMethod = | ||
getEmitExperimentalHttpClientMetricsMethod(); | ||
|
||
static Method getEmitExperimentalHttpClientMetricsMethod() { | ||
try { | ||
return ApacheHttpClient5TelemetryBuilder.class.getMethod( | ||
"setEmitExperimentalHttpClientMetrics", boolean.class); | ||
} catch (NoSuchMethodException e) { | ||
logger.log(FINE, e.getMessage(), e); | ||
return null; | ||
} | ||
} | ||
|
||
public void setEmitExperimentalHttpClientMetrics( | ||
ApacheHttpClient5TelemetryBuilder builder, boolean emitExperimentalHttpClientMetrics) { | ||
|
||
if (emitExperimentalHttpClientMetricsMethod != null) { | ||
try { | ||
emitExperimentalHttpClientMetricsMethod.invoke(builder, emitExperimentalHttpClientMetrics); | ||
} catch (IllegalAccessException | InvocationTargetException e) { | ||
logger.log(FINE, e.getMessage(), e); | ||
} | ||
} | ||
} | ||
} |
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
51 changes: 51 additions & 0 deletions
51
...ry/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/internal/Experimental.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,51 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.instrumentation.armeria.v1_3.internal; | ||
|
||
import static java.util.logging.Level.FINE; | ||
|
||
import io.opentelemetry.instrumentation.armeria.v1_3.ArmeriaTelemetryBuilder; | ||
import java.lang.reflect.InvocationTargetException; | ||
import java.lang.reflect.Method; | ||
import java.util.logging.Logger; | ||
import javax.annotation.Nullable; | ||
|
||
/** | ||
* This class is internal and is hence not for public use. Its APIs are unstable and can change at | ||
* any time. | ||
*/ | ||
// TODO (trask) update the above javadoc similar to | ||
// https://github.com/open-telemetry/opentelemetry-java/pull/6886 | ||
public class Experimental { | ||
|
||
private static final Logger logger = Logger.getLogger(Experimental.class.getName()); | ||
|
||
@Nullable | ||
private static final Method emitExperimentalHttpClientMetricsMethod = | ||
getEmitExperimentalHttpClientMetricsMethod(); | ||
|
||
static Method getEmitExperimentalHttpClientMetricsMethod() { | ||
try { | ||
return ArmeriaTelemetryBuilder.class.getMethod( | ||
"setEmitExperimentalHttpClientMetrics", boolean.class); | ||
} catch (NoSuchMethodException e) { | ||
logger.log(FINE, e.getMessage(), e); | ||
return null; | ||
} | ||
} | ||
|
||
public void setEmitExperimentalHttpClientMetrics( | ||
ArmeriaTelemetryBuilder builder, boolean emitExperimentalHttpClientMetrics) { | ||
|
||
if (emitExperimentalHttpClientMetricsMethod != null) { | ||
try { | ||
emitExperimentalHttpClientMetricsMethod.invoke(builder, emitExperimentalHttpClientMetrics); | ||
} catch (IllegalAccessException | InvocationTargetException e) { | ||
logger.log(FINE, e.getMessage(), e); | ||
} | ||
} | ||
} | ||
} |
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
51 changes: 51 additions & 0 deletions
51
...rary/src/main/java/io/opentelemetry/instrumentation/httpclient/internal/Experimental.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,51 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.instrumentation.httpclient.internal; | ||
|
||
import static java.util.logging.Level.FINE; | ||
|
||
import io.opentelemetry.instrumentation.httpclient.JavaHttpClientTelemetryBuilder; | ||
import java.lang.reflect.InvocationTargetException; | ||
import java.lang.reflect.Method; | ||
import java.util.logging.Logger; | ||
import javax.annotation.Nullable; | ||
|
||
/** | ||
* This class is internal and is hence not for public use. Its APIs are unstable and can change at | ||
* any time. | ||
*/ | ||
// TODO (trask) update the above javadoc similar to | ||
// https://github.com/open-telemetry/opentelemetry-java/pull/6886 | ||
public class Experimental { | ||
|
||
private static final Logger logger = Logger.getLogger(Experimental.class.getName()); | ||
|
||
@Nullable | ||
private static final Method emitExperimentalHttpClientMetricsMethod = | ||
getEmitExperimentalHttpClientMetricsMethod(); | ||
|
||
static Method getEmitExperimentalHttpClientMetricsMethod() { | ||
try { | ||
return JavaHttpClientTelemetryBuilder.class.getMethod( | ||
"setEmitExperimentalHttpClientMetrics", boolean.class); | ||
} catch (NoSuchMethodException e) { | ||
logger.log(FINE, e.getMessage(), e); | ||
return null; | ||
} | ||
} | ||
|
||
public void setEmitExperimentalHttpClientMetrics( | ||
JavaHttpClientTelemetryBuilder builder, boolean emitExperimentalHttpClientMetrics) { | ||
|
||
if (emitExperimentalHttpClientMetricsMethod != null) { | ||
try { | ||
emitExperimentalHttpClientMetricsMethod.invoke(builder, emitExperimentalHttpClientMetrics); | ||
} catch (IllegalAccessException | InvocationTargetException e) { | ||
logger.log(FINE, e.getMessage(), e); | ||
} | ||
} | ||
} | ||
} |
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
51 changes: 51 additions & 0 deletions
51
...n/java/io/opentelemetry/instrumentation/jetty/httpclient/v12_0/internal/Experimental.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,51 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.instrumentation.jetty.httpclient.v12_0.internal; | ||
|
||
import static java.util.logging.Level.FINE; | ||
|
||
import io.opentelemetry.instrumentation.jetty.httpclient.v12_0.JettyClientTelemetryBuilder; | ||
import java.lang.reflect.InvocationTargetException; | ||
import java.lang.reflect.Method; | ||
import java.util.logging.Logger; | ||
import javax.annotation.Nullable; | ||
|
||
/** | ||
* This class is internal and is hence not for public use. Its APIs are unstable and can change at | ||
* any time. | ||
*/ | ||
// TODO (trask) update the above javadoc similar to | ||
// https://github.com/open-telemetry/opentelemetry-java/pull/6886 | ||
public class Experimental { | ||
|
||
private static final Logger logger = Logger.getLogger(Experimental.class.getName()); | ||
|
||
@Nullable | ||
private static final Method emitExperimentalHttpClientMetricsMethod = | ||
getEmitExperimentalHttpClientMetricsMethod(); | ||
|
||
static Method getEmitExperimentalHttpClientMetricsMethod() { | ||
try { | ||
return JettyClientTelemetryBuilder.class.getMethod( | ||
"setEmitExperimentalHttpClientMetrics", boolean.class); | ||
} catch (NoSuchMethodException e) { | ||
logger.log(FINE, e.getMessage(), e); | ||
return null; | ||
} | ||
} | ||
|
||
public void setEmitExperimentalHttpClientMetrics( | ||
JettyClientTelemetryBuilder builder, boolean emitExperimentalHttpClientMetrics) { | ||
|
||
if (emitExperimentalHttpClientMetricsMethod != null) { | ||
try { | ||
emitExperimentalHttpClientMetricsMethod.invoke(builder, emitExperimentalHttpClientMetrics); | ||
} catch (IllegalAccessException | InvocationTargetException e) { | ||
logger.log(FINE, e.getMessage(), e); | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.