Documentation ¶
Index ¶
- Variables
- func WithStartTime(startTime pdata.Timestamp) metricBuilderOption
- type MetricSettings
- type MetricsBuilder
- func (mb *MetricsBuilder) Emit(metrics pdata.MetricSlice)
- func (mb *MetricsBuilder) RecordNginxConnectionsAcceptedDataPoint(ts pdata.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordNginxConnectionsCurrentDataPoint(ts pdata.Timestamp, val int64, stateAttributeValue string)
- func (mb *MetricsBuilder) RecordNginxConnectionsHandledDataPoint(ts pdata.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordNginxRequestsDataPoint(ts pdata.Timestamp, val int64)
- func (mb *MetricsBuilder) Reset(options ...metricBuilderOption)
- type MetricsSettings
Constants ¶
This section is empty.
Variables ¶
var A = Attributes
A is an alias for Attributes.
var AttributeState = struct { Active string Reading string Writing string Waiting string }{ "active", "reading", "writing", "waiting", }
AttributeState are the possible values that the attribute "state" can have.
var Attributes = struct { // State (The state of a connection) State string }{ "state", }
Attributes contains the possible metric attributes that can be used.
Functions ¶
func WithStartTime ¶ added in v0.44.0
WithStartTime sets startTime on the metrics builder.
Types ¶
type MetricSettings ¶ added in v0.44.0
type MetricSettings struct {
Enabled bool `mapstructure:"enabled"`
}
MetricSettings provides common settings for a particular metric.
type MetricsBuilder ¶ added in v0.44.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.44.0
func NewMetricsBuilder(settings MetricsSettings, options ...metricBuilderOption) *MetricsBuilder
func (*MetricsBuilder) Emit ¶ added in v0.44.0
func (mb *MetricsBuilder) Emit(metrics pdata.MetricSlice)
Emit appends generated metrics to a pdata.MetricsSlice and updates the internal state to be ready for recording another set of data points. This function will be doing all transformations required to produce metric representation defined in metadata and user settings, e.g. delta/cumulative translation.
func (*MetricsBuilder) RecordNginxConnectionsAcceptedDataPoint ¶ added in v0.44.0
func (mb *MetricsBuilder) RecordNginxConnectionsAcceptedDataPoint(ts pdata.Timestamp, val int64)
RecordNginxConnectionsAcceptedDataPoint adds a data point to nginx.connections_accepted metric.
func (*MetricsBuilder) RecordNginxConnectionsCurrentDataPoint ¶ added in v0.44.0
func (mb *MetricsBuilder) RecordNginxConnectionsCurrentDataPoint(ts pdata.Timestamp, val int64, stateAttributeValue string)
RecordNginxConnectionsCurrentDataPoint adds a data point to nginx.connections_current metric.
func (*MetricsBuilder) RecordNginxConnectionsHandledDataPoint ¶ added in v0.44.0
func (mb *MetricsBuilder) RecordNginxConnectionsHandledDataPoint(ts pdata.Timestamp, val int64)
RecordNginxConnectionsHandledDataPoint adds a data point to nginx.connections_handled metric.
func (*MetricsBuilder) RecordNginxRequestsDataPoint ¶ added in v0.44.0
func (mb *MetricsBuilder) RecordNginxRequestsDataPoint(ts pdata.Timestamp, val int64)
RecordNginxRequestsDataPoint adds a data point to nginx.requests metric.
func (*MetricsBuilder) Reset ¶ added in v0.44.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.44.0
type MetricsSettings struct { NginxConnectionsAccepted MetricSettings `mapstructure:"nginx.connections_accepted"` NginxConnectionsCurrent MetricSettings `mapstructure:"nginx.connections_current"` NginxConnectionsHandled MetricSettings `mapstructure:"nginx.connections_handled"` NginxRequests MetricSettings `mapstructure:"nginx.requests"` }
MetricsSettings provides settings for nginxreceiver metrics.
func DefaultMetricsSettings ¶ added in v0.44.0
func DefaultMetricsSettings() MetricsSettings