Skip to content

Commit 5c604bb

Browse files
authored
remove lambda remote service override configuration (#151)
**Issue #, if available:** If user decides to override `RemoteService value`, the Lambda Topology issue solution will not be able to support multiple downstream Lambdas. For example, consider lambdaA calls both lambdaB and lambdaC. If the user overrides `LAMBDA_APPLICATION_SIGNALS_REMOTE_SERVICE`, it will effectively hardcode the `RemoteService` value. As a result, we are left with an either/or situation where only one node will be connected to lambdaA in the topology depending on the hardcoded value. This issue is not present when the user does not override this `RemoteService` value because that attribute will dynamically take on whatever the lambda function name is. My proposal is we remove the `LAMBDA_APPLICATION_SIGNALS_REMOTE_SERVICE` env var. That is, we do not allow customers to override the `RemoteService` attribute value. This should not cause issues for customers to lose this configuration option. If the customer needs to change the downstream lambda service name, they can change the lambda function name itself rather than having to use an env var. **Description of changes:** Removing option to override `RemoteService` attribute value. **Test plan:** Sanity e2e test by building custom lambda layer and ensuring the correct EMF Logs are still generated after change. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
1 parent da8291e commit 5c604bb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

aws-distro-opentelemetry-node-autoinstrumentation/src/aws-metric-attribute-generator.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -417,13 +417,13 @@ export class AwsMetricAttributeGenerator implements MetricAttributeGenerator {
417417
// This addresses a Lambda topology issue in Application Signals.
418418
// More context in PR: https://github.com/aws-observability/aws-otel-python-instrumentation/pull/319
419419
//
420-
// NOTE: The env vars LAMBDA_APPLICATION_SIGNALS_REMOTE_SERVICE and
421-
// LAMBDA_APPLICATION_SIGNALS_REMOTE_ENVIRONMENT were introduced as part of this fix.
422-
// They are optional and allow users to override the default values if needed.
420+
// NOTE: The env var LAMBDA_APPLICATION_SIGNALS_REMOTE_ENVIRONMENT was introduced as part of this fix.
421+
// It is optional and allow users to override the default value if needed.
423422
if (AwsMetricAttributeGenerator.getRemoteOperation(span, SEMATTRS_RPC_METHOD) === 'Invoke') {
424-
attributes[AWS_ATTRIBUTE_KEYS.AWS_REMOTE_SERVICE] =
425-
process.env.LAMBDA_APPLICATION_SIGNALS_REMOTE_SERVICE ||
426-
span.attributes[AWS_ATTRIBUTE_KEYS.AWS_LAMBDA_FUNCTION_NAME];
423+
attributes[AWS_ATTRIBUTE_KEYS.AWS_REMOTE_SERVICE] = AwsMetricAttributeGenerator.escapeDelimiters(
424+
span.attributes[AWS_ATTRIBUTE_KEYS.AWS_LAMBDA_FUNCTION_NAME]
425+
);
426+
427427
attributes[AWS_ATTRIBUTE_KEYS.AWS_REMOTE_ENVIRONMENT] = `lambda:${
428428
process.env.LAMBDA_APPLICATION_SIGNALS_REMOTE_ENVIRONMENT || 'default'
429429
}`;

0 commit comments

Comments
 (0)