-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
413 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/Datadog.Trace/Configuration/DefaultFactoryConfigurator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Datadog.Trace.Configuration.Factories; | ||
using Datadog.Trace.Factories; | ||
|
||
namespace Datadog.Trace.Configuration | ||
{ | ||
/// <summary> | ||
/// Default implementation for factories. | ||
/// </summary> | ||
public class DefaultFactoryConfigurator : IFactoryConfigurator | ||
{ | ||
private IPropagatorFactory _propagatorFactory; | ||
|
||
/// <summary> | ||
/// Gets the default propagator factory. | ||
/// </summary> | ||
/// <returns>Default propagator factory.</returns> | ||
public virtual IPropagatorFactory GetPropagatorFactory() | ||
{ | ||
return _propagatorFactory ??= new DefaultPropagatorFactory(); | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/Datadog.Trace/Configuration/Factories/IPropagatorFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System.Collections.Generic; | ||
using Datadog.Trace.Conventions; | ||
using Datadog.Trace.Propagation; | ||
|
||
namespace Datadog.Trace.Configuration.Factories | ||
{ | ||
/// <summary> | ||
/// Factory interface for propagators. | ||
/// </summary> | ||
public interface IPropagatorFactory | ||
{ | ||
/// <summary> | ||
/// Gets multiple span context propagators. | ||
/// </summary> | ||
/// <param name="propagatorIds">List of propagator ids.</param> | ||
/// <param name="traceIdConvention">Trace id convention.</param> | ||
/// <returns>Context propagators.</returns> | ||
IEnumerable<IPropagator> GetPropagators(IEnumerable<string> propagatorIds, ITraceIdConvention traceIdConvention); | ||
|
||
/// <summary> | ||
/// Gets propagator for propagator id. | ||
/// </summary> | ||
/// <param name="propagatorId">Propagator id.</param> | ||
/// <param name="traceIdConvention">Trace id convention.</param> | ||
/// <returns>Context propagator.</returns> | ||
IPropagator GetPropagator(string propagatorId, ITraceIdConvention traceIdConvention); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Datadog.Trace.Configuration.Factories; | ||
|
||
namespace Datadog.Trace.Configuration | ||
{ | ||
/// <summary> | ||
/// Provides configuration for factories | ||
/// </summary> | ||
public interface IFactoryConfigurator | ||
{ | ||
/// <summary> | ||
/// Get the propagator factory. | ||
/// </summary> | ||
/// <returns>Propagator factory.</returns> | ||
IPropagatorFactory GetPropagatorFactory(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace Datadog.Trace.Configuration.Types | ||
{ | ||
/// <summary> | ||
/// Contains default available propagator types. | ||
/// </summary> | ||
public static class PropagatorTypes | ||
{ | ||
/// <summary> | ||
/// The Datadog propagator. | ||
/// </summary> | ||
public const string Datadog = "Datadog"; | ||
|
||
/// <summary> | ||
/// The B3 propagator | ||
/// </summary> | ||
public const string B3 = "B3"; | ||
|
||
/// <summary> | ||
/// The W3C propagator | ||
/// </summary> | ||
public const string W3C = "W3C"; | ||
} | ||
} |
Oops, something went wrong.