gRPC Sender Help #223
-
I'm trying to get a .NET Core application to use the gRPC Sender in this library to bypass the Jaeger Agent and go straight to the Collector via gRPC. I already have an Agent working and a Collector where the Agent is communicating to the Collector via gRPC and using Mutual TLS (mTLS) but now I am trying to bypass the Agent and use mTLS straight to the Collector via gRPC. I have my own configuration mechanism and do not use environment variables so I am manually setting up my gRPC Sender in my ChannelCredentials grpcCredentials = new MutualTlsChannelCredentials(tracingOptions);
sender = new Jaeger.Senders.Grpc.GrpcSender(tracingOptions.CollectorEndpoint, grpcCredentials, (int)tracingOptions.MaxPayloadSize);
var reporter = new RemoteReporter.Builder()
.WithMetrics(metrics)
.WithLoggerFactory(loggerFactory)
.WithSender(sender)
.Build();
var initialSampler = new ConstSampler(true);
var sampler = new RemoteControlledSampler.Builder(serviceName)
.WithMetrics(metrics)
.WithLoggerFactory(loggerFactory) // optional, defaults to no logging
.WithInitialSampler(initialSampler) // optional, defaults to ProbabilisticSampler(0.001D)
.WithPollingInterval(pollingInterval) // optional, defaults to TimeSpan.FromMinutes(1)
.WithSamplingManager(samplingManager) // optional, defaults to HttpSamplingManager("localhost:5778")
.Build();
OpenTracing.ITracer tracer = new Jaeger.Tracer.Builder(serviceName)
.WithMetrics(metrics)
.WithLoggerFactory(loggerFactory)
.WithReporter(reporter)
.WithSampler(sampler).Build(); The public class MutualTlsChannelCredentials : ChannelCredentials
{
private readonly TracingOptions _tracingOptions;
public MutualTlsChannelCredentials(TracingOptions tracingOptions)
{
_tracingOptions = tracingOptions;
}
public override void InternalPopulateConfiguration(ChannelCredentialsConfiguratorBase configurator, object state)
{
KeyCertificatePair clientCertKeyPair = new KeyCertificatePair(_tracingOptions.GrpcSenderClientCertChain, _tracingOptions.GrpcSenderClientPrivateKey);
configurator.SetSslCredentials(state, _tracingOptions.GrpcSenderServerRootCertifcates, clientCertKeyPair, VerifyPeerCallback);
}
private bool VerifyPeerCallback(VerifyPeerContext context)
{
// TDB -- implement this.
return true;
}
} As you can see from this code, I read all my settings from this Now the issue is, this all works great for when I am using the UDP Agent and Thrift UDP Sender but as soon as I use the gRPC Sender like I am attempting in this code above, it doesn't actually report any Spans to the Collector and I have no idea why. There doesn't appear to be any logging as I have the "Jaeger" logging level turned up to "Trace" and still I see nothing. Looking at the source, there appears to be no logging happening. I also noticed that my How can I figure out what is going wrong without logging? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Hi, thanks for your report. The The default endpoint is You can enable tracing on the gRPC level by setting up the
Another common issue is that the application gets shutdown too quick when testing. Make sure to call |
Beta Was this translation helpful? Give feedback.
Hi, thanks for your report. The
GrpcSender
has no real logging since it's a very slim wrapper. The real logging happens in theRemoteReporter
or in gRPC logging.The default endpoint is
localhost:14250
. How does your target look like? If has to be a valid gRPC target in any resolvable form, pointing to the collector. Are you sure that the port is accessible?You can enable tracing on the gRPC level by setting up the
ConsoleLogger
orTextWriterLogger
using theGrpcEnvironment
. That's part of gRPC and not our library. This also needs to be done by setting environment variables (possible from code) as documented here: