-
Notifications
You must be signed in to change notification settings - Fork 464
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add handling of environment variables in Secrets
Load also environment variables defined in Secret to make them visible to OpenTelemetry Operator. Signed-off-by: Oldřich Jedlička <[email protected]>
- Loading branch information
Showing
13 changed files
with
567 additions
and
63 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
change_type: enhancement | ||
|
||
# The name of the component, or a single word describing the area of concern, (e.g. collector, target allocator, auto-instrumentation, opamp, github action) | ||
component: auto-instrumentation | ||
|
||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
note: Add support for detecting and reading environment variables from POD's Secret resources. | ||
|
||
# One or more tracking issues related to the change | ||
issues: [1393, 1814] | ||
|
||
# (Optional) One or more lines of additional information to render under the primary note. | ||
# These lines will be padded with 2 spaces and then inserted directly into the document. | ||
# Use pipe (|) for multiline entries. | ||
subtext: | | ||
Now the auto-instrumentation will see the environment variables defined via POD's `env.valueFrom.secretKeyRef` and | ||
`envFrom.secretRef` fields, so the auto-instrumentation will be able to prevent overriding them, or it will be able to | ||
extend the existing definition. |
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
22 changes: 22 additions & 0 deletions
22
tests/e2e-instrumentation/instrumentation-java-envfrom-secret/00-install-collector.yaml
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,22 @@ | ||
apiVersion: opentelemetry.io/v1alpha1 | ||
kind: OpenTelemetryCollector | ||
metadata: | ||
name: sidecar | ||
spec: | ||
config: | | ||
receivers: | ||
otlp: | ||
protocols: | ||
grpc: | ||
http: | ||
processors: | ||
exporters: | ||
debug: | ||
service: | ||
pipelines: | ||
traces: | ||
receivers: [otlp] | ||
exporters: [debug] | ||
mode: sidecar |
34 changes: 34 additions & 0 deletions
34
...s/e2e-instrumentation/instrumentation-java-envfrom-secret/00-install-instrumentation.yaml
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,34 @@ | ||
apiVersion: opentelemetry.io/v1alpha1 | ||
kind: Instrumentation | ||
metadata: | ||
name: java | ||
spec: | ||
env: | ||
- name: OTEL_TRACES_EXPORTER | ||
value: otlp | ||
- name: OTEL_EXPORTER_OTLP_ENDPOINT | ||
value: http://localhost:4317 | ||
- name: OTEL_EXPORTER_OTLP_TIMEOUT | ||
value: "20" | ||
- name: OTEL_TRACES_SAMPLER | ||
value: parentbased_traceidratio | ||
- name: OTEL_TRACES_SAMPLER_ARG | ||
value: "0.85" | ||
- name: SPLUNK_TRACE_RESPONSE_HEADER_ENABLED | ||
value: "true" | ||
exporter: | ||
endpoint: http://localhost:4317 | ||
propagators: | ||
- jaeger | ||
- b3 | ||
sampler: | ||
type: parentbased_traceidratio | ||
argument: "0.25" | ||
java: | ||
env: | ||
- name: OTEL_JAVAAGENT_DEBUG | ||
value: "true" | ||
- name: OTEL_INSTRUMENTATION_JDBC_ENABLED | ||
value: "false" | ||
- name: SPLUNK_PROFILER_ENABLED | ||
value: "false" |
Oops, something went wrong.