Skip to content

Commit 30cc379

Browse files
authored
1 parent e3892f0 commit 30cc379

File tree

2 files changed

+55
-2
lines changed

2 files changed

+55
-2
lines changed
Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,58 @@
11
// Copyright The OpenTelemetry Authors
22
// SPDX-License-Identifier: Apache-2.0
33

4-
// Package otlploggrpc provides an OTLP log exporter. The exporter uses gRPC to
5-
// transport OTLP protobuf payloads.
4+
/*
5+
Package otlploggrpc provides an OTLP log exporter using gRPC. The exporter uses gRPC to
6+
transport OTLP protobuf payloads.
7+
8+
All Exporters must be created with [New].
9+
10+
The environment variables described below can be used for configuration.
11+
12+
OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_LOGS_ENDPOINT (default: "https://localhost:4317") -
13+
target to which the exporter sends telemetry.
14+
The target syntax is defined in https://github.com/grpc/grpc/blob/master/doc/naming.md.
15+
The value must contain a host.
16+
The value may additionally contain a port, a scheme, and a path.
17+
The value accepts "http" and "https" scheme.
18+
The value should not contain a query string or fragment.
19+
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT takes precedence over OTEL_EXPORTER_OTLP_ENDPOINT.
20+
The configuration can be overridden by [WithEndpoint], [WithEndpointURL], [WithInsecure], and [WithGRPCConn] options.
21+
22+
OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_LOGS_HEADERS (default: none) -
23+
key-value pairs used as gRPC metadata associated with gRPC requests.
24+
The value is expected to be represented in a format matching the [W3C Baggage HTTP Header Content Format],
25+
except that additional semi-colon delimited metadata is not supported.
26+
Example value: "key1=value1,key2=value2".
27+
OTEL_EXPORTER_OTLP_LOGS_HEADERS takes precedence over OTEL_EXPORTER_OTLP_HEADERS.
28+
The configuration can be overridden by [WithHeaders] option.
29+
30+
OTEL_EXPORTER_OTLP_TIMEOUT, OTEL_EXPORTER_OTLP_LOGS_TIMEOUT (default: "10000") -
31+
maximum time in milliseconds the OTLP exporter waits for each batch export.
32+
OTEL_EXPORTER_OTLP_LOGS_TIMEOUT takes precedence over OTEL_EXPORTER_OTLP_TIMEOUT.
33+
The configuration can be overridden by [WithTimeout] option.
34+
35+
OTEL_EXPORTER_OTLP_COMPRESSION, OTEL_EXPORTER_OTLP_LOGS_COMPRESSION (default: none) -
36+
the gRPC compressor the exporter uses.
37+
Supported value: "gzip".
38+
OTEL_EXPORTER_OTLP_LOGS_COMPRESSION takes precedence over OTEL_EXPORTER_OTLP_COMPRESSION.
39+
The configuration can be overridden by [WithCompressor], [WithGRPCConn] options.
40+
41+
OTEL_EXPORTER_OTLP_CERTIFICATE, OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE (default: none) -
42+
the filepath to the trusted certificate to use when verifying a server's TLS credentials.
43+
OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE takes precedence over OTEL_EXPORTER_OTLP_CERTIFICATE.
44+
The configuration can be overridden by [WithTLSCredentials], [WithGRPCConn] options.
45+
46+
OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE, OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE (default: none) -
47+
the filepath to the client certificate/chain trust for client's private key to use in mTLS communication in PEM format.
48+
OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE takes precedence over OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE.
49+
The configuration can be overridden by [WithTLSCredentials], [WithGRPCConn] options.
50+
51+
OTEL_EXPORTER_OTLP_CLIENT_KEY, OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY (default: none) -
52+
the filepath to the client's private key to use in mTLS communication in PEM format.
53+
OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY takes precedence over OTEL_EXPORTER_OTLP_CLIENT_KEY.
54+
The configuration can be overridden by [WithTLSCredentials], [WithGRPCConn] option.
55+
56+
[W3C Baggage HTTP Header Content Format]: https://www.w3.org/TR/baggage/#header-content
57+
*/
658
package otlploggrpc // import "go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc"

exporters/otlp/otlplog/otlploggrpc/exporter.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ type logClient interface {
2020

2121
// Exporter is a OpenTelemetry log Exporter. It transports log data encoded as
2222
// OTLP protobufs using gRPC.
23+
// All Exporters must be created with [New].
2324
type Exporter struct {
2425
// Ensure synchronous access to the client across all functionality.
2526
clientMu sync.Mutex

0 commit comments

Comments
 (0)