Skip to content
This repository has been archived by the owner on Feb 22, 2025. It is now read-only.

Commit

Permalink
drop code related to unsupported features (#754)
Browse files Browse the repository at this point in the history
* drop code related to unsupported features

* remove leftovers

* additional removals
  • Loading branch information
lachmatt authored Jan 5, 2024
1 parent c26aba1 commit 3dc6473
Show file tree
Hide file tree
Showing 201 changed files with 81 additions and 13,870 deletions.
17 changes: 0 additions & 17 deletions docs/internal/internal-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@ These settings should be never used by the users.
| `SIGNALFX_CONVENTION` | Sets the semantic and trace id conventions for the tracer. Available values are: `Datadog` (64bit trace id), `OpenTelemetry` (128 bit trace id). | `OpenTelemetry` |
| `SIGNALFX_DUMP_ILREWRITE_ENABLED` | Allows the profiler to dump the IL original code and modification to the log. | `false` |
| `SIGNALFX_EXPORTER` | The exporter to be used. The Tracer uses it to encode and dispatch traces. Available values are: `DatadogAgent`, `Zipkin`. | `Zipkin` |
| `SIGNALFX_LOGS_DIRECT_SUBMISSION_INTEGRATIONS` | Configuration key for a list of direct log submission integrations to enable. Only selected integrations are enabled for direct log submission. Supports multiple values separated with semi-colons. Valid values are `ILogger`, `Serilog`, `Log4Net`, `NLog` | `` |
| `SIGNALFX_LOGS_DIRECT_SUBMISSION_HOST` | Configuration key for the name of the originating host for direct logs submission. | `` |
| `SIGNALFX_LOGS_DIRECT_SUBMISSION_SOURCE` | Configuration key for the originating source for direct logs submission. | `csharp` |
| `SIGNALFX_LOGS_DIRECT_SUBMISSION_TAGS` | Configuration key for a list of tags to be applied globally to all logs directly submitted. Supports multiple key key-value pairs which are comma-separated, and for which the key and value are colon-separated. For example Key1:Value1, Key2:Value2 | `` |
| `SIGNALFX_LOGS_DIRECT_SUBMISSION_URL` | Configuration key for the url to send logs to. | `https://http-intake.logs.datadoghq.com:443` |
| `SIGNALFX_LOGS_DIRECT_SUBMISSION_MINIMUM_LEVEL` | Configuration key for the minimum level logs should have to be sent to the intake. Should be one of `Verbose`,`Debug`,`Information`,`Warning`,`Error`,`Fatal` | `Information` |
| `SIGNALFX_LOGS_DIRECT_SUBMISSION_MAX_BATCH_SIZE` | Configuration key for the maximum number of logs to send at one time | `1000` |
| `SIGNALFX_LOGS_DIRECT_SUBMISSION_MAX_QUEUE_SIZE` | Configuration key for the maximum number of logs to hold in internal queue at any one time | `100000` |
| `SIGNALFX_LOGS_DIRECT_SUBMISSION_BATCH_PERIOD_SECONDS` | Configuration key for the time in seconds to wait between checking for batches | `2` |
| `SIGNALFX_PROFILER_MEMORY_ENABLED` | Enable to activate memory profiling. | `false` |
| `SIGNALFX_PROFILER_MAX_MEMORY_SAMPLES_PER_MINUTE` | Configuratoin key for the maximum number of memory samples gathered per minute. | `200`
| `SIGNALFX_PROFILER_EXPORT_INTERVAL` | Profiling exporter interval in milliseconds. It defines how often the profiling data is sent to the collector. If the CPU profiling is enabled this value will automatically be set to match `SIGNALFX_PROFILER_CALL_STACK_INTERVAL`. | `10000` |
Expand All @@ -32,12 +23,6 @@ These settings should be never used by the users.
|-|-|-|
| `SIGNALFX_AGENT_HOST` | The Agent host where the tracer can send traces. | |
| `SIGNALFX_APM_RECEIVER_PORT` | The port for Trace Agent binding. | `8126` |
| `SIGNALFX_CIVISIBILITY_AGENTLESS_ENABLED` | Enable to activate Agentless in CI Visibility. | `false` |
| `SIGNALFX_CIVISIBILITY_AGENTLESS_URL` | Configuration key for setting the agentless url endpoint. | |
| `SIGNALFX_CIVISIBILITY_CODE_COVERAGE_ENABLED` | Configuration key for enabling or disabling Code Coverage in CI Visibility. | `false` |
| `SIGNALFX_CIVISIBILITY_CODE_COVERAGE_SNK_FILEPATH` | Configuration key for re-signing assemblies after the Code Coverage modification. | |
| `SIGNALFX_CIVISIBILITY_ENABLED` | Enable to activate CI Visibility. | `false` |
| `SIGNALFX_CIVISIBILITY_LOGS_ENABLED` | Enable to activate Logs direct submission. | `false` |
| `SIGNALFX_DOGSTATSD_ARGS` | Comma-separated list of arguments to be passed to the DogStatsD process. | |
| `SIGNALFX_DOGSTATSD_PATH` | The DogStatsD path for when a standalone instance needs to be started. | |
| `SIGNALFX_DOGSTATSD_PIPE_NAME` | The named pipe that DogStatsD binds to. | |
Expand Down Expand Up @@ -67,8 +52,6 @@ These settings should be never used by the users.
| `SIGNALFX_TRACE_TRANSPORT` | Overrides the transport to use for communicating with the trace agent. Available values are: `datagod-tcp`, `datadog-named-pipes`. | |
| `SIGNALFX_AAS_ENABLE_CUSTOM_TRACING` | Used to force the loader to start the tracer agent (in case automatic instrumentation is disabled). Used in contexts where the user cannot manage agent processes, such as Azure App Services. | |
| `SIGNALFX_AAS_ENABLE_CUSTOM_METRICS` | Used to force the loader to start dogstatsd (in case automatic instrumentation is disabled). Used in contexts where the user cannot manage agent processes, such as Azure App Services. | |
| `SIGNALFX_INSTRUMENTATION_TELEMETRY_ENABLED` | Used to enable internal telemetry. | `false` |
| `SIGNALFX_TRACE_TELEMETRY_URL` | Sets the telemetry URL where the tracer sends telemetry. | |
| `SIGNALFX_SITE` | Sets the default destination site. | |
| `SIGNALFX_LOG_LEVEL` | Sets the log level for serverless. | |
| `_SIGNALFX_EXTENSION_PATH` | Sets the lambda extension path. | |
Expand Down
12 changes: 0 additions & 12 deletions tracer/src/Datadog.Trace.BenchmarkDotNet/DatadogExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,6 @@ public class DatadogExporter : IExporter

private static readonly IDatadogLogger Log = DatadogLogging.GetLoggerFor(typeof(DatadogExporter));

static DatadogExporter()
{
try
{
Environment.SetEnvironmentVariable(Configuration.ConfigurationKeys.CIVisibility.Enabled, "1", EnvironmentVariableTarget.Process);
}
catch
{
// .
}
}

/// <inheritdoc />
public string Name => nameof(DatadogExporter);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ public void Process()
}
else if (tracerTarget == TracerTarget.Net461)
{
_logger.Debug($"Assembly: {FilePath}, is a net461 signed assembly, a .snk file is required ({Configuration.ConfigurationKeys.CIVisibility.CodeCoverageSnkFile} environment variable).");
return;
}
}
Expand Down
9 changes: 0 additions & 9 deletions tracer/src/Datadog.Trace.MSBuild/DatadogLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,6 @@ public class DatadogLogger : INodeLogger

static DatadogLogger()
{
try
{
Environment.SetEnvironmentVariable(Configuration.ConfigurationKeys.CIVisibility.Enabled, "1", EnvironmentVariableTarget.Process);
}
catch
{
// .
}

CIVisibility.Initialize();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,14 @@ public CICodeCoveragePayload(int maxItemsPerPayload = DefaultMaxItemsPerPayload,
if (!string.IsNullOrWhiteSpace(agentlessUrl))
{
var builder = new UriBuilder(agentlessUrl);
builder.Path = "api/v2/citestcov";
Url = builder.Uri;
}
else
{
Url = new UriBuilder(
scheme: "https",
host: "event-platform-intake." + CIVisibility.Settings.Site,
port: 443,
pathValue: "api/v2/citestcov").Uri;
host: CIVisibility.Settings.Site,
portNumber: 443).Uri;
}

// We call reset here to add the dummy event
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@ public CITestCyclePayload(IFormatterResolver formatterResolver = null)
if (!string.IsNullOrWhiteSpace(agentlessUrl))
{
var builder = new UriBuilder(agentlessUrl);
builder.Path = "api/v2/citestcycle";
Url = builder.Uri;
}
else
{
Url = new UriBuilder(
scheme: "https",
host: "citestcycle-intake." + CIVisibility.Settings.Site,
port: 443,
pathValue: "api/v2/citestcycle").Uri;
host: CIVisibility.Settings.Site,
portNumber: 443)
.Uri;
}
}

Expand Down
59 changes: 1 addition & 58 deletions tracer/src/Datadog.Trace/Ci/CIVisibility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,16 @@
using Datadog.Trace.Configuration;
using Datadog.Trace.Logging;
using Datadog.Trace.Pdb;
using Datadog.Trace.Util;

namespace Datadog.Trace.Ci
{
internal class CIVisibility
{
private static readonly CIVisibilitySettings _settings = CIVisibilitySettings.FromDefaultSources();
private static int _firstInitialization = 1;
private static Lazy<bool> _enabledLazy = new Lazy<bool>(() => InternalEnabled(), true);
internal static readonly IDatadogLogger Log = DatadogLogging.GetLoggerFor(typeof(CIVisibility));

public static bool Enabled => _enabledLazy.Value;
public static bool Enabled => false;

public static bool IsRunning => Interlocked.CompareExchange(ref _firstInitialization, 0, 0) == 0;

Expand Down Expand Up @@ -156,60 +154,5 @@ private static async Task ShutdownAsync()
await InternalFlushAsync().ConfigureAwait(false);
MethodSymbolResolver.Instance.Clear();
}

private static bool InternalEnabled()
{
var processName = ProcessHelpers.GetCurrentProcessName() ?? string.Empty;

// By configuration
if (_settings.Enabled)
{
// When is enabled by configuration we only enable it to the testhost child process if the process name is dotnet.
if (processName.Equals("dotnet", StringComparison.OrdinalIgnoreCase) && Environment.CommandLine.IndexOf("testhost.dll", StringComparison.OrdinalIgnoreCase) == -1)
{
Log.Information("CI Visibility disabled because the process name is 'dotnet' but the commandline doesn't contain 'testhost.dll': {cmdline}", Environment.CommandLine);
return false;
}

Log.Information("CI Visibility Enabled by Configuration");
return true;
}

// Try to autodetect based in the domain name.
var domainName = AppDomain.CurrentDomain.FriendlyName ?? string.Empty;
if (domainName.StartsWith("testhost", StringComparison.Ordinal) ||
domainName.StartsWith("vstest", StringComparison.Ordinal) ||
domainName.StartsWith("xunit", StringComparison.Ordinal) ||
domainName.StartsWith("nunit", StringComparison.Ordinal) ||
domainName.StartsWith("MSBuild", StringComparison.Ordinal))
{
Log.Information("CI Visibility Enabled by Domain name whitelist");
PropagateCiVisibilityEnvironmentVariable();
return true;
}

// Try to autodetect based in the process name.
if (processName.StartsWith("testhost.", StringComparison.Ordinal))
{
Log.Information("CI Visibility Enabled by Process name whitelist");
PropagateCiVisibilityEnvironmentVariable();
return true;
}

return false;

static void PropagateCiVisibilityEnvironmentVariable()
{
try
{
// Set the configuration key to propagate the configuration to child processes.
Environment.SetEnvironmentVariable(ConfigurationKeys.CIVisibility.Enabled, "1", EnvironmentVariableTarget.Process);
}
catch
{
// .
}
}
}
}
}
30 changes: 12 additions & 18 deletions tracer/src/Datadog.Trace/Ci/Configuration/CIVisibilitySettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
// </copyright>

// Modified by Splunk Inc.

using System;
using Datadog.Trace.Configuration;

Expand All @@ -12,32 +14,24 @@ internal class CIVisibilitySettings
{
public CIVisibilitySettings(IConfigurationSource source)
{
Enabled = source?.GetBool(ConfigurationKeys.CIVisibility.Enabled) ?? false;
Agentless = source?.GetBool(ConfigurationKeys.CIVisibility.AgentlessEnabled) ?? false;
Logs = source?.GetBool(ConfigurationKeys.CIVisibility.Logs) ?? false;
ApiKey = source?.GetString(ConfigurationKeys.ApiKey);
Site = source?.GetString(ConfigurationKeys.Site) ?? "datadoghq.com";
AgentlessUrl = source?.GetString(ConfigurationKeys.CIVisibility.AgentlessUrl);
Enabled = false;
Agentless = false;
Logs = false;
ApiKey = string.Empty;
Site = "localhost";
AgentlessUrl = string.Empty;

// By default intake payloads has a 5MB limit
MaximumAgentlessPayloadSize = 5 * 1024 * 1024;

ProxyHttps = source?.GetString(ConfigurationKeys.Proxy.ProxyHttps);
var proxyNoProxy = source?.GetString(ConfigurationKeys.Proxy.ProxyNoProxy) ?? string.Empty;
ProxyNoProxy = proxyNoProxy.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
ProxyHttps = string.Empty;
ProxyNoProxy = Array.Empty<string>();

TracerSettings = new TracerSettings(source);

if (Logs)
{
// Enable the direct log submission
TracerSettings.LogSubmissionSettings.DirectLogSubmissionEnabledIntegrations.Add("XUnit");
TracerSettings.LogSubmissionSettings.DirectLogSubmissionBatchPeriod = TimeSpan.FromSeconds(1);
}

// Code coverage
CodeCoverageEnabled = source?.GetBool(ConfigurationKeys.CIVisibility.CodeCoverage) ?? false;
CodeCoverageSnkFilePath = source?.GetString(ConfigurationKeys.CIVisibility.CodeCoverageSnkFile);
CodeCoverageEnabled = false;
CodeCoverageSnkFilePath = string.Empty;
}

/// <summary>
Expand Down

This file was deleted.

Loading

0 comments on commit 3dc6473

Please sign in to comment.