metadata

package
v0.58.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

MapAttributeHTTPMethod is a helper map of string to AttributeHTTPMethod attribute value.

View Source
var MapAttributeOperation = map[string]AttributeOperation{
	"writes": AttributeOperationWrites,
	"reads":  AttributeOperationReads,
}

MapAttributeOperation is a helper map of string to AttributeOperation attribute value.

View Source
var MapAttributeView = map[string]AttributeView{
	"temporary_view_reads": AttributeViewTemporaryViewReads,
	"view_reads":           AttributeViewViewReads,
}

MapAttributeView is a helper map of string to AttributeView attribute value.

Functions

func WithStartTime added in v0.43.0

func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption

WithStartTime sets startTime on the metrics builder.

Types

type AttributeHTTPMethod added in v0.43.0

type AttributeHTTPMethod int

AttributeHTTPMethod specifies the a value http.method attribute.

const (
	AttributeHTTPMethodCOPY AttributeHTTPMethod
	AttributeHTTPMethodDELETE
	AttributeHTTPMethodGET
	AttributeHTTPMethodHEAD
	AttributeHTTPMethodOPTIONS
	AttributeHTTPMethodPOST
	AttributeHTTPMethodPUT
)

func (AttributeHTTPMethod) String added in v0.51.0

func (av AttributeHTTPMethod) String() string

String returns the string representation of the AttributeHTTPMethod.

type AttributeOperation added in v0.43.0

type AttributeOperation int

AttributeOperation specifies the a value operation attribute.

const (
	AttributeOperationWrites AttributeOperation
	AttributeOperationReads
)

func (AttributeOperation) String added in v0.51.0

func (av AttributeOperation) String() string

String returns the string representation of the AttributeOperation.

type AttributeView added in v0.43.0

type AttributeView int

AttributeView specifies the a value view attribute.

const (
	AttributeViewTemporaryViewReads AttributeView
	AttributeViewViewReads
)

func (AttributeView) String added in v0.51.0

func (av AttributeView) String() string

String returns the string representation of the AttributeView.

type MetricSettings added in v0.43.0

type MetricSettings struct {
	Enabled bool `mapstructure:"enabled"`
}

MetricSettings provides common settings for a particular metric.

type MetricsBuilder added in v0.43.0

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 added in v0.43.0

func NewMetricsBuilder(settings MetricsSettings, buildInfo component.BuildInfo, options ...metricBuilderOption) *MetricsBuilder

func (*MetricsBuilder) Emit added in v0.43.0

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) EmitForResource added in v0.48.0

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) RecordCouchdbAverageRequestTimeDataPoint added in v0.43.0

func (mb *MetricsBuilder) RecordCouchdbAverageRequestTimeDataPoint(ts pcommon.Timestamp, val float64)

RecordCouchdbAverageRequestTimeDataPoint adds a data point to couchdb.average_request_time metric.

func (*MetricsBuilder) RecordCouchdbDatabaseOpenDataPoint added in v0.43.0

func (mb *MetricsBuilder) RecordCouchdbDatabaseOpenDataPoint(ts pcommon.Timestamp, val int64)

RecordCouchdbDatabaseOpenDataPoint adds a data point to couchdb.database.open metric.

func (*MetricsBuilder) RecordCouchdbDatabaseOperationsDataPoint added in v0.43.0

func (mb *MetricsBuilder) RecordCouchdbDatabaseOperationsDataPoint(ts pcommon.Timestamp, val int64, operationAttributeValue AttributeOperation)

RecordCouchdbDatabaseOperationsDataPoint adds a data point to couchdb.database.operations metric.

func (*MetricsBuilder) RecordCouchdbFileDescriptorOpenDataPoint added in v0.43.0

func (mb *MetricsBuilder) RecordCouchdbFileDescriptorOpenDataPoint(ts pcommon.Timestamp, val int64)

RecordCouchdbFileDescriptorOpenDataPoint adds a data point to couchdb.file_descriptor.open metric.

func (*MetricsBuilder) RecordCouchdbHttpdBulkRequestsDataPoint added in v0.43.0

func (mb *MetricsBuilder) RecordCouchdbHttpdBulkRequestsDataPoint(ts pcommon.Timestamp, val int64)

RecordCouchdbHttpdBulkRequestsDataPoint adds a data point to couchdb.httpd.bulk_requests metric.

func (*MetricsBuilder) RecordCouchdbHttpdRequestsDataPoint added in v0.43.0

func (mb *MetricsBuilder) RecordCouchdbHttpdRequestsDataPoint(ts pcommon.Timestamp, val int64, httpMethodAttributeValue AttributeHTTPMethod)

RecordCouchdbHttpdRequestsDataPoint adds a data point to couchdb.httpd.requests metric.

func (*MetricsBuilder) RecordCouchdbHttpdResponsesDataPoint added in v0.43.0

func (mb *MetricsBuilder) RecordCouchdbHttpdResponsesDataPoint(ts pcommon.Timestamp, val int64, httpStatusCodeAttributeValue string)

RecordCouchdbHttpdResponsesDataPoint adds a data point to couchdb.httpd.responses metric.

func (*MetricsBuilder) RecordCouchdbHttpdViewsDataPoint added in v0.43.0

func (mb *MetricsBuilder) RecordCouchdbHttpdViewsDataPoint(ts pcommon.Timestamp, val int64, viewAttributeValue AttributeView)

RecordCouchdbHttpdViewsDataPoint adds a data point to couchdb.httpd.views metric.

func (*MetricsBuilder) Reset added in v0.43.0

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 MetricsSettings added in v0.43.0

type MetricsSettings struct {
	CouchdbAverageRequestTime MetricSettings `mapstructure:"couchdb.average_request_time"`
	CouchdbDatabaseOpen       MetricSettings `mapstructure:"couchdb.database.open"`
	CouchdbDatabaseOperations MetricSettings `mapstructure:"couchdb.database.operations"`
	CouchdbFileDescriptorOpen MetricSettings `mapstructure:"couchdb.file_descriptor.open"`
	CouchdbHttpdBulkRequests  MetricSettings `mapstructure:"couchdb.httpd.bulk_requests"`
	CouchdbHttpdRequests      MetricSettings `mapstructure:"couchdb.httpd.requests"`
	CouchdbHttpdResponses     MetricSettings `mapstructure:"couchdb.httpd.responses"`
	CouchdbHttpdViews         MetricSettings `mapstructure:"couchdb.httpd.views"`
}

MetricsSettings provides settings for couchdbreceiver metrics.

func DefaultMetricsSettings added in v0.43.0

func DefaultMetricsSettings() MetricsSettings

type ResourceMetricsOption added in v0.52.0

type ResourceMetricsOption func(pmetric.ResourceMetrics)

ResourceMetricsOption applies changes to provided resource metrics.

func WithCouchdbNodeName added in v0.48.0

func WithCouchdbNodeName(val string) ResourceMetricsOption

WithCouchdbNodeName sets provided value as "couchdb.node.name" attribute for current resource.

func WithStartTimeOverride added in v0.52.0

func WithStartTimeOverride(start pcommon.Timestamp) ResourceMetricsOption

WithStartTimeOverride overrides start time for all the resource metrics data points. This option should be only used if different start time has to be set on metrics coming from different resources.

Jump to

Keyboard shortcuts

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