New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add sdk-config.yaml starter template w/ references to env vars #76
Open
jack-berg
wants to merge
7
commits into
open-telemetry:main
Choose a base branch
from
jack-berg:starter-template
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3c35cd0
Update schema to accept null values
jack-berg 3681cdc
Add sdk-config.yaml starter template
jack-berg 54b734b
Split out starter with env vars and without
jack-berg 73cd03f
Fix typos, add links to examples from readme
jack-berg ce16337
Merge branch 'main' into starter-template
jack-berg dba6f64
Fix typo
jack-berg d9c480c
Merge branch 'starter-template' of https://github.com/jack-berg/opent…
jack-berg File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,206 @@ | ||||||
# 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 | ||||||
|
||||||
# The file format version | ||||||
file_format: "0.1" | ||||||
|
||||||
# Configure if the SDK is disabled or not. | ||||||
disabled: ${OTEL_SDK_DISABLED:-false} | ||||||
|
||||||
# Configure resource for all signals. | ||||||
resource: | ||||||
# Configure resource attributes. | ||||||
attributes: | ||||||
# Configure `service.name` resource attribute | ||||||
service.name: ${OTEL_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} | ||||||
# Configure max attribute count. | ||||||
attribute_count_limit: ${OTEL_ATTRIBUTE_COUNT_LIMIT:-128} | ||||||
|
||||||
# Configure text map context propagators. | ||||||
propagator: | ||||||
composite: [tracecontext, baggage] | ||||||
|
||||||
# Configure tracer provider. | ||||||
tracer_provider: | ||||||
# Configure span processors. | ||||||
processors: | ||||||
# Configure a batch span processor. | ||||||
- batch: | ||||||
# Configure delay interval (in milliseconds) between two consecutive exports. | ||||||
schedule_delay: ${OTEL_BSP_SCHEDULE_DELAY:-5000} | ||||||
# Configure maximum allowed time (in milliseconds) to export data. | ||||||
export_timeout: ${OTEL_BSP_EXPORT_TIMEOUT:-30000} | ||||||
# Configure maximum queue size. | ||||||
max_queue_size: ${OTEL_BSP_MAX_QUEUE_SIZE:-2048} | ||||||
# Configure maximum batch size. | ||||||
max_export_batch_size: ${OTEL_BSP_MAX_EXPORT_BATCH_SIZE:-512} | ||||||
# Configure exporter. | ||||||
exporter: | ||||||
# Configure exporter to be OTLP. | ||||||
otlp: | ||||||
# Configure protocol. | ||||||
protocol: ${OTEL_EXPORTER_OTLP_PROTOCOL:-http/protobuf} | ||||||
# Configure endpoint. | ||||||
endpoint: ${OTEL_EXPORTER_OTLP_PROTOCOL:-http://localhost:-4318} | ||||||
# Configure certificate. | ||||||
certificate: ${OTEL_EXPORTER_OTLP_CERTIFICATE} | ||||||
# Configure mTLS private client key. | ||||||
client_key: ${OTEL_EXPORTER_OTLP_CLIENT_KEY} | ||||||
# Configure mTLS client certificate. | ||||||
client_certificate: ${OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE} | ||||||
# Configure compression. | ||||||
compression: ${OTEL_EXPORTER_OTLP_COMPRESSION:-gzip} | ||||||
# Configure max time (in milliseconds) to wait for each export. | ||||||
timeout: ${OTEL_EXPORTER_OTLP_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} | ||||||
# Configure max span attribute count. Overrides attribute_limits.attribute_count_limit. | ||||||
attribute_count_limit: ${OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:-128} | ||||||
# Configure max span event count. | ||||||
event_count_limit: ${OTEL_SPAN_EVENT_COUNT_LIMIT:-128} | ||||||
# Configure max span link count. | ||||||
link_count_limit: ${OTEL_SPAN_LINK_COUNT_LIMIT:-128} | ||||||
# Configure max attributes per span event. | ||||||
event_attribute_count_limit: ${OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT:-128} | ||||||
# Configure max attributes per span link. | ||||||
link_attribute_count_limit: ${OTEL_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. | ||||||
parent_based: | ||||||
# Configure root sampler. | ||||||
root: | ||||||
# Configure sampler to be always_on. | ||||||
always_on: {} | ||||||
# Configure remote_parent_sampled sampler. | ||||||
remote_parent_sampled: | ||||||
# Configure sampler to be always_on. | ||||||
always_on: {} | ||||||
# Configure remote_parent_not_sampled sampler. | ||||||
remote_parent_not_sampled: | ||||||
# Configure sampler to be always_off. | ||||||
always_off: {} | ||||||
# Configure local_parent_sampled sampler. | ||||||
local_parent_sampled: | ||||||
# Configure sampler to be always_on. | ||||||
always_on: {} | ||||||
# Configure local_parent_not_sampled sampler. | ||||||
local_parent_not_sampled: | ||||||
# Configure sampler to be always_off. | ||||||
always_off: {} | ||||||
|
||||||
# Configure meter provider. | ||||||
meter_provider: | ||||||
# Configure metric readers. | ||||||
readers: | ||||||
# Configure a periodic metric reader. | ||||||
- periodic: | ||||||
# Configure delay interval (in milliseconds) between start of two consecutive exports. | ||||||
interval: ${OTEL_METRIC_EXPORT_INTERVAL:-60000} | ||||||
# Configure maximum allowed time (in milliseconds) to export data. | ||||||
timeout: ${OTEL_METRIC_EXPORT_TIMEOUT:-30000} | ||||||
# Configure exporter. | ||||||
exporter: | ||||||
# Configure exporter to be OTLP. | ||||||
otlp: | ||||||
# Configure protocol. | ||||||
protocol: ${OTEL_EXPORTER_OTLP_PROTOCOL:-http/protobuf} | ||||||
# Configure endpoint. | ||||||
endpoint: ${OTEL_EXPORTER_OTLP_PROTOCOL:-http://localhost:-4318} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
# Configure certificate. | ||||||
certificate: ${OTEL_EXPORTER_OTLP_CERTIFICATE} | ||||||
# Configure mTLS private client key. | ||||||
client_key: ${OTEL_EXPORTER_OTLP_CLIENT_KEY} | ||||||
# Configure mTLS client certificate. | ||||||
client_certificate: ${OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE} | ||||||
# Configure compression. | ||||||
compression: ${OTEL_EXPORTER_OTLP_COMPRESSION:-gzip} | ||||||
# Configure max time (in milliseconds) to wait for each export. | ||||||
timeout: ${OTEL_EXPORTER_OTLP_TIMEOUT:-10000} | ||||||
# Configure temporality preference. | ||||||
temporality_preference: ${OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:-cumulative} | ||||||
# Configure default histogram aggregation. | ||||||
default_histogram_aggregation: ${OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION:-explicit_bucket_histogram} | ||||||
|
||||||
# Configure logger provider. | ||||||
logger_provider: | ||||||
# Configure log record processors. | ||||||
processors: | ||||||
# Configure a batch log record processor. | ||||||
- batch: | ||||||
# Configure delay interval (in milliseconds) between two consecutive exports. | ||||||
schedule_delay: ${OTEL_BLRP_SCHEDULE_DELAY:-1000} | ||||||
# Configure maximum allowed time (in milliseconds) to export data. | ||||||
export_timeout: ${OTEL_BLRP_EXPORT_TIMEOUT:-30000} | ||||||
# Configure maximum queue size. | ||||||
max_queue_size: ${OTEL_BLRP_MAX_QUEUE_SIZE:-2048} | ||||||
# Configure maximum batch size. | ||||||
max_export_batch_size: ${OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:-512} | ||||||
# Configure exporter. | ||||||
exporter: | ||||||
# Configure exporter to be OTLP. | ||||||
otlp: | ||||||
# Configure protocol. | ||||||
protocol: ${OTEL_EXPORTER_OTLP_PROTOCOL:-http/protobuf} | ||||||
# Configure endpoint. | ||||||
endpoint: ${OTEL_EXPORTER_OTLP_PROTOCOL:-http://localhost:-4318} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
# Configure certificate. | ||||||
certificate: ${OTEL_EXPORTER_OTLP_CERTIFICATE} | ||||||
# Configure mTLS private client key. | ||||||
client_key: ${OTEL_EXPORTER_OTLP_CLIENT_KEY} | ||||||
# Configure mTLS client certificate. | ||||||
client_certificate: ${OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE} | ||||||
# Configure compression. | ||||||
compression: ${OTEL_EXPORTER_OTLP_COMPRESSION:-gzip} | ||||||
# Configure max time (in milliseconds) to wait for each export. | ||||||
timeout: ${OTEL_EXPORTER_OTLP_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} | ||||||
# Configure max log record attribute count. Overrides attribute_limits.attribute_count_limit. | ||||||
attribute_count_limit: ${OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:-128} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
{ | ||
"devDependencies": { | ||
"ajv-cli": "^5.0.0" | ||
}, | ||
"dependencies": { | ||
"envsub": "^4.1.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would make it
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
Also, its currently using
OTEL_EXPORTER_OTLP_PROTOCOL
when I'm guessing it wants eitherOTEL_EXPORTER_OTLP_TRACES_ENDPOINT
or to actually put the path outside the environment variable default to apply to both:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point on the TRACES part. So, something like this then:
This also means using the TRACES env var for PROTOCOL, CERTIFICATES, CLIENT_KEY, etc as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to decide between the generic version of these properties and the signal specific. I think the generic version of these is likely to be more popular. But the generic version of the property doesn't require you to configure a path.
One thing which is still ambiguous is whether the endpoints specified in file config have paths appended automatically if the protocol is
http/protobuf
and the path is omitted. I lean towards yes.If the answer is no, then we should go back and update the other examples, which currently reference
http://localhost:4318
without any path: https://github.com/open-telemetry/opentelemetry-configuration/blob/main/examples/kitchen-sink.yaml#L64