1 // Copyright The OpenTelemetry Authors 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 /* 16 Package otlptracegrpc provides an OTLP span exporter using gRPC. 17 By default the telemetry is sent to https://localhost:4317. 18 19 Exporter should be created using [New]. 20 21 The environment variables described below can be used for configuration. 22 23 OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_TRACES_ENDPOINT (default: "https://localhost:4317") - 24 target to which the exporter sends telemetry. 25 The target syntax is defined in https://github.com/grpc/grpc/blob/master/doc/naming.md. 26 The value must contain a host. 27 The value may additionally a port, a scheme, and a path. 28 The value accepts "http" and "https" scheme. 29 The value should not contain a query string or fragment. 30 OTEL_EXPORTER_OTLP_TRACES_ENDPOINT takes precedence over OTEL_EXPORTER_OTLP_ENDPOINT. 31 The configuration can be overridden by [WithEndpoint], [WithInsecure], [WithGRPCConn] options. 32 33 OTEL_EXPORTER_OTLP_INSECURE, OTEL_EXPORTER_OTLP_TRACES_INSECURE (default: "false") - 34 setting "true" disables client transport security for the exporter's gRPC connection. 35 You can use this only when an endpoint is provided without the http or https scheme. 36 OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_TRACES_ENDPOINT setting overrides 37 the scheme defined via OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_TRACES_ENDPOINT. 38 OTEL_EXPORTER_OTLP_TRACES_INSECURE takes precedence over OTEL_EXPORTER_OTLP_INSECURE. 39 The configuration can be overridden by [WithInsecure], [WithGRPCConn] options. 40 41 OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_TRACES_HEADERS (default: none) - 42 key-value pairs used as gRPC metadata associated with gRPC requests. 43 The value is expected to be represented in a format matching to the [W3C Baggage HTTP Header Content Format], 44 except that additional semi-colon delimited metadata is not supported. 45 Example value: "key1=value1,key2=value2". 46 OTEL_EXPORTER_OTLP_TRACES_HEADERS takes precedence over OTEL_EXPORTER_OTLP_HEADERS. 47 The configuration can be overridden by [WithHeaders] option. 48 49 OTEL_EXPORTER_OTLP_TIMEOUT, OTEL_EXPORTER_OTLP_TRACES_TIMEOUT (default: "10000") - 50 maximum time in milliseconds the OTLP exporter waits for each batch export. 51 OTEL_EXPORTER_OTLP_TRACES_TIMEOUT takes precedence over OTEL_EXPORTER_OTLP_TIMEOUT. 52 The configuration can be overridden by [WithTimeout] option. 53 54 OTEL_EXPORTER_OTLP_COMPRESSION, OTEL_EXPORTER_OTLP_TRACES_COMPRESSION (default: none) - 55 the gRPC compressor the exporter uses. 56 Supported value: "gzip". 57 OTEL_EXPORTER_OTLP_TRACES_COMPRESSION takes precedence over OTEL_EXPORTER_OTLP_COMPRESSION. 58 The configuration can be overridden by [WithCompressor], [WithGRPCConn] options. 59 60 OTEL_EXPORTER_OTLP_CERTIFICATE, OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE (default: none) - 61 the filepath to the trusted certificate to use when verifying a server's TLS credentials. 62 OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE takes precedence over OTEL_EXPORTER_OTLP_CERTIFICATE. 63 The configuration can be overridden by [WithTLSCredentials], [WithGRPCConn] options. 64 65 OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE, OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE (default: none) - 66 the filepath to the client certificate/chain trust for clients private key to use in mTLS communication in PEM format. 67 OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE takes precedence over OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE. 68 The configuration can be overridden by [WithTLSCredentials], [WithGRPCConn] options. 69 70 OTEL_EXPORTER_OTLP_CLIENT_KEY, OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY (default: none) - 71 the filepath to the clients private key to use in mTLS communication in PEM format. 72 OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY takes precedence over OTEL_EXPORTER_OTLP_CLIENT_KEY. 73 The configuration can be overridden by [WithTLSCredentials], [WithGRPCConn] option. 74 75 [W3C Baggage HTTP Header Content Format]: https://www.w3.org/TR/baggage/#header-content 76 */ 77 package otlptracegrpc // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc" 78