Skip to content

Commit 657c2b1

Browse files
committed
Add AWS Lambda package metadata files
1 parent 4174a55 commit 657c2b1

File tree

17 files changed

+19
-931
lines changed

17 files changed

+19
-931
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased](https://github.com/open-telemetry/opentelemetry-python/compare/v1.6.2-0.25b2...HEAD)
9-
- `opentelemetry-instrumentation-aws_lambda` Add Instrumentation for AWS Lambda package
9+
- `opentelemetry-instrumentation-aws-lambda` Add instrumentation for AWS Lambda Service - pkg metadata files (Part 1/2)
1010
([#739](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/739))
1111

1212
### Fixed

instrumentation/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
| [opentelemetry-instrumentation-aiopg](./opentelemetry-instrumentation-aiopg) | aiopg >= 0.13.0, < 1.3.0 |
66
| [opentelemetry-instrumentation-asgi](./opentelemetry-instrumentation-asgi) | asgiref ~= 3.0 |
77
| [opentelemetry-instrumentation-asyncpg](./opentelemetry-instrumentation-asyncpg) | asyncpg >= 0.12.0 |
8-
| [opentelemetry-instrumentation-aws_lambda](./opentelemetry-instrumentation-aws_lambda) | aws_lambda |
8+
| [opentelemetry-instrumentation-aws-lambda](./opentelemetry-instrumentation-aws-lambda) | aws_lambda |
99
| [opentelemetry-instrumentation-boto](./opentelemetry-instrumentation-boto) | boto~=2.0 |
1010
| [opentelemetry-instrumentation-botocore](./opentelemetry-instrumentation-botocore) | botocore ~= 1.0 |
1111
| [opentelemetry-instrumentation-celery](./opentelemetry-instrumentation-celery) | celery >= 4.0, < 6.0 |

instrumentation/opentelemetry-instrumentation-aws_lambda/README.rst instrumentation/opentelemetry-instrumentation-aws-lambda/README.rst

-40
Original file line numberDiff line numberDiff line change
@@ -21,46 +21,6 @@ Installation
2121
pip install opentelemetry-instrumentation-aws-lambda
2222

2323

24-
Usage
25-
-----
26-
27-
.. code:: python
28-
29-
# Copy this snippet into an AWS Lambda function
30-
31-
import boto3
32-
from opentelemetry.instrumentation.botocore import AwsBotocoreInstrumentor
33-
from opentelemetry.instrumentation.aws_lambda import AwsLambdaInstrumentor
34-
35-
36-
# Enable instrumentation
37-
AwsBotocoreInstrumentor().instrument()
38-
AwsLambdaInstrumentor().instrument()
39-
40-
# Lambda function
41-
def lambda_handler(event, context):
42-
s3 = boto3.resource('s3')
43-
for bucket in s3.buckets.all():
44-
print(bucket.name)
45-
46-
return "200 OK"
47-
48-
Using a custom `event_context_extractor` to parent traces with a Trace Context
49-
found in the Lambda Event.
50-
51-
.. code:: python
52-
53-
from opentelemetry.instrumentation.aws_lambda import AwsLambdaInstrumentor
54-
55-
def custom_event_context_extractor(lambda_event):
56-
# If the `TraceContextTextMapPropagator` is the global propagator, we
57-
# can use it to parse out the context from the HTTP Headers.
58-
return get_global_textmap().extract(lambda_event["foo"]["headers"])
59-
60-
AwsLambdaInstrumentor().instrument(
61-
event_context_extractor=custom_event_context_extractor
62-
)
63-
6424
References
6525
----------
6626

instrumentation/opentelemetry-instrumentation-aws_lambda/setup.cfg instrumentation/opentelemetry-instrumentation-aws-lambda/setup.cfg

+3-6
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
# limitations under the License.
1414
#
1515
[metadata]
16-
name = opentelemetry-instrumentation-aws_lambda
16+
name = opentelemetry-instrumentation-aws-lambda
1717
description = OpenTelemetry AWS Lambda instrumentation
1818
long_description = file: README.rst
1919
long_description_content_type = text/x-rst
2020
author = OpenTelemetry Authors
2121
author_email = [email protected]
22-
url = https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-aws_lambda
22+
url = https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-aws-lambda
2323
platforms = any
2424
license = Apache-2.0
2525
classifiers =
@@ -39,7 +39,7 @@ package_dir=
3939
packages=find_namespace:
4040
install_requires =
4141
opentelemetry-instrumentation == 0.25b2
42-
opentelemetry-propagator-aws-xray == 1.0.0
42+
opentelemetry-propagator-aws-xray == 1.0.1
4343
opentelemetry-semantic-conventions == 0.25b2
4444

4545
[options.extras_require]
@@ -54,6 +54,3 @@ where = src
5454
# current AWS Lambda implementation reloads a fresh import of the user's Lambda
5555
# handler. Auto Instrumentation runs _before_ and if it instruments the handler
5656
# that patching will be lost.
57-
#
58-
# opentelemetry_instrumentor =
59-
# aws_lambda = opentelemetry.instrumentation.aws_lambda:AwsLambdaInstrumentor
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright 2020, OpenTelemetry Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.

instrumentation/opentelemetry-instrumentation-aws_lambda/tests/mocks/lambda_function.py instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation.py

-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,3 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
15-
16-
def handler(event, context):
17-
return "200 ok"

instrumentation/opentelemetry-instrumentation-aws_lambda/scripts/otel-instrument

-166
This file was deleted.

instrumentation/opentelemetry-instrumentation-aws_lambda/scripts/otel_wrapper.py

-66
This file was deleted.

0 commit comments

Comments
 (0)