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 ¶
const (
MaxTimeseriesesPerRequest = 200
)
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 (*Client) Store ¶
func (c *Client) Store(req *metricsService.ExportMetricsServiceRequest) error
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 }
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 (c *ExportMetricsRequestWriterCloser) Close() error
func (*ExportMetricsRequestWriterCloser) Store ¶
func (c *ExportMetricsRequestWriterCloser) Store(req *metricsService.ExportMetricsServiceRequest) error
Store writes protobuf message monitoring.ExportMetricsRequest as wire format into the writeCloser.
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 config.QueueConfig, clientFactory StorageClientFactory, tailer *tail.Tailer) (*QueueManager, error)
NewQueueManager builds a new QueueManager.
func (*QueueManager) Append ¶
func (t *QueueManager) Append(hash uint64, sample *metric_pb.ResourceMetrics) error
Append queues a sample to be sent to the OpenTelemetry API. Always returns nil.
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 }