Service

Struct Service 

Source
pub struct Service { /* private fields */ }
Expand description

The service fields describe the service for or from which the data was collected.

These fields help you find and correlate logs for a specific service and version.

Implementations§

Source§

impl Service

Source

pub fn get_environment(&self) -> Option<&String>

Identifies the environment where the service is running.

If the same service runs in different environments (production, staging, QA, development, etc.), the environment can identify other instances of the same service. Can also group services and applications from the same environment.

Source

pub fn set_environment(&mut self, environment_arg: String)

Identifies the environment where the service is running.

If the same service runs in different environments (production, staging, QA, development, etc.), the environment can identify other instances of the same service. Can also group services and applications from the same environment.

§Example

production

Source

pub fn get_id(&self) -> Option<&String>

Unique identifier of the running service. If the service is comprised of many nodes, the service.id should be the same for all nodes.

This id should uniquely identify the service. This makes it possible to correlate logs and metrics for one specific service, no matter which particular node emitted the event.

Note that if you need to see the events from one specific host of the service, you should filter on that host.name or host.id instead.

Source

pub fn set_id(&mut self, id_arg: String)

Unique identifier of the running service. If the service is comprised of many nodes, the service.id should be the same for all nodes.

This id should uniquely identify the service. This makes it possible to correlate logs and metrics for one specific service, no matter which particular node emitted the event.

Note that if you need to see the events from one specific host of the service, you should filter on that host.name or host.id instead.

§Example

d37e5ebfe0ae6c4972dbe9f0174a1637bb8247f6

Source

pub fn get_name(&self) -> Option<&String>

Name of the service data is collected from.

The name of the service is normally user given. This allows for distributed services that run on multiple hosts to correlate the related instances based on the name.

In the case of Elasticsearch the service.name could contain the cluster name. For Beats the service.name is by default a copy of the service.type field if no name is specified.

Source

pub fn set_name(&mut self, name_arg: String)

Name of the service data is collected from.

The name of the service is normally user given. This allows for distributed services that run on multiple hosts to correlate the related instances based on the name.

In the case of Elasticsearch the service.name could contain the cluster name. For Beats the service.name is by default a copy of the service.type field if no name is specified.

§Example

elasticsearch-metrics

Source

pub fn get_node_name(&self) -> Option<&String>

Name of a service node.

This allows for two nodes of the same service running on the same host to be differentiated. Therefore, service.node.name should typically be unique across nodes of a given service.

In the case of Elasticsearch, the service.node.name could contain the unique node name within the Elasticsearch cluster. In cases where the service doesn’t have the concept of a node name, the host name or container name can be used to distinguish running instances that make up this service. If those do not provide uniqueness (e.g. multiple instances of the service running on the same host) - the node name can be manually set.

Source

pub fn set_node_name(&mut self, node_name_arg: String)

Name of a service node.

This allows for two nodes of the same service running on the same host to be differentiated. Therefore, service.node.name should typically be unique across nodes of a given service.

In the case of Elasticsearch, the service.node.name could contain the unique node name within the Elasticsearch cluster. In cases where the service doesn’t have the concept of a node name, the host name or container name can be used to distinguish running instances that make up this service. If those do not provide uniqueness (e.g. multiple instances of the service running on the same host) - the node name can be manually set.

§Example

instance-0000000016

Source

pub fn get_node_role(&self) -> Option<&String>

Deprecated for removal in next major version release. This field will be superseded by node.roles.

Role of a service node.

This allows for distinction between different running roles of the same service.

In the case of Kibana, the service.node.role could be ui or background_tasks.

In the case of Elasticsearch, the service.node.role could be master or data.

Other services could use this to distinguish between a web and worker role running as part of the service.

Source

pub fn set_node_role(&mut self, node_role_arg: String)

Deprecated for removal in next major version release. This field will be superseded by node.roles.

Role of a service node.

This allows for distinction between different running roles of the same service.

In the case of Kibana, the service.node.role could be ui or background_tasks.

In the case of Elasticsearch, the service.node.role could be master or data.

Other services could use this to distinguish between a web and worker role running as part of the service.

§Example

background_tasks

Source

pub fn get_node_roles(&self) -> &Vec<String>

Roles of a service node.

This allows for distinction between different running roles of the same service.

In the case of Kibana, the service.node.role could be ui or background_tasks or both.

In the case of Elasticsearch, the service.node.role could be master or data or both.

Other services could use this to distinguish between a web and worker role running as part of the service.

Source

pub fn add_node_role(&mut self, node_role_arg: String)

Roles of a service node.

This allows for distinction between different running roles of the same service.

In the case of Kibana, the service.node.role could be ui or background_tasks or both.

In the case of Elasticsearch, the service.node.role could be master or data or both.

Other services could use this to distinguish between a web and worker role running as part of the service.

§Example

["ui", "background_tasks"]

Source

pub fn get_type(&self) -> Option<&String>

The type of the service data is collected from.

The type can be used to group and correlate logs and metrics from one service type.

Example: If logs or metrics are collected from Elasticsearch, service.type would be elasticsearch.

Source

pub fn set_type(&mut self, type_arg: String)

The type of the service data is collected from.

The type can be used to group and correlate logs and metrics from one service type.

Example: If logs or metrics are collected from Elasticsearch, service.type would be elasticsearch.

§Example

elasticsearch

Source

pub fn get_state(&self) -> Option<&String>

Current state of the service.

Source

pub fn set_state(&mut self, state_arg: String)

Current state of the service.

Source

pub fn get_version(&self) -> Option<&String>

Version of the service the data was collected from.

This allows to look at a data set only for a specific version of a service.

Source

pub fn set_version(&mut self, version_arg: String)

Version of the service the data was collected from.

This allows to look at a data set only for a specific version of a service.

§Example

3.2.4

Source

pub fn get_ephemeral_id(&self) -> Option<&String>

Ephemeral identifier of this service (if one exists).

This id normally changes across restarts, but service.id does not.

Source

pub fn set_ephemeral_id(&mut self, ephemeral_id_arg: String)

Ephemeral identifier of this service (if one exists).

This id normally changes across restarts, but service.id does not.

§Example

8a4f500f

Source

pub fn get_address(&self) -> Option<&String>

Address where data about this service was collected from.

This should be a URI, network address (ipv4:port or [ipv6]:port) or a resource path (sockets).

Source

pub fn set_address(&mut self, address_arg: String)

Address where data about this service was collected from.

This should be a URI, network address (ipv4:port or [ipv6]:port) or a resource path (sockets).

§Example

172.26.0.2:5432

Trait Implementations§

Source§

impl Clone for Service

Source§

fn clone(&self) -> Service

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for Service

Source§

fn default() -> Service

Returns the “default value” for a type. Read more
Source§

impl Serialize for Service

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.