Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JaegerRemoteSampler use upstream grpc implementation if ManagedChannel is set #5287

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,17 @@

package io.opentelemetry.sdk.extension.trace.jaeger.sampler;

import io.grpc.ManagedChannel;
import io.opentelemetry.exporter.internal.grpc.GrpcExporterBuilder;
import io.opentelemetry.exporter.internal.grpc.MarshalerServiceStub;
import io.opentelemetry.exporter.internal.marshal.Marshaler;
import io.opentelemetry.sdk.common.CompletableResultCode;
import java.net.URI;
import java.util.function.Function;
import java.util.function.Supplier;

interface GrpcService<ReqMarshalerT extends Marshaler, ResUnMarshalerT extends UnMarshaler> {

/** Returns a new {@link GrpcExporterBuilder}. */
static <ReqMarshalerT extends Marshaler, ResUnMarshalerT extends UnMarshaler>
GrpcServiceBuilder<ReqMarshalerT, ResUnMarshalerT> builder(
String type,
long defaultTimeoutSecs,
URI defaultEndpoint,
Supplier<
Function<ManagedChannel, MarshalerServiceStub<ReqMarshalerT, ResUnMarshalerT, ?>>>
stubFactory,
String grpcServiceName,
String grpcEndpointPath) {
return GrpcServiceUtil.serviceBuilder(
type, defaultTimeoutSecs, defaultEndpoint, stubFactory, grpcServiceName, grpcEndpointPath);
}
interface GrpcService {

/**
* Exports the {@code exportRequest} which is a request {@link Marshaler} for {@code numItems}
* items.
*/
ResUnMarshalerT execute(ReqMarshalerT request, ResUnMarshalerT response);
SamplingStrategyResponseUnMarshaler execute(
SamplingStrategyParametersMarshaler request, SamplingStrategyResponseUnMarshaler response);

/** Shuts the exporter down. */
CompletableResultCode shutdown();
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,10 @@ public final class JaegerRemoteSampler implements Sampler, Closeable {

private volatile Sampler sampler;

private final GrpcService<
SamplingStrategyParametersMarshaler, SamplingStrategyResponseUnMarshaler>
delegate;
private final GrpcService delegate;

JaegerRemoteSampler(
GrpcService<SamplingStrategyParametersMarshaler, SamplingStrategyResponseUnMarshaler>
delegate,
GrpcService delegate,
@Nullable String serviceName,
int pollingIntervalMs,
Sampler initialSampler) {
Expand Down
Loading