View Source OpenTelemetry.SemConv.Incubating.URLAttributes (OpenTelemetry.SemConv v1.27.0)

OpenTelemetry Semantic Conventions for URL attributes.

Summary

Functions

Domain extracted from the url.full, such as "opentelemetry.io".

The file extension extracted from the url.full, excluding the leading dot.

Unmodified original URL as seen in the event source.

Port extracted from the url.full

The highest registered url domain, stripped of the subdomain.

The subdomain portion of a fully qualified domain name includes all of the names except the host name under the registered_domain. In a partially qualified domain, or if the qualification level of the full name cannot be determined, subdomain contains all of the names below the registered domain.

The low-cardinality template of an absolute path reference.

The effective top level domain (eTLD), also known as the domain suffix, is the last part of the domain name. For example, the top level domain for example.com is com.

Functions

@spec url_domain() :: :"url.domain"

Domain extracted from the url.full, such as "opentelemetry.io".

Value type

Value must be of type atom() | String.t().

Notes

In some cases a URL may refer to an IP and/or port directly, without a domain name. In this case, the IP address would go to the domain field. If the URL contains a literal IPv6 address enclosed by [ and ], the [ and ] characters should also be captured in the domain field.

Examples

["www.foo.bar", "opentelemetry.io", "3.12.167.2", "[1080:0:0:0:8:800:200C:417A]"]
iex> OpenTelemetry.SemConv.Incubating.URLAttributes.url_domain()
:"url.domain"
@spec url_extension() :: :"url.extension"

The file extension extracted from the url.full, excluding the leading dot.

Value type

Value must be of type atom() | String.t().

Notes

The file extension is only set if it exists, as not every url has a file extension. When the file name has multiple extensions example.tar.gz, only the last one should be captured gz, not tar.gz.

Examples

["png", "gz"]
iex> OpenTelemetry.SemConv.Incubating.URLAttributes.url_extension()
:"url.extension"

See OpenTelemetry.SemConv.URLAttributes.url_fragment/0.

See OpenTelemetry.SemConv.URLAttributes.url_full/0.

@spec url_original() :: :"url.original"

Unmodified original URL as seen in the event source.

Value type

Value must be of type atom() | String.t().

Notes

In network monitoring, the observed URL may be a full URL, whereas in access logs, the URL is often just represented as a path. This field is meant to represent the URL as it was observed, complete or not.
url.original might contain credentials passed via URL in form of https://username:password@www.example.com/. In such case password and username SHOULD NOT be redacted and attribute's value SHOULD remain the same.

Examples

["https://www.foo.bar/search?q=OpenTelemetry#SemConv", "search?q=OpenTelemetry"]
iex> OpenTelemetry.SemConv.Incubating.URLAttributes.url_original()
:"url.original"

See OpenTelemetry.SemConv.URLAttributes.url_path/0.

@spec url_port() :: :"url.port"

Port extracted from the url.full

Value type

Value must be of type integer().

Examples

[443]
iex> OpenTelemetry.SemConv.Incubating.URLAttributes.url_port()
:"url.port"

See OpenTelemetry.SemConv.URLAttributes.url_query/0.

@spec url_registered_domain() :: :"url.registered_domain"

The highest registered url domain, stripped of the subdomain.

Value type

Value must be of type atom() | String.t().

Notes

This value can be determined precisely with the public suffix list. For example, the registered domain for foo.example.com is example.com. Trying to approximate this by simply taking the last two labels will not work well for TLDs such as co.uk.

Examples

["example.com", "foo.co.uk"]
iex> OpenTelemetry.SemConv.Incubating.URLAttributes.url_registered_domain()
:"url.registered_domain"

See OpenTelemetry.SemConv.URLAttributes.url_scheme/0.

@spec url_subdomain() :: :"url.subdomain"

The subdomain portion of a fully qualified domain name includes all of the names except the host name under the registered_domain. In a partially qualified domain, or if the qualification level of the full name cannot be determined, subdomain contains all of the names below the registered domain.

Value type

Value must be of type atom() | String.t().

Notes

The subdomain portion of www.east.mydomain.co.uk is east. If the domain has multiple levels of subdomain, such as sub2.sub1.example.com, the subdomain field should contain sub2.sub1, with no trailing period.

Examples

["east", "sub2.sub1"]
iex> OpenTelemetry.SemConv.Incubating.URLAttributes.url_subdomain()
:"url.subdomain"
@spec url_template() :: :"url.template"

The low-cardinality template of an absolute path reference.

Value type

Value must be of type atom() | String.t().

Examples

["/users/{id}", "/users/:id", "/users?id={id}"]
iex> OpenTelemetry.SemConv.Incubating.URLAttributes.url_template()
:"url.template"
@spec url_top_level_domain() :: :"url.top_level_domain"

The effective top level domain (eTLD), also known as the domain suffix, is the last part of the domain name. For example, the top level domain for example.com is com.

Value type

Value must be of type atom() | String.t().

Notes

This value can be determined precisely with the public suffix list.

Examples

["com", "co.uk"]
iex> OpenTelemetry.SemConv.Incubating.URLAttributes.url_top_level_domain()
:"url.top_level_domain"