-
Notifications
You must be signed in to change notification settings - Fork 35
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
1 parent
e8aad10
commit d06c0e2
Showing
12 changed files
with
215 additions
and
155 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,48 @@ | ||
import 'package:opentelemetry/src/sdk/internal/utils.dart'; | ||
|
||
/// A representation of a single piece of metadata attached to trace span. | ||
class Attribute { | ||
final String key; | ||
final Object value; | ||
|
||
/// Create an Attribute from a String value. | ||
Attribute.fromString(this.key, String this.value); | ||
Attribute.fromString(this.key, String this.value) { | ||
Utils.checkArgument(key != null, "key can't be null"); | ||
} | ||
|
||
/// Create an Attribute from a boolean value. | ||
// ignore: avoid_positional_boolean_parameters | ||
Attribute.fromBoolean(this.key, bool this.value); | ||
Attribute.fromBoolean(this.key, bool this.value) { | ||
Utils.checkArgument(key != null, "key can't be null"); | ||
} | ||
|
||
/// Create an Attribute from a double-precision floating-point value. | ||
Attribute.fromDouble(this.key, double this.value); | ||
Attribute.fromDouble(this.key, double this.value) { | ||
Utils.checkArgument(key != null, "key can't be null"); | ||
} | ||
|
||
/// Create an Attribute from an integer value. | ||
Attribute.fromInt(this.key, int this.value); | ||
Attribute.fromInt(this.key, int this.value) { | ||
Utils.checkArgument(key != null, "key can't be null"); | ||
} | ||
|
||
/// Create an Attribute from a list of String values. | ||
Attribute.fromStringList(this.key, List<String> this.value); | ||
Attribute.fromStringList(this.key, List<String> this.value) { | ||
Utils.checkArgument(key != null, "key can't be null"); | ||
} | ||
|
||
/// Create an Attribute from a list of boolean values. | ||
Attribute.fromBooleanList(this.key, List<bool> this.value); | ||
Attribute.fromBooleanList(this.key, List<bool> this.value) { | ||
Utils.checkArgument(key != null, "key can't be null"); | ||
} | ||
|
||
/// Create an Attribute from a list of double-precision floating-point values. | ||
Attribute.fromDoubleList(this.key, List<double> this.value); | ||
Attribute.fromDoubleList(this.key, List<double> this.value) { | ||
Utils.checkArgument(key != null, "key can't be null"); | ||
} | ||
|
||
/// Create an Attribute from a list of integer values. | ||
Attribute.fromIntList(this.key, List<int> this.value); | ||
|
||
///Create an Attribute from an object. | ||
///Do we need to do a type check of value? | ||
Attribute.fromObject(this.key, this.value); | ||
Attribute.fromIntList(this.key, List<int> this.value) { | ||
Utils.checkArgument(key != null, "key can't be null"); | ||
} | ||
} |
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
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
Oops, something went wrong.