metadata

package
v0.0.0-...-258d93e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

Variables

View Source
var (
	Type = component.MustNewType("mackerelattributes")
)

Functions

This section is empty.

Types

type ResourceAttributeConfig

type ResourceAttributeConfig struct {
	Enabled bool `mapstructure:"enabled"`
	// contains filtered or unexported fields
}

ResourceAttributeConfig provides common config for a particular resource attribute.

func (*ResourceAttributeConfig) Unmarshal

func (rac *ResourceAttributeConfig) Unmarshal(parser *confmap.Conf) error

type ResourceAttributesConfig

type ResourceAttributesConfig struct {
	MackerelioHostID  ResourceAttributeConfig `mapstructure:"mackerelio.host.id"`
	MackerelioHostURL ResourceAttributeConfig `mapstructure:"mackerelio.host.url"`
	MackerelioOrgName ResourceAttributeConfig `mapstructure:"mackerelio.org.name"`
}

ResourceAttributesConfig provides config for mackerelattributes resource attributes.

func DefaultResourceAttributesConfig

func DefaultResourceAttributesConfig() ResourceAttributesConfig

type ResourceBuilder

type ResourceBuilder struct {
	// contains filtered or unexported fields
}

ResourceBuilder is a helper struct to build resources predefined in metadata.yaml. The ResourceBuilder is not thread-safe and must not to be used in multiple goroutines.

func NewResourceBuilder

func NewResourceBuilder(rac ResourceAttributesConfig) *ResourceBuilder

NewResourceBuilder creates a new ResourceBuilder. This method should be called on the start of the application.

func (*ResourceBuilder) Emit

func (rb *ResourceBuilder) Emit() pcommon.Resource

Emit returns the built resource and resets the internal builder state.

func (*ResourceBuilder) SetMackerelioHostID

func (rb *ResourceBuilder) SetMackerelioHostID(val string)

SetMackerelioHostID sets provided value as "mackerelio.host.id" attribute.

func (*ResourceBuilder) SetMackerelioHostURL

func (rb *ResourceBuilder) SetMackerelioHostURL(val string)

SetMackerelioHostURL sets provided value as "mackerelio.host.url" attribute.

func (*ResourceBuilder) SetMackerelioOrgName

func (rb *ResourceBuilder) SetMackerelioOrgName(val string)

SetMackerelioOrgName sets provided value as "mackerelio.org.name" attribute.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL