internal

package
v1.4.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Package internal is a near copy of https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/90603afc2fe0c44c9398822e4afa3a4e045f4524/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 receiver.Settings,
	gcInterval time.Duration,
	useStartTimeMetric bool,
	startTimeMetricRegex *regexp.Regexp,
	useCreatedMetric bool,
	enableNativeHistograms bool,
	externalLabels labels.Labels,
	trimSuffixes bool) (storage.Appendable, error)

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
}

func NewInitialPointAdjuster

func NewInitialPointAdjuster(logger *zap.Logger, gcInterval time.Duration, useCreatedMetric bool) 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