Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var TrackedMetrics map[string]struct{} = map[string]struct{}{ // contains filtered or unexported fields }
TrackedMetrics is the set of metrics that are tracked by the hostmap.
Functions ¶
This section is empty.
Types ¶
type HostMap ¶
type HostMap struct {
// contains filtered or unexported fields
}
HostMap maps from hostnames to host metadata payloads.
func (*HostMap) Flush ¶
func (m *HostMap) Flush() map[string]payload.HostMetadata
Flush all the host metadata payloads and clear them from the HostMap.
func (*HostMap) Set ¶ added in v0.7.1
func (m *HostMap) Set(md payload.HostMetadata) error
Set a hardcoded host metadata payload.
func (*HostMap) Update ¶
func (m *HostMap) Update(host string, res pcommon.Resource) (changed bool, md payload.HostMetadata, err error)
Update the information about a given host by providing a resource. The function reports:
- Whether the information about the `host` has changed
- The host metadata payload stored
- Any non-fatal errors that may have occurred during the update
Non-fatal errors are local to the specific field where they happened and do not change the other fields. If when filling a field a non-fatal error is raised, the error will be reported, the field will be left empty and further fields will still be filled.
The order in which resource attributes are read does not affect the final host metadata payload, even if non-fatal errors are raised during execution.