Skip to content

Commit

Permalink
Improve Activity API usability and OpenTelemetry integration (Part 2) (
Browse files Browse the repository at this point in the history
  • Loading branch information
tarekgh authored Jul 15, 2020
1 parent b7c4cb7 commit b895666
Show file tree
Hide file tree
Showing 17 changed files with 960 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public string? Id
get { throw null; }
}

public bool IsAllDataRequested { get { throw null; } set { throw null; }}
public bool IsAllDataRequested { get { throw null; } set { throw null; } }
public System.Diagnostics.ActivityIdFormat IdFormat { get { throw null; } }
public System.Diagnostics.ActivityKind Kind { get { throw null; } }
public string OperationName { get { throw null; } }
Expand All @@ -47,13 +47,16 @@ public string? Id
public System.Diagnostics.ActivitySpanId SpanId { get { throw null; } }
public System.DateTime StartTimeUtc { get { throw null; } }
public System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string?>> Tags { get { throw null; } }
public System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, object>> TagObjects { get { throw null; } }
public System.Collections.Generic.IEnumerable<System.Diagnostics.ActivityEvent> Events { get { throw null; } }
public System.Collections.Generic.IEnumerable<System.Diagnostics.ActivityLink> Links { get { throw null; } }
public System.Diagnostics.ActivityTraceId TraceId { get { throw null; } }
public string? TraceStateString { get { throw null; } set { } }
public System.Diagnostics.Activity AddBaggage(string key, string? value) { throw null; }
public System.Diagnostics.Activity AddEvent(System.Diagnostics.ActivityEvent e) { throw null; }
public System.Diagnostics.Activity AddTag(string key, string? value) { throw null; }
public System.Diagnostics.Activity AddTag(string key, object value) { throw null; }
public System.Diagnostics.Activity SetTag(string key, object value) { throw null; }
public string? GetBaggageItem(string key) { throw null; }
public System.Diagnostics.Activity SetEndTime(System.DateTime endTimeUtc) { throw null; }
public System.Diagnostics.Activity SetIdFormat(System.Diagnostics.ActivityIdFormat format) { throw null; }
Expand All @@ -68,6 +71,37 @@ public string? Id
public object? GetCustomProperty(string propertyName) { throw null; }
public ActivityContext Context { get { throw null; } }
}
public class ActivityTagsCollection : System.Collections.Generic.IDictionary<string, object>
{
public ActivityTagsCollection() { throw null; }
public ActivityTagsCollection(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, object>> list) { throw null; }
public object? this[string key] { get { throw null; } set { } }
public System.Collections.Generic.ICollection<string> Keys { get { throw null; } }
public System.Collections.Generic.ICollection<object> Values { get { throw null; } }
public int Count { get { throw null; } }
public bool IsReadOnly { get { throw null; } }
public void Add(string key, object value) { throw null; }
public void Add(System.Collections.Generic.KeyValuePair<string, object> item) { throw null; }
public void Clear() { throw null; }
public bool Contains(System.Collections.Generic.KeyValuePair<string, object> item) { throw null; }
public bool ContainsKey(string key) { throw null; }
public void CopyTo(System.Collections.Generic.KeyValuePair<string, object>[] array, int arrayIndex) { throw null; }
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<string, object>> System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, object>>.GetEnumerator() { throw null; }
public bool Remove(string key) { throw null; }
public bool Remove(System.Collections.Generic.KeyValuePair<string, object> item) { throw null; }
public bool TryGetValue(string key, out object value) { throw null; }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
public Enumerator GetEnumerator() { throw null; }

public struct Enumerator : System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<string, object>>, System.Collections.IEnumerator
{
public System.Collections.Generic.KeyValuePair<string, object> Current { get { throw null; } }
object System.Collections.IEnumerator.Current { get { throw null; } }
public void Dispose() { throw null; }
public bool MoveNext() { throw null; }
void System.Collections.IEnumerator.Reset() { throw null; }
}
}
public enum ActivityIdFormat
{
Unknown = 0,
Expand Down Expand Up @@ -101,8 +135,8 @@ public sealed class ActivitySource : IDisposable
public string? Version { get { throw null; } }
public bool HasListeners() { throw null; }
public System.Diagnostics.Activity? StartActivity(string name, System.Diagnostics.ActivityKind kind = ActivityKind.Internal) { throw null; }
public System.Diagnostics.Activity? StartActivity(string name, System.Diagnostics.ActivityKind kind, System.Diagnostics.ActivityContext parentContext, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string?>>? tags = null, System.Collections.Generic.IEnumerable<System.Diagnostics.ActivityLink>? links = null, System.DateTimeOffset startTime = default) { throw null; }
public System.Diagnostics.Activity? StartActivity(string name, System.Diagnostics.ActivityKind kind, string parentId, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string?>>? tags = null, System.Collections.Generic.IEnumerable<System.Diagnostics.ActivityLink>? links = null, System.DateTimeOffset startTime = default) { throw null; }
public System.Diagnostics.Activity? StartActivity(string name, System.Diagnostics.ActivityKind kind, System.Diagnostics.ActivityContext parentContext, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, object?>>? tags = null, System.Collections.Generic.IEnumerable<System.Diagnostics.ActivityLink>? links = null, System.DateTimeOffset startTime = default) { throw null; }
public System.Diagnostics.Activity? StartActivity(string name, System.Diagnostics.ActivityKind kind, string parentId, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, object?>>? tags = null, System.Collections.Generic.IEnumerable<System.Diagnostics.ActivityLink>? links = null, System.DateTimeOffset startTime = default) { throw null; }
public static void AddActivityListener(System.Diagnostics.ActivityListener listener) { throw null; }
public void Dispose() { throw null; }
}
Expand Down Expand Up @@ -163,20 +197,19 @@ public enum ActivityKind
public readonly struct ActivityEvent
{
public ActivityEvent(string name) {throw null; }
public ActivityEvent(string name, System.DateTimeOffset timestamp) { throw null; }
public ActivityEvent(string name, System.DateTimeOffset timestamp, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, object>>? attributes) { throw null; }
public ActivityEvent(string name, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, object>>? attributes) { throw null; }
public ActivityEvent(string name, System.DateTimeOffset timestamp = default, System.Diagnostics.ActivityTagsCollection? tags = null) { throw null; }
public string Name { get { throw null; } }
public System.DateTimeOffset Timestamp { get { throw null; } }
public System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, object>> Attributes { get { throw null; } }
public System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, object>> Tags { get { throw null; } }
}
public readonly struct ActivityContext : System.IEquatable<System.Diagnostics.ActivityContext>
{
public ActivityContext(System.Diagnostics.ActivityTraceId traceId, System.Diagnostics.ActivitySpanId spanId, System.Diagnostics.ActivityTraceFlags traceOptions, string? traceState = null) { throw null; }
public ActivityContext(System.Diagnostics.ActivityTraceId traceId, System.Diagnostics.ActivitySpanId spanId, System.Diagnostics.ActivityTraceFlags traceOptions, string? traceState = null, bool isRemote = false) { throw null; }
public System.Diagnostics.ActivityTraceId TraceId { get { throw null; } }
public System.Diagnostics.ActivitySpanId SpanId { get { throw null; } }
public System.Diagnostics.ActivityTraceFlags TraceFlags { get { throw null; } }
public string? TraceState { get { throw null; } }
public bool IsRemote { get { throw null; } }
public static bool operator ==(System.Diagnostics.ActivityContext left, System.Diagnostics.ActivityContext right) { throw null; }
public static bool operator !=(System.Diagnostics.ActivityContext left, System.Diagnostics.ActivityContext right) { throw null; }
public bool Equals(System.Diagnostics.ActivityContext value) { throw null; }
Expand All @@ -185,11 +218,9 @@ public readonly struct ActivityEvent
}
public readonly struct ActivityLink : IEquatable<ActivityLink>
{
public ActivityLink(System.Diagnostics.ActivityContext context) { throw null; }
public ActivityLink(System.Diagnostics.ActivityContext context, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, object>>? attributes) { throw null; }
public ActivityLink(System.Diagnostics.ActivityContext context, System.Diagnostics.ActivityTagsCollection? tags = null) { throw null; }
public System.Diagnostics.ActivityContext Context { get { throw null; } }
public System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, object>>? Attributes { get { throw null; } }

public System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, object>>? Tags { get { throw null; } }
public override bool Equals(object? obj) { throw null; }
public bool Equals(System.Diagnostics.ActivityLink value) { throw null; }
public static bool operator ==(System.Diagnostics.ActivityLink left, System.Diagnostics.ActivityLink right) { throw null; }
Expand All @@ -202,18 +233,19 @@ public readonly struct ActivityCreationOptions<T>
public string Name { get { throw null; } }
public System.Diagnostics.ActivityKind Kind { get { throw null; } }
public T Parent { get { throw null; } }
public System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string?>> Tags { get { throw null; } }
public System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, object?>> Tags { get { throw null; } }
public System.Collections.Generic.IEnumerable<System.Diagnostics.ActivityLink> Links { get { throw null; } }
}
public delegate System.Diagnostics.ActivityDataRequest GetRequestedData<T>(ref System.Diagnostics.ActivityCreationOptions<T> options);
public sealed class ActivityListener : IDisposable
{
public ActivityListener() { throw null; }
public System.Action<System.Diagnostics.Activity>? ActivityStarted { get { throw null; } set { } }
public System.Action<System.Diagnostics.Activity>? ActivityStopped { get { throw null; } set { } }
public System.Func<System.Diagnostics.ActivitySource, bool>? ShouldListenTo { get { throw null; } set { } }
public System.Diagnostics.GetRequestedData<string>? GetRequestedDataUsingParentId { get { throw null; } set { } }
public System.Diagnostics.GetRequestedData<ActivityContext>? GetRequestedDataUsingContext { get { throw null; } set { } }
public System.Action<System.Diagnostics.Activity>? ActivityStarted { get { throw null; } set { throw null; } }
public System.Action<System.Diagnostics.Activity>? ActivityStopped { get { throw null; } set { throw null; } }
public System.Func<System.Diagnostics.ActivitySource, bool>? ShouldListenTo { get { throw null; } set { throw null; } }
public System.Diagnostics.GetRequestedData<string>? GetRequestedDataUsingParentId { get { throw null; } set { throw null; } }
public System.Diagnostics.GetRequestedData<ActivityContext>? GetRequestedDataUsingContext { get { throw null; } set { throw null; } }
public bool AutoGenerateRootContextTraceId { get { throw null; } set { throw null; } }
public void Dispose() { throw null; }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,7 @@
<data name="StartTimeNotUtc" xml:space="preserve">
<value>"StartTime is not UTC"</value>
</data>
<data name="KeyAlreadyExist" xml:space="preserve">
<value>"The collection already contains item with same key '{0}''"</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<Compile Include="$(CommonPath)System\HexConverter.cs"
Link="Common\System\HexConverter.cs" />
<Compile Include="System\Diagnostics\Activity.cs" />
<Compile Include="System\Diagnostics\ActivityTagsCollection.cs" />
<Compile Include="System\Diagnostics\ActivityContext.cs" />
<Compile Include="System\Diagnostics\ActivityCreationOptions.cs" />
<Compile Include="System\Diagnostics\ActivityDataRequest.cs" />
Expand Down
Loading

0 comments on commit b895666

Please sign in to comment.