-
Couldn't load subscription status.
- Fork 5.2k
Open
Milestone
Description
The Activity.Tags property only return tags which are KeyValuePair<string, string> and shouldn't be used anymore. Having both without any hints about this is confusing for the customer and might lead to mistakes.
Don't use anymore:
runtime/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs
Lines 271 to 280 in 79ae74f
| /// <summary> | |
| /// Tags are string-string key-value pairs that represent information that will | |
| /// be logged along with the Activity to the logging system. This information | |
| /// however is NOT passed on to the children of this activity. | |
| /// </summary> | |
| /// <seealso cref="Baggage"/> | |
| public IEnumerable<KeyValuePair<string, string?>> Tags | |
| { | |
| get => _tags?.EnumerateStringValues() ?? s_emptyBaggageTags; | |
| } |
Use:
runtime/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs
Lines 282 to 289 in 79ae74f
| /// <summary> | |
| /// List of the tags which represent information that will be logged along with the Activity to the logging system. | |
| /// This information however is NOT passed on to the children of this activity. | |
| /// </summary> | |
| public IEnumerable<KeyValuePair<string, object?>> TagObjects | |
| { | |
| get => _tags ?? s_emptyTagObjects; | |
| } |
For details see discussion with @tarekgh
#48722 (comment)
jakebanks, julealgon and rhysparry