-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Telemetry to read MeterOptions and ActivitySourceOptions from …
…derived classes.
- Loading branch information
1 parent
89d7326
commit 589e17a
Showing
3 changed files
with
56 additions
and
16 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
47 changes: 47 additions & 0 deletions
47
AspNetCore.Examples.OpenTelemetry.TelemetryExtensions/ActivitySourceOptions.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,47 @@ | ||
namespace System.Diagnostics; | ||
|
||
/// <summary> | ||
/// Options for creating an <see cref="ActivitySource"/>. | ||
/// </summary> | ||
public class ActivitySourceOptions | ||
{ | ||
private string _name; | ||
|
||
/// <summary> | ||
/// The ActivitySource name. | ||
/// </summary> | ||
public string Name | ||
{ | ||
get => _name; | ||
set | ||
{ | ||
if (value is null) | ||
{ | ||
throw new ArgumentNullException(nameof(value)); | ||
} | ||
|
||
_name = value; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// The optional ActivitySource version. | ||
/// </summary> | ||
public string? Version { get; set; } | ||
|
||
/// <summary> | ||
/// The optional list of key-value pair tags associated with the ActivitySource. | ||
/// </summary> | ||
public IEnumerable<KeyValuePair<string, object?>>? Tags { get; set; } | ||
|
||
/// <summary> | ||
/// Constructs a new instance of <see cref="ActivitySourceOptions"/>. | ||
/// </summary> | ||
/// <param name="name">The ActivitySource name.</param> | ||
public ActivitySourceOptions(string name) | ||
{ | ||
Name = name; | ||
|
||
Debug.Assert(_name is not null); | ||
} | ||
} |
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