Skip to content

Commit 5f94bb5

Browse files
committed
spotless
1 parent d2db75d commit 5f94bb5

File tree

26 files changed

+171
-106
lines changed

26 files changed

+171
-106
lines changed

exporters/common/src/main/java/io/opentelemetry/exporter/internal/grpc/GrpcExporter.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
import io.opentelemetry.api.common.Attributes;
1212
import io.opentelemetry.api.metrics.MeterProvider;
13-
import io.opentelemetry.exporter.internal.metrics.ExporterInstrumentation;
1413
import io.opentelemetry.exporter.internal.FailedExportException;
1514
import io.opentelemetry.exporter.internal.marshal.Marshaler;
15+
import io.opentelemetry.exporter.internal.metrics.ExporterInstrumentation;
1616
import io.opentelemetry.sdk.common.CompletableResultCode;
1717
import io.opentelemetry.sdk.common.InternalTelemetrySchemaVersion;
1818
import io.opentelemetry.sdk.internal.ComponentId;
@@ -59,8 +59,7 @@ public GrpcExporter(
5959
meterProviderSupplier,
6060
componentId,
6161
exporterType,
62-
healthMetricAttributes
63-
);
62+
healthMetricAttributes);
6463
}
6564

6665
public CompletableResultCode export(T exportRequest, int numItems) {
@@ -129,7 +128,9 @@ private void onResponse(
129128
}
130129

131130
private void onError(
132-
CompletableResultCode result, ExporterInstrumentation.Recording metricRecording, Throwable e) {
131+
CompletableResultCode result,
132+
ExporterInstrumentation.Recording metricRecording,
133+
Throwable e) {
133134
metricRecording.finishFailed(e, Attributes.empty());
134135
logger.log(
135136
Level.SEVERE,

exporters/common/src/main/java/io/opentelemetry/exporter/internal/grpc/GrpcExporterBuilder.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ public class GrpcExporterBuilder<T extends Marshaler> {
6565
private TlsConfigHelper tlsConfigHelper = new TlsConfigHelper();
6666
@Nullable private RetryPolicy retryPolicy = RetryPolicy.getDefault();
6767
private Supplier<MeterProvider> meterProviderSupplier = GlobalOpenTelemetry::getMeterProvider;
68-
private InternalTelemetrySchemaVersion internalTelemetrySchemaVersion = InternalTelemetrySchemaVersion.LEGACY;
68+
private InternalTelemetrySchemaVersion internalTelemetrySchemaVersion =
69+
InternalTelemetrySchemaVersion.LEGACY;
6970

7071
private ClassLoader serviceClassLoader = GrpcExporterBuilder.class.getClassLoader();
7172
@Nullable private ExecutorService executorService;

exporters/common/src/main/java/io/opentelemetry/exporter/internal/http/HttpExporter.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
import io.opentelemetry.api.common.Attributes;
99
import io.opentelemetry.api.metrics.MeterProvider;
10-
import io.opentelemetry.exporter.internal.metrics.ExporterInstrumentation;
1110
import io.opentelemetry.exporter.internal.FailedExportException;
1211
import io.opentelemetry.exporter.internal.grpc.GrpcExporterUtil;
1312
import io.opentelemetry.exporter.internal.marshal.Marshaler;
13+
import io.opentelemetry.exporter.internal.metrics.ExporterInstrumentation;
1414
import io.opentelemetry.sdk.common.CompletableResultCode;
1515
import io.opentelemetry.sdk.common.InternalTelemetrySchemaVersion;
1616
import io.opentelemetry.sdk.internal.ComponentId;
@@ -56,8 +56,7 @@ public HttpExporter(
5656
meterProviderSupplier,
5757
componentId,
5858
exporterType,
59-
healthMetricAttributes
60-
);
59+
healthMetricAttributes);
6160
}
6261

6362
public CompletableResultCode export(T exportRequest, int numItems) {
@@ -118,7 +117,9 @@ private void onResponse(
118117
}
119118

120119
private void onError(
121-
CompletableResultCode result, ExporterInstrumentation.Recording metricRecording, Throwable e) {
120+
CompletableResultCode result,
121+
ExporterInstrumentation.Recording metricRecording,
122+
Throwable e) {
122123
metricRecording.finishFailed(e, Attributes.empty());
123124
logger.log(
124125
Level.SEVERE,

exporters/common/src/main/java/io/opentelemetry/exporter/internal/http/HttpExporterBuilder.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ public final class HttpExporterBuilder<T extends Marshaler> {
6363
private TlsConfigHelper tlsConfigHelper = new TlsConfigHelper();
6464
@Nullable private RetryPolicy retryPolicy = RetryPolicy.getDefault();
6565
private Supplier<MeterProvider> meterProviderSupplier = GlobalOpenTelemetry::getMeterProvider;
66-
private InternalTelemetrySchemaVersion internalTelemetrySchemaVersion = InternalTelemetrySchemaVersion.LEGACY;
66+
private InternalTelemetrySchemaVersion internalTelemetrySchemaVersion =
67+
InternalTelemetrySchemaVersion.LEGACY;
6768
private ClassLoader serviceClassLoader = HttpExporterBuilder.class.getClassLoader();
6869
@Nullable private ExecutorService executorService;
6970

7071
public HttpExporterBuilder(
71-
ComponentId.StandardExporterType exporterType,
72-
String defaultEndpoint) {
72+
ComponentId.StandardExporterType exporterType, String defaultEndpoint) {
7373
this.exporterType = exporterType;
7474

7575
endpoint = defaultEndpoint;
@@ -176,8 +176,7 @@ private static ComponentId.StandardExporterType mapToJsonTypeIfPossible(
176176

177177
@SuppressWarnings("BuilderReturnThis")
178178
public HttpExporterBuilder<T> copy() {
179-
HttpExporterBuilder<T> copy =
180-
new HttpExporterBuilder<>(exporterType, endpoint);
179+
HttpExporterBuilder<T> copy = new HttpExporterBuilder<>(exporterType, endpoint);
181180
copy.endpoint = endpoint;
182181
copy.timeoutNanos = timeoutNanos;
183182
copy.connectTimeoutNanos = connectTimeoutNanos;

exporters/common/src/main/java/io/opentelemetry/exporter/internal/metrics/ExporterInstrumentation.java

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
import javax.annotation.Nullable;
1414

1515
/**
16-
* This class is internal and is hence not for public use. Its APIs are unstable and can change
17-
* at any time.
16+
* This class is internal and is hence not for public use. Its APIs are unstable and can change at
17+
* any time.
1818
*/
1919
public class ExporterInstrumentation implements ExporterMetrics {
2020

@@ -32,11 +32,19 @@ public ExporterInstrumentation(
3232
implementation = NoopExporterMetrics.INSTANCE;
3333
break;
3434
case LEGACY:
35-
implementation = LegacyExporterMetrics.isSupportedType(exporterType) ? new LegacyExporterMetrics(meterProviderSupplier,exporterType) : NoopExporterMetrics.INSTANCE;
35+
implementation =
36+
LegacyExporterMetrics.isSupportedType(exporterType)
37+
? new LegacyExporterMetrics(meterProviderSupplier, exporterType)
38+
: NoopExporterMetrics.INSTANCE;
3639
break;
3740
case V1_33:
3841
case LATEST:
39-
implementation = new SemConvExporterMetrics(meterProviderSupplier, exporterType.signal(), componentId, additionalAttributes == null ? Attributes.empty() : additionalAttributes);
42+
implementation =
43+
new SemConvExporterMetrics(
44+
meterProviderSupplier,
45+
exporterType.signal(),
46+
componentId,
47+
additionalAttributes == null ? Attributes.empty() : additionalAttributes);
4048
break;
4149
default:
4250
throw new IllegalStateException("Unhandled case: " + schema);
@@ -49,8 +57,8 @@ public Recording startRecordingExport(int itemCount) {
4957
}
5058

5159
/**
52-
* This class is internal and is hence not for public use. Its APIs are unstable and can change
53-
* at any time.
60+
* This class is internal and is hence not for public use. Its APIs are unstable and can change at
61+
* any time.
5462
*/
5563
public static class Recording extends ExporterMetrics.Recording {
5664

@@ -61,7 +69,8 @@ private Recording(ExporterMetrics.Recording delegate) {
6169
}
6270

6371
/**
64-
* Callback to notify that the export has failed with the given {@link Throwable} as failure cause.
72+
* Callback to notify that the export has failed with the given {@link Throwable} as failure
73+
* cause.
6574
*
6675
* @param failureCause the cause of the failure
6776
* @param requestAttributes additional attributes to add to request metrics

exporters/common/src/main/java/io/opentelemetry/exporter/internal/metrics/ExporterMetrics.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
package io.opentelemetry.exporter.internal.metrics;
27

38
import io.opentelemetry.api.common.Attributes;
@@ -55,7 +60,8 @@ private void ensureEndedOnce() {
5560
/**
5661
* Invoked when the export has finished, either successfully or failed.
5762
*
58-
* @param errorType null if the export was successful, otherwise a failure reason suitable for the error.type attribute
63+
* @param errorType null if the export was successful, otherwise a failure reason suitable for
64+
* the error.type attribute
5965
* @param requestAttributes additional attributes to add to request metrics
6066
*/
6167
protected abstract void doFinish(@Nullable String errorType, Attributes requestAttributes);

exporters/common/src/main/java/io/opentelemetry/exporter/internal/metrics/LegacyExporterMetrics.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
import javax.annotation.Nullable;
1919

2020
/**
21-
* Implements health metrics for exporters which were defined prior to the standardization in semantic conventions.
21+
* Implements health metrics for exporters which were defined prior to the standardization in
22+
* semantic conventions.
2223
*
2324
* <p>This class is internal and is hence not for public use. Its APIs are unstable and can change
2425
* at any time.
@@ -43,12 +44,12 @@ public class LegacyExporterMetrics implements ExporterMetrics {
4344

4445
LegacyExporterMetrics(
4546
Supplier<MeterProvider> meterProviderSupplier,
46-
ComponentId.StandardExporterType exporterType
47-
) {
47+
ComponentId.StandardExporterType exporterType) {
4848
this.meterProviderSupplier = meterProviderSupplier;
4949
this.exporterName = getExporterName(exporterType);
5050
this.transportName = getTransportName(exporterType);
51-
this.seenAttrs = Attributes.builder().put(ATTRIBUTE_KEY_TYPE, getTypeString(exporterType.signal())).build();
51+
this.seenAttrs =
52+
Attributes.builder().put(ATTRIBUTE_KEY_TYPE, getTypeString(exporterType.signal())).build();
5253
this.successAttrs = this.seenAttrs.toBuilder().put(ATTRIBUTE_KEY_SUCCESS, true).build();
5354
this.failedAttrs = this.seenAttrs.toBuilder().put(ATTRIBUTE_KEY_SUCCESS, false).build();
5455
}

exporters/common/src/main/java/io/opentelemetry/exporter/internal/metrics/NoopExporterMetrics.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
package io.opentelemetry.exporter.internal.metrics;
27

38
import io.opentelemetry.api.common.Attributes;
@@ -17,6 +22,6 @@ private static class NoopRecording extends Recording {
1722
private static final NoopRecording INSTANCE = new NoopRecording();
1823

1924
@Override
20-
protected void doFinish(@Nullable String errorType, Attributes requestAttributes) { }
25+
protected void doFinish(@Nullable String errorType, Attributes requestAttributes) {}
2126
}
2227
}

exporters/common/src/main/java/io/opentelemetry/exporter/internal/metrics/SemConvExporterMetrics.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ public SemConvExporterMetrics(
4848
this.additionalAttributes = additionalAttributes;
4949
}
5050

51-
5251
@Override
5352
public ExporterMetrics.Recording startRecordingExport(int itemCount) {
5453
return new Recording(itemCount);
@@ -97,7 +96,6 @@ private Attributes allAttributes() {
9796
return allAttributes;
9897
}
9998

100-
10199
private LongUpDownCounter inflight() {
102100
LongUpDownCounter inflight = this.inflight;
103101
if (inflight == null || isNoop(inflight)) {

exporters/common/src/test/java/io/opentelemetry/exporter/internal/grpc/GrpcExporterBuilderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
import io.opentelemetry.exporter.internal.compression.GzipCompressor;
1111
import io.opentelemetry.exporter.internal.marshal.Marshaler;
12-
import java.net.URI;
1312
import io.opentelemetry.sdk.internal.ComponentId;
13+
import java.net.URI;
1414
import org.junit.jupiter.api.BeforeEach;
1515
import org.junit.jupiter.api.Test;
1616

0 commit comments

Comments
 (0)