Documentation
¶
Index ¶
- func AddScopeMetricsIntoOtelMetrics(populateDataPoints dataPointPopulator, otelMetrics pmetric.Metrics, ...)
- func ConvertTelegrafToOtelMetrics(measurement string, fields map[string]interface{}, tags map[string]string, ...) (pmetric.Metrics, error)
- type OtelAccumulator
- type TestRunningInput
- type TestServiceRunningInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddScopeMetricsIntoOtelMetrics ¶
func AddScopeMetricsIntoOtelMetrics(populateDataPoints dataPointPopulator, otelMetrics pmetric.Metrics, measurement string, fields map[string]interface{}, tags map[string]string, t time.Time)
AddDataPointsIntoMetrics will use Telegraf's field (which holds subset metrics from the main metrics) and convert to OTEL's datapoint Example:
Metric { --> Metrics { Name: cpu --> ResourceMetrics: [{ TagList: [{key: mytag, value: myvalue}] --> Resource: { FieldList: [ --> Attributes: [{key: mytag, value: myvalue}] {key: cpu_usage_user, value: 0.005}, --> } ] --> ScopeMetrics: [{ Time: 1646946605 --> Metrics: [ Type: Gauge --> {Name: cpu_usage_user --> DataType: Gauge } --> DataPoints: [{ --> Attributes: [{key: mytag, value: myvalue}] --> Timestamp: 1646946605 --> Type: Double --> Val: 0.005 --> }] --> }] --> }] --> }] --> }
Types ¶
type OtelAccumulator ¶
type OtelAccumulator interface { // Accumulator Interface https://github.com/influxdata/telegraf/blob/381dc2272390cd9de1ce2b047a953f8337b55647/accumulator.go telegraf.Accumulator // GetOtelMetrics return the final OTEL metric that were gathered by scrape controller for each plugin GetOtelMetrics() pmetric.Metrics }
OtelAccumulator implements the telegraf.Accumulator interface, but works as an OTel plugin by passing the metrics onward to the next consumer
func NewAccumulator ¶
func NewAccumulator(input *models.RunningInput, ctx context.Context, consumer consumer.Metrics, logger *zap.Logger) OtelAccumulator
type TestRunningInput ¶
type TestRunningInput struct{}
func (*TestRunningInput) Description ¶
func (t *TestRunningInput) Description() string
func (*TestRunningInput) Gather ¶
func (t *TestRunningInput) Gather(_ telegraf.Accumulator) error
func (*TestRunningInput) SampleConfig ¶
func (t *TestRunningInput) SampleConfig() string
type TestServiceRunningInput ¶
type TestServiceRunningInput struct{}
func (*TestServiceRunningInput) Description ¶
func (t *TestServiceRunningInput) Description() string
func (*TestServiceRunningInput) Gather ¶
func (t *TestServiceRunningInput) Gather(_ telegraf.Accumulator) error
func (*TestServiceRunningInput) SampleConfig ¶
func (t *TestServiceRunningInput) SampleConfig() string
func (*TestServiceRunningInput) Start ¶
func (t *TestServiceRunningInput) Start(_ telegraf.Accumulator) error
func (*TestServiceRunningInput) Stop ¶
func (t *TestServiceRunningInput) Stop()
Click to show internal directories.
Click to hide internal directories.