Skip to content

Commit

Permalink
Code refinement to remove IDE warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ligangty committed Sep 26, 2023
1 parent 9916c19 commit 9804e27
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,26 @@
import org.slf4j.LoggerFactory;

import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import static org.commonjava.o11yphant.metrics.RequestContextConstants.*;
import static org.commonjava.o11yphant.metrics.RequestContextConstants.CLIENT_ADDR;
import static org.commonjava.o11yphant.metrics.RequestContextConstants.CONTENT_TRACKING_ID;
import static org.commonjava.o11yphant.metrics.RequestContextConstants.HTTP_METHOD;
import static org.commonjava.o11yphant.metrics.RequestContextConstants.HTTP_STATUS;
import static org.commonjava.o11yphant.metrics.RequestContextConstants.PACKAGE_TYPE;
import static org.commonjava.o11yphant.metrics.RequestContextConstants.PATH;
import static org.commonjava.o11yphant.metrics.RequestContextConstants.REQUEST_LATENCY_MILLIS;
import static org.commonjava.o11yphant.metrics.RequestContextConstants.REST_ENDPOINT_PATH;

public interface TracerConfiguration
{
Integer DEFAULT_BASE_SAMPLE_RATE = 100;

Set<String> DEFAULT_FIELDS = Collections.unmodifiableSet(
new HashSet<>( Arrays.asList( CONTENT_TRACKING_ID, HTTP_METHOD, HTTP_STATUS, CLIENT_ADDR,
PATH, PACKAGE_TYPE, REST_ENDPOINT_PATH, REQUEST_LATENCY_MILLIS ) ) );
Set<String> DEFAULT_FIELDS =
Set.of( CONTENT_TRACKING_ID, HTTP_METHOD, HTTP_STATUS, CLIENT_ADDR, PATH, PACKAGE_TYPE, REST_ENDPOINT_PATH,
REQUEST_LATENCY_MILLIS );

boolean isEnabled();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public class FlatTraceMeasureInterceptor
@Inject
private TracerConfiguration config;

@SuppressWarnings( "rawtypes" )
@Inject
private TraceManager traceManager;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public class FlatTraceWrapperEndInterceptor
@Inject
private TracerConfiguration config;

@SuppressWarnings( "rawtypes" )
@Inject
private TraceManager traceManager;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public class FlatTraceWrapperInterceptor
@Inject
private TracerConfiguration config;

@SuppressWarnings( "rawtypes" )
@Inject
private TraceManager traceManager;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public class FlatTraceWrapperStartInterceptor
@Inject
private TracerConfiguration config;

@SuppressWarnings( "rawtypes" )
@Inject
private TraceManager traceManager;

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

@SuppressWarnings( "rawtypes" )
public class SpanningHttpFactory
implements HttpFactoryIfc
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
public class TraceFilter
implements Filter
{
@SuppressWarnings( "rawtypes" )
@Inject
private TraceManager traceManager;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import io.opentelemetry.api.common.AttributesBuilder;
import io.opentelemetry.api.trace.propagation.W3CTraceContextPropagator;
import io.opentelemetry.context.propagation.ContextPropagators;
import io.opentelemetry.context.propagation.TextMapPropagator;
import io.opentelemetry.exporter.logging.LoggingSpanExporter;
import io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter;
import io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporterBuilder;
Expand Down

0 comments on commit 9804e27

Please sign in to comment.