Repository: open-telemetry/opentelemetry-python-contrib

Issue:
Change AwsLambdaInstrumentor span attribute settings to match faas semconv
**Is your feature request related to a problem?**
No.

**Describe the solution you'd like**
Python AwsLambdaInstrumentor attribute settings are not consistent with the [latest faas semconv](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/faas/aws-lambda.md#all-triggers). Specifically, I think these instrumentor changes are needed:
1. `ResourceAttributes.FAAS_ID` --> `ResourceAttributes.CLOUD_RESOURCE_ID`
2. `SpanAttributes.FAAS_EXECUTION` --> `SpanAttributes.FAAS_INVOCATION_ID`

For this solution, change [these set_attribute calls](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/37aba928d45713842941c7efc992726a79ea7d8a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py#L342-L355). Make special note in the release notes that this is breaking. This is not additive like #2368.

**Describe alternatives you've considered**
I've thought about and brought up 2 other ideas on Slack:

Idea (A)
The Python AwsLambdaInstrumentor upgrades to a newer semconv version. Would it need to be an opt-in for users like for http instrumentation? (i.e. [this recent issue](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/2351)) Would this need to be presented to an Otel Spec project group? (i.e. [this issue](https://github.com/open-telemetry/opentelemetry-specification/issues/3042))

Idea (B)
The Python AwsLambdaInstrumentor gets request/response hooks implemented like in NodeJS. This would allow users to add any attributes they like. I see this was [requested](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1140), [discussed in Otel Spec](https://github.com/open-telemetry/opentelemetry-specification/issues/3042#issuecomment-1384964399), [PR'd](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1476) (rejected), discussed at [faas project sig](https://docs.google.com/document/d/187XYoQcXQ9JxS_5v2wvZ0NEysaJ02xoOYNXj08pT0zc/edit#heading=h.w0bc5a8eac74), alternatively [PR'd as a SpanProcessor requirement](https://github.com/open-telemetry/opentelemetry-specification/pull/3189) (rejected), and brought up again in [Slack](https://cloud-native.slack.com/archives/C04HVBETC9Z/p1684317968674529). I haven't found any other updates since May 2023.

In [this otel-faas thread](https://cloud-native.slack.com/archives/C04HVBETC9Z/p1711387797268909), it was mentioned that the faas attributes are not stable so a breaking change would be ok. Therefore we could implement the quick, in-place change.

**Additional context**
1. https://cloud-native.slack.com/archives/C01PD4HUVBL/p1711140906040599
2. https://cloud-native.slack.com/archives/C04HVBETC9Z/p1711387797268909



Discussion:

Resolving patch:
diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py
--- a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py
+++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py
@@ -340,17 +340,17 @@ def _instrumented_lambda_handler_call(  # noqa pylint: disable=too-many-branches
             if span.is_recording():
                 lambda_context = args[1]
                 # NOTE: The specs mention an exception here, allowing the
-                # `ResourceAttributes.FAAS_ID` attribute to be set as a span
+                # `SpanAttributes.CLOUD_RESOURCE_ID` attribute to be set as a span
                 # attribute instead of a resource attribute.
                 #
                 # See more:
-                # https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/faas.md#example
+                # https://github.com/open-telemetry/semantic-conventions/blob/main/docs/faas/aws-lambda.md#resource-detector
                 span.set_attribute(
-                    ResourceAttributes.FAAS_ID,
+                    SpanAttributes.CLOUD_RESOURCE_ID,
                     lambda_context.invoked_function_arn,
                 )
                 span.set_attribute(
-                    SpanAttributes.FAAS_EXECUTION,
+                    SpanAttributes.FAAS_INVOCATION_ID,
                     lambda_context.aws_request_id,
                 )
 


Test patch:
diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py
--- a/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py
+++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py
@@ -145,8 +145,8 @@ def test_active_tracing(self):
         self.assertSpanHasAttributes(
             span,
             {
-                ResourceAttributes.FAAS_ID: MOCK_LAMBDA_CONTEXT.invoked_function_arn,
-                SpanAttributes.FAAS_EXECUTION: MOCK_LAMBDA_CONTEXT.aws_request_id,
+                SpanAttributes.CLOUD_RESOURCE_ID: MOCK_LAMBDA_CONTEXT.invoked_function_arn,
+                SpanAttributes.FAAS_INVOCATION_ID: MOCK_LAMBDA_CONTEXT.aws_request_id,
                 ResourceAttributes.CLOUD_ACCOUNT_ID: MOCK_LAMBDA_CONTEXT.invoked_function_arn.split(
                     ":"
                 )[