mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-01-07 23:02:15 +02:00
8d80981465
* Move grpc stuff to separate package * Drop duplicated retryable status code * Set default port to 4317 This is what the specification says for both gRPC and HTTP. * Document gRPC option type * Add an HTTP protocol driver for OTLP exporter Currently it supports only binary protobuf payloads. * Move end to end test to a separate package It also adds some common code mock collectors can use. This will be useful for testing the HTTP driver. * Move export data creators to otlptest It also extends the one record checkpointer a bit. This will be useful for testing the HTTP driver. * Add an HTTP mock collector and tests for HTTP driver * Update changelog * Do not depend on DefaultTransport We create our own instance of the transport, which is based on golang's DefaultTransport. That way we sidestep the issue of the DefaultTransport being modified/overwritten. We won't have any panics at init. The cost of it is to keep the transport fields in sync with DefaultTransport. * Read the whole response body before closing it This may help with connection reuse. * Change options to conform to our style guide * Add jitter to backoff time * Test TLS option * Test extra headers * Fix a comment * Increase coverage * Add a source of the backoff strategy
46 lines
1.6 KiB
Go
46 lines
1.6 KiB
Go
// 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.
|
|
|
|
package otlp // import "go.opentelemetry.io/otel/exporters/otlp"
|
|
|
|
import (
|
|
metricsdk "go.opentelemetry.io/otel/sdk/export/metric"
|
|
)
|
|
|
|
const (
|
|
// DefaultCollectorPort is the port the Exporter will attempt connect to
|
|
// if no collector port is provided.
|
|
DefaultCollectorPort uint16 = 4317
|
|
// DefaultCollectorHost is the host address the Exporter will attempt
|
|
// connect to if no collector address is provided.
|
|
DefaultCollectorHost string = "localhost"
|
|
)
|
|
|
|
// ExporterOption are setting options passed to an Exporter on creation.
|
|
type ExporterOption func(*config)
|
|
|
|
type config struct {
|
|
exportKindSelector metricsdk.ExportKindSelector
|
|
}
|
|
|
|
// WithMetricExportKindSelector defines the ExportKindSelector used
|
|
// for selecting AggregationTemporality (i.e., Cumulative vs. Delta
|
|
// aggregation). If not specified otherwise, exporter will use a
|
|
// cumulative export kind selector.
|
|
func WithMetricExportKindSelector(selector metricsdk.ExportKindSelector) ExporterOption {
|
|
return func(cfg *config) {
|
|
cfg.exportKindSelector = selector
|
|
}
|
|
}
|