internal

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

Package internal is a near copy of https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.61.0/receiver/prometheusreceiver/internal A copy was made because the upstream package is internal. If it is ever made public, our copy can be removed.

Copyright The OpenTelemetry Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateResource

func CreateResource(job, instance string, serviceDiscoveryLabels labels.Labels) pcommon.Resource

CreateResource creates the resource data added to OTLP payloads.

func NewAppendable

func NewAppendable(
	sink consumer.Metrics,
	set component.ReceiverCreateSettings,
	gcInterval time.Duration,
	useStartTimeMetric bool,
	startTimeMetricRegex *regexp.Regexp,
	receiverID config.ComponentID,
	externalLabels labels.Labels) storage.Appendable

NewAppendable returns a storage.Appendable instance that emits metrics to the sink.

func NewZapToGokitLogAdapter

func NewZapToGokitLogAdapter(logger *zap.Logger) gokitLog.Logger

NewZapToGokitLogAdapter create an adapter for zap.Logger to gokitLog.Logger

Types

type JobsMap

type JobsMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

JobsMap maps from a job instance to a map of timeseries instances for the job.

func NewJobsMap

func NewJobsMap(gcInterval time.Duration) *JobsMap

NewJobsMap creates a new (empty) JobsMap.

type MetricsAdjuster

type MetricsAdjuster interface {
	AdjustMetrics(metrics pmetric.Metrics) error
}

MetricsAdjuster adjusts the start time of metrics when converting between Prometheus and OTel.

func NewInitialPointAdjuster

func NewInitialPointAdjuster(logger *zap.Logger, gcInterval time.Duration) MetricsAdjuster

NewInitialPointAdjuster returns a new MetricsAdjuster that adjust metrics' start times based on the initial received points.

func NewStartTimeMetricAdjuster

func NewStartTimeMetricAdjuster(logger *zap.Logger, startTimeMetricRegex *regexp.Regexp) MetricsAdjuster

NewStartTimeMetricAdjuster returns a new MetricsAdjuster that adjust metrics' start times based on a start time metric.

Jump to

Keyboard shortcuts

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