Skip to content

Commit 7664bd4

Browse files
authored
Remove more [PublicApi] usages and unused code (#7786)
## Summary of changes - Remove `[PublicApi]` usages that aren't necessary any more - Rename `DebugEnabledInternal` => `DebugEnabled` - Delete some "public" methods that aren't, and are no longer necessary (as they're unused) ## Reason for change Cleaning up ## Implementation details Mostly <kbd>del</kbd> ## Test coverage Covered by existing ## Other details Part of a stack - #7786 👈 - #7787 - #7788
1 parent eb5be1b commit 7664bd4

File tree

30 files changed

+42
-367
lines changed

30 files changed

+42
-367
lines changed

tracer/src/Datadog.Trace.Coverage.collector/DataCollectorLogger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public DataCollectorLogger(DataCollectionLogger logger, DataCollectionContext co
2626
{
2727
_logger = logger;
2828
_collectionContext = collectionContext;
29-
_isDebugEnabled = GlobalSettings.Instance.DebugEnabledInternal;
29+
_isDebugEnabled = GlobalSettings.Instance.DebugEnabled;
3030

3131
if (DatadogLoggingFactory.GetConfiguration(GlobalConfigurationSource.Instance, TelemetryFactory.Config).File is { } fileConfig)
3232
{

tracer/src/Datadog.Trace.Manual/ITracer.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ public interface ITracer
3030
/// </summary>
3131
/// <param name="operationName">The span's operation name</param>
3232
/// <returns>A scope wrapping the newly created span</returns>
33-
[PublicApi]
3433
IScope StartActive(string operationName);
3534

3635
/// <summary>

tracer/src/Datadog.Trace.Manual/SourceGenerators/PublicApiAttribute.cs

Lines changed: 0 additions & 16 deletions
This file was deleted.

tracer/src/Datadog.Trace.OpenTracing/OpenTracingTracerFactory.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public static class OpenTracingTracerFactory
2323
/// <param name="defaultServiceName">Default name of the service (default is the name of the executing assembly).</param>
2424
/// <param name="isDebugEnabled">Turns on all debug logging (this may have an impact on application performance).</param>
2525
/// <returns>A Datadog compatible ITracer implementation</returns>
26-
[PublicApi]
2726
[Obsolete(DeprecationMessage)]
2827
[Instrumented]
2928
[MethodImpl(MethodImplOptions.NoInlining)]
@@ -54,7 +53,6 @@ public static class OpenTracingTracerFactory
5453
/// </summary>
5554
/// <param name="tracer">Existing Datadog Tracer instance</param>
5655
/// <returns>A Datadog compatible ITracer implementation</returns>
57-
[PublicApi]
5856
[Obsolete(DeprecationMessage)]
5957
[Instrumented]
6058
[MethodImpl(MethodImplOptions.NoInlining)]

tracer/src/Datadog.Trace.Tools.Runner/LegacyCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ private void Execute(InvocationContext context)
121121
}
122122
}
123123

124-
if (GlobalSettings.Instance.DebugEnabledInternal)
124+
if (GlobalSettings.Instance.DebugEnabled)
125125
{
126126
Console.WriteLine("Running: {0}", cmdLine);
127127
}

tracer/src/Datadog.Trace.Tools.Runner/RunCiCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ private async Task ExecuteAsync(InvocationContext context)
5959
}
6060

6161
// Run child process
62-
if (GlobalSettings.Instance.DebugEnabledInternal)
62+
if (GlobalSettings.Instance.DebugEnabled)
6363
{
6464
Console.WriteLine("Running: {0}", command);
6565
}

tracer/src/Datadog.Trace.Tools.Runner/RunCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ private void Execute(InvocationContext context)
4242
return;
4343
}
4444

45-
if (GlobalSettings.Instance.DebugEnabledInternal)
45+
if (GlobalSettings.Instance.DebugEnabled)
4646
{
4747
Console.WriteLine("Running: {0} {1}", program, arguments);
4848
}

tracer/src/Datadog.Trace/AppSec/Security.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ private void InitWafAndInstrumentations()
548548
_settings.ObfuscationParameterValueRegex,
549549
_configurationState,
550550
_settings.UseUnsafeEncoder,
551-
GlobalSettings.Instance.DebugEnabledInternal && _settings.WafDebugEnabled);
551+
GlobalSettings.Instance.DebugEnabled && _settings.WafDebugEnabled);
552552
if (_wafInitResult.Success)
553553
{
554554
// we don't reapply configurations to the waf here because it's all done in the subscription function, as new data might have been received at the same time as the enable command, we don't want to update twice (here and in the subscription)

tracer/src/Datadog.Trace/Ci/Agent/CIWriterHttpSender.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ internal sealed class CIWriterHttpSender : ICIVisibilityProtocolWriterSender
3333
public CIWriterHttpSender(IApiRequestFactory apiRequestFactory)
3434
{
3535
_apiRequestFactory = apiRequestFactory;
36-
_isDebugEnabled = GlobalSettings.Instance.DebugEnabledInternal;
36+
_isDebugEnabled = GlobalSettings.Instance.DebugEnabled;
3737
Log.Information("CIWriterHttpSender Initialized.");
3838
}
3939

tracer/src/Datadog.Trace/Configuration/ConfigurationSources/CompositeConfigurationSource.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ public void Add(IConfigurationSource source)
5555
IEnumerator<IConfigurationSource> IEnumerable<IConfigurationSource>.GetEnumerator() => _sources.GetEnumerator();
5656

5757
/// <inheritdoc />
58-
[PublicApi]
5958
IEnumerator IEnumerable.GetEnumerator() => _sources.GetEnumerator();
6059

6160
/// <inheritdoc />

0 commit comments

Comments
 (0)