Skip to content

Commit

Permalink
Split out starter with env vars and without
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-berg committed Apr 1, 2024
1 parent 3681cdc commit 54b734b
Show file tree
Hide file tree
Showing 2 changed files with 254 additions and 81 deletions.
129 changes: 48 additions & 81 deletions examples/sdk-config.yaml
Original file line number Diff line number Diff line change
@@ -1,62 +1,29 @@
# sdk-config.yaml is a typical starting point for configuring the SDK, including exporting to
# localhost via OTLP.

# NOTE: With the exception of env var substitution syntax, SDKs ignore environment variables
# when interpreting config files.
#
# This template includes env var substitution references (i.e. ${MY_ENV}) for all spec defined
# env vars (https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/)
# which map cleanly to file configuration. For example, OTEL_SDK_DISABLED is referenced below,
# but OTEL_TRACES_EXPORTER is not since it does not map well to the hierarchical structure of
# file configuration.
#
# Because env vars are ignored except for env var substitution, if "disabled: ${OTEL_SDK_DISABLED:-false}"
# is replaced with "disabled: false", setting OTEL_SDK_DISALBED env var will not have any effect.
# See https://opentelemetry.io/docs/specs/otel/configuration/file-configuration/ for more information.
# The following spec defined env vars are NOT referenced and are thus ignored:
#
# - OTEL_RESOURCE_ATTRIBUTES
# - OTEL_LOG_LEVEL
# - OTEL_PROPAGATORS
# - OTEL_TRACES_SAMPLER
# - OTEL_TRACES_SAMPLER_ARG
# - OTEL_EXPORTER_ZIPKIN_ENDPOINT
# - OTEL_EXPORTER_ZIPKIN_TIMEOUT
# - OTEL_EXPORTER_PROMETHEUS_HOST
# - OTEL_EXPORTER_PROMETHEUS_PORT
# - OTEL_TRACES_EXPORTER
# - OTEL_METRICS_EXPORTER
# - OTEL_LOGS_EXPORTER
# - OTEL_METRICS_EXEMPLAR_FILTER
# - OTEL_EXPORTER_OTLP_{SIGNAL}_ENDPOINT
# - OTEL_EXPORTER_OTLP_{SIGNAL}_INSECURE
# - OTEL_EXPORTER_OTLP_{SIGNAL}_CERTIFICATE
# - OTEL_EXPORTER_OTLP_{SIGNAL}_CLIENT_KEY
# - OTEL_EXPORTER_OTLP_{SIGNAL}_CLIENT_CERTIFICATE
# - OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_{SIGNAL}_HEADERS
# - OTEL_EXPORTER_OTLP_{SIGNAL}_COMPRESSION
# - OTEL_EXPORTER_OTLP_{SIGNAL}_TIMEOUT
# - OTEL_EXPORTER_OTLP_{SIGNAL}_PROTOCOL
# NOTE: With the exception of env var substitution syntax (i.e. ${MY_ENV}) , SDKs ignore
# environment variables when interpreting config files. This including ignoring all env
# vars defined in https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/.

# The file format version
file_format: "0.1"

# Configure if the SDK is disabled or not.
disabled: ${OTEL_SDK_DISABLED:-false}
disabled: false

# Configure resource for all signals.
resource:
# Configure resource attributes.
attributes:
# Configure `service.name` resource attribute
service.name: ${OTEL_SERVICE_NAME:-unknown_service}
service.name: unknown_service

# Configure general attribute limits. See also tracer_provider.limits, logger_provider.limits.
attribute_limits:
# Configure max attribute value size.
attribute_value_length_limit: ${OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT}
attribute_value_length_limit:
# Configure max attribute count.
attribute_count_limit: ${OTEL_ATTRIBUTE_COUNT_LIMIT:-128}
attribute_count_limit: 128

# Configure text map context propagators.
propagator:
Expand All @@ -69,45 +36,45 @@ tracer_provider:
# Configure a batch span processor.
- batch:
# Configure delay interval (in milliseconds) between two consecutive exports.
schedule_delay: ${OTEL_BSP_SCHEDULE_DELAY:-5000}
schedule_delay: 5000
# Configure maximum allowed time (in milliseconds) to export data.
export_timeout: ${OTEL_BSP_EXPORT_TIMEOUT:-30000}
export_timeout: 30000
# Configure maximum queue size.
max_queue_size: ${OTEL_BSP_MAX_QUEUE_SIZE:-2048}
max_queue_size: 2048
# Configure maximum batch size.
max_export_batch_size: ${OTEL_BSP_MAX_EXPORT_BATCH_SIZE:-512}
max_export_batch_size: 512
# Configure exporter.
exporter:
# Configure exporter to be OTLP.
otlp:
# Configure protocol.
protocol: ${OTEL_EXPORTER_OTLP_PROTOCOL:-http/protobuf}
protocol: http/protobuf
# Configure endpoint.
endpoint: ${OTEL_EXPORTER_OTLP_PROTOCOL:-http://localhost:-4318}
endpoint: http://localhost:-4318
# Configure certificate.
certificate: ${OTEL_EXPORTER_OTLP_CERTIFICATE}
certificate:
# Configure mTLS private client key.
client_key: ${OTEL_EXPORTER_OTLP_CLIENT_KEY}
client_key:
# Configure mTLS client certificate.
client_certificate: ${OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE}
client_certificate:
# Configure compression.
compression: ${OTEL_EXPORTER_OTLP_COMPRESSION:-gzip}
compression: gzip
# Configure max time (in milliseconds) to wait for each export.
timeout: ${OTEL_EXPORTER_OTLP_TIMEOUT:-10000}
timeout: 10000
# Configure span limits. See also attribute_limits.
limits:
# Configure max span attribute value size. Overrides attribute_limits.attribute_value_length_limit.
attribute_value_length_limit: ${OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT}
attribute_value_length_limit:
# Configure max span attribute count. Overrides attribute_limits.attribute_count_limit.
attribute_count_limit: ${OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:-128}
attribute_count_limit: 128
# Configure max span event count.
event_count_limit: ${OTEL_SPAN_EVENT_COUNT_LIMIT:-128}
event_count_limit: 128
# Configure max span link count.
link_count_limit: ${OTEL_SPAN_LINK_COUNT_LIMIT:-128}
link_count_limit: 128
# Configure max attributes per span event.
event_attribute_count_limit: ${OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT:-128}
event_attribute_count_limit: 128
# Configure max attributes per span link.
link_attribute_count_limit: ${OTEL_LINK_ATTRIBUTE_COUNT_LIMIT:-128}
link_attribute_count_limit: 128
# Configure the sampler.
sampler:
# Configure sampler to be parent_based. Known values include: always_off, always_on, jaeger_remote, parent_based, trace_id_ratio_based.
Expand Down Expand Up @@ -140,31 +107,31 @@ meter_provider:
# Configure a periodic metric reader.
- periodic:
# Configure delay interval (in milliseconds) between start of two consecutive exports.
interval: ${OTEL_METRIC_EXPORT_INTERVAL:-60000}
interval: 60000
# Configure maximum allowed time (in milliseconds) to export data.
timeout: ${OTEL_METRIC_EXPORT_TIMEOUT:-30000}
timeout: 30000
# Configure exporter.
exporter:
# Configure exporter to be OTLP.
otlp:
# Configure protocol.
protocol: ${OTEL_EXPORTER_OTLP_PROTOCOL:-http/protobuf}
protocol: http/protobuf
# Configure endpoint.
endpoint: ${OTEL_EXPORTER_OTLP_PROTOCOL:-http://localhost:-4318}
endpoint: http://localhost:-4318
# Configure certificate.
certificate: ${OTEL_EXPORTER_OTLP_CERTIFICATE}
certificate:
# Configure mTLS private client key.
client_key: ${OTEL_EXPORTER_OTLP_CLIENT_KEY}
client_key:
# Configure mTLS client certificate.
client_certificate: ${OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE}
client_certificate:
# Configure compression.
compression: ${OTEL_EXPORTER_OTLP_COMPRESSION:-gzip}
compression: gzip
# Configure max time (in milliseconds) to wait for each export.
timeout: ${OTEL_EXPORTER_OTLP_TIMEOUT:-10000}
timeout: 10000
# Configure temporality preference.
temporality_preference: ${OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:-cumulative}
temporality_preference: cumulative
# Configure default histogram aggregation.
default_histogram_aggregation: ${OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION:-explicit_bucket_histogram}
default_histogram_aggregation: explicit_bucket_histogram

# Configure logger provider.
logger_provider:
Expand All @@ -173,34 +140,34 @@ logger_provider:
# Configure a batch log record processor.
- batch:
# Configure delay interval (in milliseconds) between two consecutive exports.
schedule_delay: ${OTEL_BLRP_SCHEDULE_DELAY:-1000}
schedule_delay: 1000
# Configure maximum allowed time (in milliseconds) to export data.
export_timeout: ${OTEL_BLRP_EXPORT_TIMEOUT:-30000}
export_timeout: 30000
# Configure maximum queue size.
max_queue_size: ${OTEL_BLRP_MAX_QUEUE_SIZE:-2048}
max_queue_size: 2048
# Configure maximum batch size.
max_export_batch_size: ${OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:-512}
max_export_batch_size: 512
# Configure exporter.
exporter:
# Configure exporter to be OTLP.
otlp:
# Configure protocol.
protocol: ${OTEL_EXPORTER_OTLP_PROTOCOL:-http/protobuf}
protocol: http/protobuf
# Configure endpoint.
endpoint: ${OTEL_EXPORTER_OTLP_PROTOCOL:-http://localhost:-4318}
endpoint: http://localhost:4318
# Configure certificate.
certificate: ${OTEL_EXPORTER_OTLP_CERTIFICATE}
certificate:
# Configure mTLS private client key.
client_key: ${OTEL_EXPORTER_OTLP_CLIENT_KEY}
client_key:
# Configure mTLS client certificate.
client_certificate: ${OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE}
client_certificate:
# Configure compression.
compression: ${OTEL_EXPORTER_OTLP_COMPRESSION:-gzip}
compression: gzip
# Configure max time (in milliseconds) to wait for each export.
timeout: ${OTEL_EXPORTER_OTLP_TIMEOUT:-10000}
timeout: 10000
# Configure log record limits. See also attribute_limits.
limits:
# Configure max log record attribute value size. Overrides attribute_limits.attribute_value_length_limit.
attribute_value_length_limit: ${OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT}
attribute_value_length_limit:
# Configure max log record attribute count. Overrides attribute_limits.attribute_count_limit.
attribute_count_limit: ${OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:-128}
attribute_count_limit: 128
Loading

0 comments on commit 54b734b

Please sign in to comment.