Skip to content

[BUG]: Trace data not sent to CI Visibility #6770

@thausercelonis

Description

@thausercelonis

Tracer Version(s)

3.11.1

Operating system and platform

Windows (x64), Ubuntu-latest (Github Agent)

Instrumentation Mode

manual with nuget package

TFM

net8.0

Bug Report

We have very custom benchmarks. It is not really a unit test, not a real benchmark. The results should be written to Datadog CI Visibility. To leverage that we are using the Datadog.Trace package. The reproduction code (separate code example) I will post here, too. Problems:

  • Nothing is written to Datadog, not in agent mode, not in agentless mode.
  • Nothing will be written to debug, not if you write to file, not to console.
  • No error
  • No exception

There is real nothing, what you can use to get an idea, what the problem could be.

Reproduction Code

    static void Main()
    {
        Environment.SetEnvironmentVariable("DD_TRACE_DEBUG", "true");
        Environment.SetEnvironmentVariable("DD_TRACE_LOG_FILE", "dd-trace.log");
        //Environment.SetEnvironmentVariable("DD_TRACE_LOG_FILE", "console");
        Environment.SetEnvironmentVariable("DD_TRACE_STARTUP_LOGS", "true");

        Environment.SetEnvironmentVariable("DD_CIVISIBILITY_AGENTLESS_ENABLED", "true");
        Environment.SetEnvironmentVariable("DD_API_KEY", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
        Environment.SetEnvironmentVariable("DD_SITE", "datadoghq.com");
        Environment.SetEnvironmentVariable("DD_ENV", "ci");
        Environment.SetEnvironmentVariable("DD_SERVICE", "my-test-service");

        Console.WriteLine("Datadog Environment Variables Set!");

        Console.WriteLine("Checking Environment Variables:");
        Console.WriteLine($"DD_SERVICE: {Environment.GetEnvironmentVariable("DD_SERVICE")}");
        Console.WriteLine($"DD_ENV: {Environment.GetEnvironmentVariable("DD_ENV")}");
        Console.WriteLine($"DD_API_KEY: {Environment.GetEnvironmentVariable("DD_API_KEY")}");
        Console.WriteLine($"DD_SITE: {Environment.GetEnvironmentVariable("DD_SITE")}");
        Console.WriteLine($"DD_CIVISIBILITY_AGENTLESS_ENABLED: {Environment.GetEnvironmentVariable("DD_CIVISIBILITY_AGENTLESS_ENABLED")}");
        Console.WriteLine($"DD_TRACE_DEBUG: {Environment.GetEnvironmentVariable("DD_TRACE_DEBUG")}");
        Console.WriteLine($"DD_TRACE_LOG_FILE: {Environment.GetEnvironmentVariable("DD_TRACE_LOG_FILE")}");

        var module = TestModule.Create("MyConsoleAppTests");
        var suite = module.GetOrCreateSuite("MyTestSuite");

        var test = suite.CreateTest("ManualTest");
        test.Close(TestStatus.Pass);

        suite.Close();
        module.Close();

        Tracer.Instance.ForceFlushAsync().Wait();
        Console.WriteLine("Datadog Tracer Flushed!");
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions