Skip to main content

StdTag

Struct StdTag 

Source
pub struct StdTag;
Expand description

[Standard span tags][tags]. [tags]: https://github.com/opentracing/specification/blob/master/semantic_conventions.md#span-tags-table

Implementations§

Source§

impl StdTag

Source

pub fn component<V>(value: V) -> Tag
where V: Into<Cow<'static, str>>,

Makes a "component" tag.

It indicates the software package, framework, library, or module that generated the associated Span.

E.g., "grpc", "django", "JDBI".

Source

pub fn db_instance<V>(value: V) -> Tag
where V: Into<Cow<'static, str>>,

Makes a "db.instance" tag.

It indicates database instance name.

E.g., In java, if the jdbc.url="jdbc:mysql://127.0.0.1:3306/customers", the instance name is "customers".

Source

pub fn db_statement<V>(value: V) -> Tag
where V: Into<Cow<'static, str>>,

Makes a "db.statement" tag.

It indicates a database statement for the given database type.

E.g., for db.type="sql", "SELECT * FROM wuser_table"; for db.type="redis", "SET mykey 'WuValue'".

Source

pub fn db_type<V>(value: V) -> Tag
where V: Into<Cow<'static, str>>,

Makes a "db.type" tag.

It indicates database type.

For any SQL database, "sql". For others, the lower-case database category, e.g. "cassandra", "hbase", or "redis".

Source

pub fn db_user<V>(value: V) -> Tag
where V: Into<Cow<'static, str>>,

Makes a "db.user" tag.

It indicates username for accessing database.

E.g., "readonly_user" or "reporting_user"

Source

pub fn error() -> Tag

Makes a "error" tag that has the value true.

It indicates the application considers the operation represented by the Span to have failed.

Source

pub fn http_method<V>(value: V) -> Tag
where V: Into<Cow<'static, str>>,

Makes a "http.method" tag.

It indicates HTTP method of the request for the associated Span.

E.g., "GET", "POST"

Source

pub fn http_status_code(value: u16) -> Tag

Makes a "http.status_code" tag.

It indicates HTTP response status code for the associated Span.

E.g., 200, 503, 404

Source

pub fn http_url<V>(value: V) -> Tag
where V: Into<Cow<'static, str>>,

Makes a "http.url" tag.

It indicates URL of the request being handled in this segment of the trace, in standard URI format.

E.g., "https://domain.net/path/to?resource=here"

Source

pub fn message_bus_destination<V>(value: V) -> Tag
where V: Into<Cow<'static, str>>,

Makes a `“message_bus.destination” tag.

It indicates an address at which messages can be exchanged.

E.g. A Kafka record has an associated "topic name" that can be extracted by the instrumented producer or consumer and stored using this tag.

Source

pub fn peer_address<V>(value: V) -> Tag
where V: Into<Cow<'static, str>>,

Makes a "peer.address" tag.

It indicates remote “address”, suitable for use in a networking client library.

This may be a "ip:port", a bare "hostname", a FQDN, or even a JDBC substring like "mysql://prod-db:3306".

Source

pub fn peer_hostname<V>(value: V) -> Tag
where V: Into<Cow<'static, str>>,

Makes a "peer.hostname" tag.

It indicates remote hostname.

E.g., "opentracing.io", "internal.dns.name"

Source

pub fn peer_addr(value: SocketAddr) -> Vec<Tag>

Makes a "peer.ipXX" and "peer.port" tags.

Source

pub fn peer_ip(value: IpAddr) -> Tag

Makes a tag which has the name either "peer.ipv4" or "peer.ipv6" depending on the value.

It indicates remote IP address.

E.g., "127.0.0.1", "2001:0db8:85a3:0000:0000:8a2e:0370:7334"

Source

pub fn peer_port(value: u16) -> Tag

Makes a "peer.port" tag.

It indicates remote port.

E.g., 80

Source

pub fn peer_service<V>(value: V) -> Tag
where V: Into<Cow<'static, str>>,

Makes a "peer.service" tag.

It indicates remote service name (for some unspecified definition of "service").

E.g., "elasticsearch", "a_custom_microservice", "memcache"

Source

pub fn sampling_priority(value: u32) -> Tag

Makes a "samplingpriority" tag.

If greater than 0, a hint to the Tracer to do its best to capture the trace. If 0, a hint to the trace to not-capture the trace. If absent, the Tracer should use its default sampling mechanism.

Source

pub fn span_kind<V>(value: V) -> Tag
where V: Into<Cow<'static, str>>,

Makes a "span.ind" tag.

Either "client" or "server" for the appropriate roles in an RPC, and "producer" or "consumer" for the appropriate roles in a messaging scenario.

Trait Implementations§

Source§

impl Debug for StdTag

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.