otlp

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Overview

Copyright 2018 Google Inc. 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 Client

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

Client allows reading and writing from/to a remote gRPC endpoint. The implementation may hit a single backend, so the application should create a number of these clients.

func NewClient

func NewClient(conf ClientConfig) *Client

NewClient creates a new Client.

func (*Client) Close

func (c *Client) Close() error

func (*Client) Selftest

func (c *Client) Selftest(ctx context.Context) error

Selftest sends an empty request the endpoint.

func (*Client) Store

Store sends a batch of samples to the endpoint.

type ClientConfig

type ClientConfig struct {
	Logger           log.Logger
	URL              *url.URL
	Timeout          time.Duration
	RootCertificates []string
	Headers          grpcMetadata.MD
	Compressor       string
	Prometheus       config.PromConfig
	FailingReporter  common.FailingReporter
}

ClientConfig configures a Client.

type ExportMetricsRequestWriterCloser

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

ExportMetricsRequestWriterCloser allows writing protobuf message monitoring.ExportMetricsRequest as wire format into the writerCloser.

func NewExportMetricsServiceRequestWriterCloser

func NewExportMetricsServiceRequestWriterCloser(writeCloser io.WriteCloser, logger log.Logger) *ExportMetricsRequestWriterCloser

func (*ExportMetricsRequestWriterCloser) Close

func (*ExportMetricsRequestWriterCloser) Store

Store writes protobuf message monitoring.ExportMetricsRequest as wire format into the writeCloser.

type LogReaderClient

type LogReaderClient interface {
	Size() (int, error)
	Offset() int
}

type QueueManager

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

QueueManager manages a queue of samples to be sent to the Storage indicated by the provided StorageClient.

func NewQueueManager

func NewQueueManager(logger log.Logger, cfg promconfig.QueueConfig, timeout time.Duration, clientFactory StorageClientFactory, tailer LogReaderClient, resource *resourcepb.Resource) (*QueueManager, error)

NewQueueManager builds a new QueueManager.

func (*QueueManager) Append

func (t *QueueManager) Append(sample retrieval.SizedMetric)

Append queues a sample to be sent to the OpenTelemetry API.

func (*QueueManager) Start

func (t *QueueManager) Start() error

Start the queue manager sending samples to the remote storage. Does not block.

func (*QueueManager) Stop

func (t *QueueManager) Stop() error

Stop stops sending samples to the remote storage and waits for pending sends to complete.

type StorageClient

type StorageClient interface {
	// Store stores the given metric families in the remote storage.
	Store(*metricsService.ExportMetricsServiceRequest) error
	// Test this connection
	Selftest(context.Context) error
	// Release the resources allocated by the client.
	Close() error
}

StorageClient defines an interface for sending a batch of samples to an external timeseries database.

type StorageClientFactory

type StorageClientFactory interface {
	New() StorageClient
	Name() string
}

Jump to

Keyboard shortcuts

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