Documentation ¶
Index ¶
- Constants
- Variables
- func Meter(settings component.TelemetrySettings) metric.Meter
- func Tracer(settings component.TelemetrySettings) trace.Tracer
- type MetricsBuilder
- func (mb *MetricsBuilder) AddDataPoint(resourceID, metric, aggregation, unit string, attributes map[string]*string, ...)
- func (mb *MetricsBuilder) Emit(rmo ...ResourceMetricsOption) pmetric.Metrics
- func (mb *MetricsBuilder) EmitAllMetrics(ils pmetric.ScopeMetrics)
- func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption)
- func (mb *MetricsBuilder) Reset(options ...metricBuilderOption)
- type MetricsBuilderConfig
- type ResourceAttributeConfig
- type ResourceAttributeSettings
- type ResourceAttributesConfig
- type ResourceAttributesSettings
- type ResourceBuilder
- type ResourceMetricsOption
Constants ¶
const (
MetricsStability = component.StabilityLevelDevelopment
)
Variables ¶
var (
Type = component.MustNewType("azuremonitor")
)
Functions ¶
Types ¶
type MetricsBuilder ¶
type MetricsBuilder struct {
// contains filtered or unexported fields
}
MetricsBuilder provides an interface for scrapers to report metrics while taking care of all the transformations required to produce metric representation defined in metadata and user settings.
func NewMetricsBuilder ¶
func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.CreateSettings, options ...metricBuilderOption) *MetricsBuilder
func (*MetricsBuilder) AddDataPoint ¶
func (*MetricsBuilder) Emit ¶
func (mb *MetricsBuilder) Emit(rmo ...ResourceMetricsOption) pmetric.Metrics
Emit returns all the metrics accumulated by the metrics builder and updates the internal state to be ready for recording another set of metrics. This function will be responsible for applying all the transformations required to produce metric representation defined in metadata and user settings, e.g. delta or cumulative.
func (*MetricsBuilder) EmitAllMetrics ¶
func (mb *MetricsBuilder) EmitAllMetrics(ils pmetric.ScopeMetrics)
func (*MetricsBuilder) EmitForResource ¶
func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption)
EmitForResource saves all the generated metrics under a new resource and updates the internal state to be ready for recording another set of data points as part of another resource. This function can be helpful when one scraper needs to emit metrics from several resources. Otherwise calling this function is not required, just `Emit` function can be called instead. Resource attributes should be provided as ResourceMetricsOption arguments.
func (*MetricsBuilder) Reset ¶
func (mb *MetricsBuilder) Reset(options ...metricBuilderOption)
Reset resets metrics builder to its initial state. It should be used when external metrics source is restarted, and metrics builder should update its startTime and reset it's internal state accordingly.
type MetricsBuilderConfig ¶
type MetricsBuilderConfig struct {
ResourceAttributes ResourceAttributesSettings `mapstructure:"resource_attributes"`
}
MetricsBuilderConfig is a structural subset of an otherwise 1-1 copy of metadata.yaml
func DefaultMetricsBuilderConfig ¶
func DefaultMetricsBuilderConfig() MetricsBuilderConfig
type ResourceAttributeConfig ¶ added in v0.78.0
type ResourceAttributeConfig struct { Enabled bool `mapstructure:"enabled"` // contains filtered or unexported fields }
ResourceAttributeConfig provides common config for a particular resource attribute.
type ResourceAttributeSettings ¶
type ResourceAttributeSettings struct { Enabled bool `mapstructure:"enabled"` // contains filtered or unexported fields }
ResourceAttributeSettings provides common settings for a particular metric.
type ResourceAttributesConfig ¶ added in v0.78.0
type ResourceAttributesConfig struct { AzuremonitorSubscriptionID ResourceAttributeConfig `mapstructure:"azuremonitor.subscription_id"` AzuremonitorTenantID ResourceAttributeConfig `mapstructure:"azuremonitor.tenant_id"` }
ResourceAttributesConfig provides config for azuremonitor resource attributes.
func DefaultResourceAttributesConfig ¶ added in v0.78.0
func DefaultResourceAttributesConfig() ResourceAttributesConfig
type ResourceAttributesSettings ¶
type ResourceAttributesSettings struct { AzureMonitorSubscriptionID ResourceAttributeSettings `mapstructure:"azuremonitor.subscription_id"` AzureMonitorTenantID ResourceAttributeSettings `mapstructure:"azuremonitor.tenant_id"` }
ResourceAttributesSettings provides settings for azuremonitorreceiver metrics.
func DefaultResourceAttributesSettings ¶
func DefaultResourceAttributesSettings() ResourceAttributesSettings
type ResourceBuilder ¶ added in v0.82.0
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 ¶ added in v0.82.0
func NewResourceBuilder(rac ResourceAttributesConfig) *ResourceBuilder
NewResourceBuilder creates a new ResourceBuilder. This method should be called on the start of the application.
func (*ResourceBuilder) Emit ¶ added in v0.82.0
func (rb *ResourceBuilder) Emit() pcommon.Resource
Emit returns the built resource and resets the internal builder state.
func (*ResourceBuilder) SetAzuremonitorSubscriptionID ¶ added in v0.82.0
func (rb *ResourceBuilder) SetAzuremonitorSubscriptionID(val string)
SetAzuremonitorSubscriptionID sets provided value as "azuremonitor.subscription_id" attribute.
func (*ResourceBuilder) SetAzuremonitorTenantID ¶ added in v0.82.0
func (rb *ResourceBuilder) SetAzuremonitorTenantID(val string)
SetAzuremonitorTenantID sets provided value as "azuremonitor.tenant_id" attribute.
type ResourceMetricsOption ¶
type ResourceMetricsOption func(ResourceAttributesSettings, pmetric.ResourceMetrics)
ResourceMetricsOption applies changes to provided resource metrics.
func WithAzureMonitorSubscriptionID ¶
func WithAzureMonitorSubscriptionID(val string) ResourceMetricsOption
WithAzureMonitorSubscriptionID sets provided value as "azuremonitor.subscription_id" attribute for current resource.
func WithAzureMonitorTenantID ¶
func WithAzureMonitorTenantID(val string) ResourceMetricsOption
WithAzuremonitorTenantID sets provided value as "azuremonitor.tenant_id" attribute for current resource.