Skip to content

Commit

Permalink
Oct2024 updates (#313)
Browse files Browse the repository at this point in the history
* Update upstream otel-lambda to latest

* Update splunk-otel-python to 1.21.0 and otel dependencies accordingly

* Fix direct lambda call propagation
  • Loading branch information
johnbley authored Oct 30, 2024
1 parent 763c2a1 commit ad0e601
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
18 changes: 16 additions & 2 deletions nodejs/src/wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { diag, DiagConsoleLogger, isSpanContextValid, TraceFlags } from "@opentelemetry/api";
import { diag, DiagConsoleLogger, isSpanContextValid, propagation, context as otelContext, TraceFlags } from "@opentelemetry/api";
import { NodeTracerConfig } from '@opentelemetry/sdk-trace-node';
import { getEnv } from '@opentelemetry/core';
import { detectResources, envDetector, processDetector } from '@opentelemetry/resources';
Expand Down Expand Up @@ -100,9 +100,23 @@ const responseHook: ResponseHook = (span, data) => {
appendHeader(data.res.headers, 'Server-Timing', `traceparent;desc="00-${traceId}-${spanId}-${flags}"`);
};

const awsContextPropDisabled = typeof process.env['OTEL_LAMBDA_DISABLE_AWS_CONTEXT_PROPAGATION'] === 'string'
&& process.env['OTEL_LAMBDA_DISABLE_AWS_CONTEXT_PROPAGATION'].toLowerCase() === 'true';

const extraLambdaConfig = awsContextPropDisabled ?
{
// enable trace chaining; FIXME should fix this in upstream?
eventContextExtractor: (event: any, context: any) => {
const eventContext = propagation.extract(otelContext.active(), context.clientContext?.Custom);
return eventContext;
},
} :
{ };

const instrumentations = [
new AwsLambdaInstrumentation({
responseHook
responseHook,
...extraLambdaConfig,
}),
...getInstrumentations(),
];
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-lambda
Submodule opentelemetry-lambda updated 64 files
+1 −1 .github/workflows/ci-nodejs.yml
+2 −0 .github/workflows/close-stale.yaml
+16 −2 .github/workflows/release-layer-collector.yml
+16 −1 .github/workflows/release-layer-java.yml
+18 −3 .github/workflows/release-layer-nodejs.yml
+16 −1 .github/workflows/release-layer-python.yml
+16 −1 .github/workflows/release-layer-ruby.yml
+2 −0 README.md
+2 −2 collector/Makefile
+42 −3 collector/README.md
+4 −4 collector/config.yaml
+130 −112 collector/go.mod
+272 −232 collector/go.sum
+26 −27 collector/internal/tools/go.mod
+58 −61 collector/internal/tools/go.sum
+19 −0 collector/lambdacomponents/connector/pkg.go
+28 −0 collector/lambdacomponents/connector/spanmetrics.go
+83 −0 collector/lambdacomponents/custom.go
+2 −0 collector/lambdacomponents/default.go
+28 −0 collector/lambdacomponents/exporter/debug.go
+28 −0 collector/lambdacomponents/exporter/logging.go
+28 −0 collector/lambdacomponents/exporter/otlp.go
+28 −0 collector/lambdacomponents/exporter/otlphttp.go
+19 −0 collector/lambdacomponents/exporter/pkg.go
+28 −0 collector/lambdacomponents/exporter/prometheusremotewrite.go
+19 −0 collector/lambdacomponents/extension/pkg.go
+28 −0 collector/lambdacomponents/extension/sigv4auth.go
+121 −99 collector/lambdacomponents/go.mod
+256 −214 collector/lambdacomponents/go.sum
+28 −0 collector/lambdacomponents/processor/attributes.go
+28 −0 collector/lambdacomponents/processor/batch.go
+28 −0 collector/lambdacomponents/processor/coldstart.go
+28 −0 collector/lambdacomponents/processor/decouple.go
+28 −0 collector/lambdacomponents/processor/filter.go
+28 −0 collector/lambdacomponents/processor/memorylimiter.go
+19 −0 collector/lambdacomponents/processor/pkg.go
+28 −0 collector/lambdacomponents/processor/probabilisticsampler.go
+28 −0 collector/lambdacomponents/processor/resource.go
+28 −0 collector/lambdacomponents/processor/span.go
+28 −0 collector/lambdacomponents/receiver/otlp.go
+19 −0 collector/lambdacomponents/receiver/pkg.go
+28 −0 collector/lambdacomponents/receiver/telemetryapi.go
+1 −1 collector/lambdalifecycle/go.mod
+28 −27 collector/processor/coldstartprocessor/go.mod
+56 −48 collector/processor/coldstartprocessor/go.sum
+29 −31 collector/processor/decoupleprocessor/go.mod
+58 −56 collector/processor/decoupleprocessor/go.sum
+25 −28 collector/receiver/telemetryapireceiver/go.mod
+53 −53 collector/receiver/telemetryapireceiver/go.sum
+9 −9 collector/receiver/telemetryapireceiver/receiver.go
+132 −0 collector/receiver/telemetryapireceiver/receiver_test.go
+14 −14 go/sample-apps/function/go.mod
+28 −28 go/sample-apps/function/go.sum
+6 −6 java/dependencyManagement/build.gradle.kts
+659 −386 nodejs/package-lock.json
+3 −3 nodejs/package.json
+30 −30 nodejs/packages/layer/package.json
+16 −16 nodejs/sample-apps/aws-sdk/package-lock.json
+4 −4 nodejs/sample-apps/aws-sdk/package.json
+2 −2 python/src/otel/otel_sdk/nodeps-requirements.txt
+33 −33 python/src/otel/otel_sdk/requirements.txt
+1 −1 python/src/otel/tests/nodeps-requirements.txt
+3 −3 python/src/otel/tests/requirements.txt
+1 −1 ruby/src/otel/layer/Gemfile
10 changes: 5 additions & 5 deletions python/build-layer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ echo "Modify dependencies and script for Splunk integration"
pushd "$OTEL_PYTHON_DIR"

cd "$SOURCES_DIR"
sed -i 's/^opentelemetry-distro.*/splunk-opentelemetry[all]==1.20.0/g' requirements.txt
sed -i 's/^opentelemetry-exporter-otlp-proto-http.*/opentelemetry-exporter-otlp-proto-http==1.26.0/g' requirements.txt
sed -i 's/^opentelemetry-distro.*/splunk-opentelemetry[all]==1.21.0/g' requirements.txt
sed -i 's/^opentelemetry-exporter-otlp-proto-http.*/opentelemetry-exporter-otlp-proto-http==1.27.0/g' requirements.txt
# Even if these regexes do nothing, leave these lines in to make later updates easier
sed -i 's/0.47b0/0.47b0/g' nodeps-requirements.txt
sed -i 's/0.47b0/0.47b0/g' requirements.txt
sed -i 's/1.26.0/1.26.0/g' requirements.txt
sed -i 's/0.48b0/0.48b0/g' nodeps-requirements.txt
sed -i 's/0.48b0/0.48b0/g' requirements.txt
sed -i 's/1.27.0/1.27.0/g' requirements.txt
sed -i 's/^docker run --rm/docker run/g' ../../build.sh
sed -i 's/opentelemetry-instrument/splunk-py-trace/g' otel-instrument
# FIXME this recently broke and why aren't these a vendored part of pkg_resources anymore? perhaps we should remove the dependency on pkg_resources?
Expand Down

0 comments on commit ad0e601

Please sign in to comment.