-
Notifications
You must be signed in to change notification settings - Fork 68
128 bit trace id not working with b3 propagation #143
Comments
Can you see if other parameters are set from the behavior? Especially Your configuration seems a bit more complicated than necessary. If you do it as follows, it stays open for changes to the configuration: services.AddOpenTracing();
// Adds the JAEGER Tracer.
services.AddSingleton<ITracer>(serviceProvider =>
{
Tracer tracer = null;
var hostingEnv = serviceProvider.GetRequiredService<IHostingEnvironment>();
// Add project name as service name as a default to JAEGER client if not passed from outside as a parameter.
serviceName = serviceName ?? hostingEnv.ApplicationName;
// Initialize the configuration builder with environment (if set).
var configurationBuilder = new ConfigurationBuilder()
.AddEnvironmentVariables();
if (hostingEnv.IsDevelopment()) {
configurationBuilder.AddInMemoryCollection(new Dictionary<string, string>
{
{Jaeger.Configuration.JaegerServiceName, serviceName},
});
}
// Get tracer instance with configurations.
tracer = (Tracer)Jaeger.Configuration
.FromIConfiguration(loggerFactory, configurationBuilder.Build())
.GetTracer();
// Allows code that can't use DI to also access the tracer.
GlobalTracer.Register(tracer);
return tracer;
}); I can't see any problem at the moment. You can try it using the numeric version which is also accepted in case kubernetes is not passing the boolean correctly: But since all the environment variables are passed as string anyway, I don't think that's the problem. I don't have kubernetes in use right now, so it will takes some more time to test it. Can you post the YAML that you are using for k8s? |
@Tanejaankush: I just tried it with kubernetes and can't reproduce your problem. I tried it with the following minimal example that I then started through docker-compose.ymlversion: '3.3'
services:
dotnet:
image: dotnet
depends_on:
- jaeger
environment:
- JAEGER_SERVICE_NAME=facility.default
- JAEGER_AGENT_HOST=jaeger
- JAEGER_AGENT_PORT=6831
- JAEGER_SAMPLER_TYPE=const
- JAEGER_SAMPLER_PARAM=1
- JAEGER_TRACEID_128BIT=1
- JAEGER_REPORTER_LOG_SPANS=1
jaeger:
image: jaegertracing/all-in-one:1.6
ports:
- "16686:16686" dotnet/Dockerfile
dotnet/test-env/test-env.csproj<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
<RootNamespace>test_env</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Jaeger" Version="0.3.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.1.1" />
</ItemGroup>
</Project> dotnet/test-env/Program.csusing System;
using Jaeger;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
namespace test_env
{
class Program
{
static void Main(string[] args)
{
var loggerFactory = new LoggerFactory().AddConsole();
var configurationBuilder = new ConfigurationBuilder()
.AddEnvironmentVariables();
// Get tracer instance with configurations.
var tracer = (Tracer)Jaeger.Configuration
.FromIConfiguration(loggerFactory, configurationBuilder.Build())
.GetTracer();
using (var scope = tracer.BuildSpan("TestOperation").StartActive())
{
scope.Span.Log("It works!");
}
tracer.Dispose();
}
}
} I was using the 2.2 runtime based on alpine Linux. I get the following output on the console:
Can you send me the log of your code? In the |
Seems correct to me.
Which contains: I'm wondering a why the span only shows the lower half of the trace-id, but it definetly created a trace-id with 128 bit. |
Ok, so the problem is not, that the client is not generating 128bit TraceIDs but it's not correctly extracting it from an incoming trace. This makes a huge difference, since the flag only affects generation of new IDs. I just see that you now added |
Awaiting the new version of JAEGER client :) |
@Tanejaankush: I just released v0.3.2 on NuGET. Please update your project and see if the issue is resolved. If not, please feel free to reopen this issue. |
Hey I am using "JAEGER_TRACEID_128BIT" environment variable to enable 128 bit trace id support but while I deploy application image in windows container it works fine but when I deploy the same image in kubernetes it never generates 128 bit traceid for the same image with same variables passed for deployement.
The text was updated successfully, but these errors were encountered: