otlp

package
v0.0.0-...-bbb0757 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Overview

Copyright 2024 The Prometheus 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

This section is empty.

Types

type ByLabelName

type ByLabelName []mimirpb.LabelAdapter

ByLabelName enables the usage of sort.Sort() with a slice of labels.

func (ByLabelName) Len

func (a ByLabelName) Len() int

func (ByLabelName) Less

func (a ByLabelName) Less(i, j int) bool

func (ByLabelName) Swap

func (a ByLabelName) Swap(i, j int)

type MimirConverter

type MimirConverter struct {
	// contains filtered or unexported fields
}

MimirConverter converts from OTel write format to Mimir remote write format.

func NewMimirConverter

func NewMimirConverter() *MimirConverter

func (*MimirConverter) FromMetrics

func (c *MimirConverter) FromMetrics(ctx context.Context, md pmetric.Metrics, settings Settings, logger *slog.Logger) (annots annotations.Annotations, errs error)

FromMetrics converts pmetric.Metrics to Mimir remote write format.

func (*MimirConverter) TimeSeries

func (c *MimirConverter) TimeSeries() []mimirpb.PreallocTimeseries

TimeSeries returns a slice of the mimirpb.TimeSeries that were converted from OTel format.

type Settings

type Settings struct {
	Namespace                         string
	ExternalLabels                    map[string]string
	DisableTargetInfo                 bool
	ExportCreatedMetric               bool
	AddMetricSuffixes                 bool
	SendMetadata                      bool
	AllowUTF8                         bool
	PromoteResourceAttributes         []string
	KeepIdentifyingResourceAttributes bool

	// Mimir specifics.
	EnableCreatedTimestampZeroIngestion        bool
	ValidIntervalCreatedTimestampZeroIngestion time.Duration
}

type StartTsAndTs

type StartTsAndTs struct {
	Labels  []mimirpb.LabelAdapter
	StartTs int64
	Ts      int64
}

Jump to

Keyboard shortcuts

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