-
Notifications
You must be signed in to change notification settings - Fork 773
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Align with spec on ISpanBuilder and ITracer (#133)
* Align with spec on ISpanBuilder and ITraces * add bad args tests on SpanBuilder
- Loading branch information
1 parent
843fc3e
commit 023e861
Showing
51 changed files
with
1,463 additions
and
1,394 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
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
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,169 @@ | ||
// <copyright file="BlankSpan.cs" company="OpenTelemetry Authors"> | ||
// Copyright 2018, OpenTelemetry Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// </copyright> | ||
|
||
namespace OpenTelemetry.Trace | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
/// <summary> | ||
/// Blank span. | ||
/// </summary> | ||
public sealed class BlankSpan : ISpan | ||
{ | ||
/// <summary> | ||
/// Blank span instance. | ||
/// </summary> | ||
public static readonly BlankSpan Instance = new BlankSpan(); | ||
|
||
private BlankSpan() | ||
{ | ||
} | ||
|
||
/// <inheritdoc /> | ||
public SpanContext Context => SpanContext.Blank; | ||
|
||
/// <inheritdoc /> | ||
public bool IsRecordingEvents => false; | ||
|
||
/// <inheritdoc /> | ||
public Status Status | ||
{ | ||
get => Status.Ok; | ||
|
||
set | ||
{ | ||
if (value == null) | ||
{ | ||
throw new ArgumentNullException(nameof(value)); | ||
} | ||
} | ||
} | ||
|
||
/// <inheritdoc /> | ||
public bool HasEnded { get; } | ||
|
||
/// <inheritdoc /> | ||
public void UpdateName(string name) | ||
{ | ||
if (name == null) | ||
{ | ||
throw new ArgumentNullException(nameof(name)); | ||
} | ||
} | ||
|
||
/// <inheritdoc /> | ||
public void SetAttribute(string key, IAttributeValue value) | ||
{ | ||
if (key == null) | ||
{ | ||
throw new ArgumentNullException(nameof(key)); | ||
} | ||
|
||
if (value == null) | ||
{ | ||
throw new ArgumentNullException(nameof(value)); | ||
} | ||
} | ||
|
||
/// <inheritdoc /> | ||
public void SetAttribute(string key, string value) | ||
{ | ||
if (key == null) | ||
{ | ||
throw new ArgumentNullException(nameof(key)); | ||
} | ||
|
||
if (value == null) | ||
{ | ||
throw new ArgumentNullException(nameof(value)); | ||
} | ||
} | ||
|
||
/// <inheritdoc /> | ||
public void SetAttribute(string key, long value) | ||
{ | ||
if (key == null) | ||
{ | ||
throw new ArgumentNullException(nameof(key)); | ||
} | ||
} | ||
|
||
/// <inheritdoc /> | ||
public void SetAttribute(string key, double value) | ||
{ | ||
if (key == null) | ||
{ | ||
throw new ArgumentNullException(nameof(key)); | ||
} | ||
} | ||
|
||
/// <inheritdoc /> | ||
public void SetAttribute(string key, bool value) | ||
{ | ||
if (key == null) | ||
{ | ||
throw new ArgumentNullException(nameof(key)); | ||
} | ||
} | ||
|
||
/// <inheritdoc /> | ||
public void AddEvent(string name) | ||
{ | ||
if (name == null) | ||
{ | ||
throw new ArgumentNullException(nameof(name)); | ||
} | ||
} | ||
|
||
/// <inheritdoc /> | ||
public void AddEvent(string name, IDictionary<string, IAttributeValue> attributes) | ||
{ | ||
if (name == null) | ||
{ | ||
throw new ArgumentNullException(nameof(name)); | ||
} | ||
|
||
if (attributes == null) | ||
{ | ||
throw new ArgumentNullException(nameof(attributes)); | ||
} | ||
} | ||
|
||
/// <inheritdoc /> | ||
public void AddEvent(IEvent newEvent) | ||
{ | ||
if (newEvent == null) | ||
{ | ||
throw new ArgumentNullException(nameof(newEvent)); | ||
} | ||
} | ||
|
||
/// <inheritdoc /> | ||
public void AddLink(ILink link) | ||
{ | ||
if (link == null) | ||
{ | ||
throw new ArgumentNullException(nameof(link)); | ||
} | ||
} | ||
|
||
/// <inheritdoc /> | ||
public void End() | ||
{ | ||
} | ||
} | ||
} |
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
Oops, something went wrong.