Skip to content
Merged
487 changes: 487 additions & 0 deletions MIGRATION.md

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems duplicative of https://docs.cloud.google.com/trace/docs/migrate-to-otlp-endpoints

do we need both ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trace one is, but this document has a little more information. Eventually we plan to update https://docs.cloud.google.com/trace/docs/migrate-to-otlp-endpoints and have that as single source of truth.

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Open-Telemetry Operations Exporters for Java
# OpenTelemetry Operations Exporters for Java

> [!WARNING]
> **DEPRECATION NOTICE**: This project and all its published artifacts are deprecated. No new features will be added, and this repository may be archived in the future.\
Please refer to [Migration Guide](MIGRATION.md) for migration instructions to move to the standard OpenTelemetry exporters.

[![Maven Central][maven-image]][maven-url]

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ subprojects {
}
afterEvaluate {
// description is not available until evaluated.
description = project.description
description = "DEPRECATED: " + project.description
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.google.cloud.opentelemetry.auto;

@Deprecated
public class Constants {

static final String CLOUD_TRACE_NAME = "google_cloud_trace";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,20 @@
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
import io.opentelemetry.sdk.autoconfigure.spi.metrics.ConfigurableMetricExporterProvider;
import io.opentelemetry.sdk.metrics.export.MetricExporter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@AutoService(ConfigurableMetricExporterProvider.class)
@Deprecated
public class GoogleCloudMetricExporterFactory implements ConfigurableMetricExporterProvider {
private static final Logger logger =
LoggerFactory.getLogger(GoogleCloudMetricExporterFactory.class);

static {
logger.warn(
"Google Cloud OpenTelemetry Auto exporter for Java is deprecated and will be archived after September 30th, 2026. Please migrate to the OpenTelemetry OTLP exporters. For migration details, see https://github.com/GoogleCloudPlatform/opentelemetry-operations-java/blob/main/MIGRATION.md");
}

@Override
public MetricExporter createExporter(ConfigProperties config) {
return GoogleCloudMetricExporter.createWithDefaultConfiguration();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,19 @@
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
import io.opentelemetry.sdk.autoconfigure.spi.traces.ConfigurableSpanExporterProvider;
import io.opentelemetry.sdk.trace.export.SpanExporter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@AutoService(ConfigurableSpanExporterProvider.class)
@Deprecated
public class GoogleCloudSpanExporterFactory implements ConfigurableSpanExporterProvider {
private static final Logger logger =
LoggerFactory.getLogger(GoogleCloudSpanExporterFactory.class);

static {
logger.warn(
"Google Cloud OpenTelemetry Auto exporter for Java is deprecated and will be archived after September 30th, 2026. Please migrate to the OpenTelemetry OTLP exporters. For migration details, see https://github.com/GoogleCloudPlatform/opentelemetry-operations-java/blob/main/MIGRATION.md");
}

@Override
public SpanExporter createExporter(ConfigProperties config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
* Builds GCM TimeSeries from each OTEL metric point, creating metric descriptors based on the
* "first" seen point for any given metric.
*/
@Deprecated
public final class AggregateByLabelMetricTimeSeriesBuilder implements MetricTimeSeriesBuilder {

public static final String LABEL_INSTRUMENTATION_SOURCE =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.List;

/** Wrapper interface for writing to Google Cloud Monitoring. */
@Deprecated
public interface CloudMetricClient {
/**
* Construct a metric descriptor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.List;

/** Directly talks to Cloud Monitoring. */
@Deprecated
public final class CloudMetricClientImpl implements CloudMetricClient {
private final MetricServiceClient metricServiceClient;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,15 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Deprecated
public class GoogleCloudMetricExporter implements MetricExporter {
private static final Logger logger = LoggerFactory.getLogger(GoogleCloudMetricExporter.class);

static {
logger.warn(
"Google Cloud OpenTelemetry Metric exporter for Java is deprecated and will be archived after September 30th, 2026. Please migrate to the OpenTelemetry OTLP exporters. For migration details, see https://github.com/GoogleCloudPlatform/opentelemetry-operations-java/blob/main/MIGRATION.md");
}

private final Supplier<MetricExporter> internalMetricExporterSupplier;

private GoogleCloudMetricExporter(MetricConfiguration configuration) {
Expand Down Expand Up @@ -64,6 +70,7 @@ private GoogleCloudMetricExporter(MetricConfiguration configuration) {
* which gets initialized lazily once {@link GoogleCloudMetricExporter#export(Collection)} is
* called.
*/
@Deprecated
public static MetricExporter createWithDefaultConfiguration() {
return new GoogleCloudMetricExporter(MetricConfiguration.builder().build());
}
Expand All @@ -81,6 +88,7 @@ public static MetricExporter createWithDefaultConfiguration() {
* preferences for metrics.
* @return An instance of {@link GoogleCloudMetricExporter} as a {@link MetricExporter} object.
*/
@Deprecated
public static MetricExporter createWithConfiguration(MetricConfiguration configuration) {
return new GoogleCloudMetricExporter(configuration);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
*/
@AutoValue
@Immutable
@Deprecated
public abstract class MetricConfiguration {
static final String DEFAULT_PREFIX = "workload.googleapis.com";

Expand Down Expand Up @@ -224,6 +225,7 @@ public static Builder builder() {

/** Builder for {@link MetricConfiguration}. */
@AutoValue.Builder
@Deprecated
public abstract static class Builder {

Builder() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.util.function.Consumer;

/** The strategy for how to handle metric descriptors. */
@Deprecated
public interface MetricDescriptorStrategy {
/**
* Determines what to do with metric descriptors.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.List;

/** An interface that denotes how we build our API calls from metric data. */
@Deprecated
public interface MetricTimeSeriesBuilder {
/** Records a LongPoint of the given metric. */
void recordPoint(MetricData metric, LongPointData point);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import org.slf4j.LoggerFactory;

/** Utility methods to translate metrics from OTEL to GCM format. */
@Deprecated
public final class MetricTranslator {

private static final Logger logger = LoggerFactory.getLogger(MetricTranslator.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* identifying the given monitored resource type.
*/
@Immutable
@Deprecated
public final class MonitoredResourceDescription {
private final String mrType;
private final Set<String> mrLabels;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.logging.Logger;

/** Translates from OpenTelemetry Resource into Google Cloud Monitoring's MonitoredResource. */
@Deprecated
public class ResourceTranslator {
private static final String CUSTOM_MR_KEY = "gcp.resource_type";
private static final Logger LOGGER =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.google.devtools.cloudtrace.v2.Span;
import java.util.List;

@Deprecated
public interface CloudTraceClient {
void batchWriteSpans(ProjectName name, List<Span> spans);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.google.devtools.cloudtrace.v2.Span;
import java.util.List;

@Deprecated
public class CloudTraceClientImpl implements CloudTraceClient {
private final TraceServiceClient traceServiceClient;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
/** Configurations for {@link TraceExporter}. */
@AutoValue
@Immutable
@Deprecated
public abstract class TraceConfiguration {

@VisibleForTesting static final Duration DEFAULT_DEADLINE = Duration.ofSeconds(10, 0);
Expand Down Expand Up @@ -149,6 +150,7 @@ public static Builder builder() {

/** Builder for {@link TraceConfiguration}. */
@AutoValue.Builder
@Deprecated
public abstract static class Builder {

@VisibleForTesting static final Duration ZERO = Duration.ZERO;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,16 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Deprecated
public class TraceExporter implements SpanExporter {

private static final Logger logger = LoggerFactory.getLogger(TraceExporter.class);

static {
logger.warn(
"Google Cloud OpenTelemetry Trace exporter for Java is deprecated and will be archived after September 30th, 2026. Please migrate to the OpenTelemetry OTLP exporters. For migration details, see https://github.com/GoogleCloudPlatform/opentelemetry-operations-java/blob/main/MIGRATION.md");
}

private final Supplier<SpanExporter> internalTraceExporterSupplier;

private TraceExporter(TraceConfiguration configuration) {
Expand Down Expand Up @@ -62,6 +68,7 @@ private TraceExporter(TraceConfiguration configuration) {
* @return A configured instance of {@link TraceExporter} which gets initialized lazily once
* {@link TraceExporter#export(Collection)} is called.
*/
@Deprecated
public static SpanExporter createWithDefaultConfiguration() {
return new TraceExporter(TraceConfiguration.builder().build());
}
Expand All @@ -79,6 +86,7 @@ public static SpanExporter createWithDefaultConfiguration() {
* for trace.
* @return An instance of {@link TraceExporter} as a {@link SpanExporter} object
*/
@Deprecated
public static SpanExporter createWithConfiguration(TraceConfiguration configuration) {
return new TraceExporter(configuration);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import javax.annotation.Nullable;

/** Helper to grab version numbers from builds. */
@Deprecated
public class TraceVersions {

public static final String SDK_VERSION = readSdkVersion();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
* propagation.
*/
@AutoService(ConfigurablePropagatorProvider.class)
@Deprecated
public class OneWayXCloudTraceConfigurablePropagatorProvider
implements ConfigurablePropagatorProvider {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
* @see OneWayXCloudTraceConfigurablePropagatorProvider
*/
@AutoService(ConfigurablePropagatorProvider.class)
@Deprecated
public class XCloudTraceConfigurablePropagatorProvider implements ConfigurablePropagatorProvider {
@Override
public TextMapPropagator getPropagator(ConfigProperties config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* <p>See: <a href="https://cloud.google.com/trace/docs/setup#force-trace">Google Cloud Trace
* Documentation</a> for details.
*/
@Deprecated
public final class XCloudTraceContextPropagator implements TextMapPropagator {

private static final String FIELD = "x-cloud-trace-context";
Expand All @@ -53,7 +54,10 @@ public final class XCloudTraceContextPropagator implements TextMapPropagator {
*
* @param oneway boolean to configure if the trace should propagate in a single direction.
*/
@Deprecated
public XCloudTraceContextPropagator(boolean oneway) {
LOGGER.warning(
"XCloudTraceContextPropagator is deprecated and will be removed in a future release.");
this.oneway = oneway;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* <p>Unlike pure OpenTelemetry, GCP adds a "type" to a raw bundle of labels.
*/
@AutoValue
@Deprecated
public abstract class GcpResource {
/** The type of resource, e.g. gce_instance. */
public abstract String getResourceType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* Guice for collections.
*/
@AutoValue
@Deprecated
public abstract class ResourceLabels {
public abstract Map<String, String> getLabels();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.util.Optional;

/** Translates from OpenTelemetry Resource into Google Cloud's notion of resource. */
@Deprecated
public class ResourceTranslator {

private static final String UNKNOWN_SERVICE_PREFIX = "unknown_service";
Expand Down
Loading