Skip to content

Commit

Permalink
Merge branch 'main' into 2677-jinja2-semconv
Browse files Browse the repository at this point in the history
Signed-off-by: C, Chandru <Chandra.C@fmr.com>
  • Loading branch information
the-chandru committed Aug 6, 2024
2 parents d9adf4c + 2a707bc commit 60d0730
Show file tree
Hide file tree
Showing 23 changed files with 540 additions and 163 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/instrumentations_1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
- "resource-detector-azure"
- "resource-detector-container"
- "util-http"
- "fastapislim"
- "processor-baggage"
- "kafka-pythonng"
os: [ubuntu-20.04]
exclude:
- python-version: pypy3
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Added

- `opentelemetry-instrumentation-kafka-python` Instrument temporary fork, kafka-python-ng
inside kafka-python's instrumentation
([#2537](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2537)))

## Breaking changes

## Fixed
Expand Down
4 changes: 2 additions & 2 deletions instrumentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
| [opentelemetry-instrumentation-django](./opentelemetry-instrumentation-django) | django >= 1.10 | Yes | experimental
| [opentelemetry-instrumentation-elasticsearch](./opentelemetry-instrumentation-elasticsearch) | elasticsearch >= 6.0 | No | experimental
| [opentelemetry-instrumentation-falcon](./opentelemetry-instrumentation-falcon) | falcon >= 1.4.1, < 4.0.0 | Yes | experimental
| [opentelemetry-instrumentation-fastapi](./opentelemetry-instrumentation-fastapi) | fastapi ~= 0.58,fastapi-slim ~= 0.111.0 | Yes | migration
| [opentelemetry-instrumentation-fastapi](./opentelemetry-instrumentation-fastapi) | fastapi ~= 0.58,fastapi-slim ~= 0.111 | Yes | migration
| [opentelemetry-instrumentation-flask](./opentelemetry-instrumentation-flask) | flask >= 1.0 | Yes | migration
| [opentelemetry-instrumentation-grpc](./opentelemetry-instrumentation-grpc) | grpcio ~= 1.27 | No | experimental
| [opentelemetry-instrumentation-httpx](./opentelemetry-instrumentation-httpx) | httpx >= 0.18.0 | No | migration
| [opentelemetry-instrumentation-jinja2](./opentelemetry-instrumentation-jinja2) | jinja2 >= 2.7, < 4.0 | No | migration
| [opentelemetry-instrumentation-kafka-python](./opentelemetry-instrumentation-kafka-python) | kafka-python >= 2.0 | No | experimental
| [opentelemetry-instrumentation-kafka-python](./opentelemetry-instrumentation-kafka-python) | kafka-python >= 2.0, < 3.0,kafka-python-ng >= 2.0, < 3.0 | No | experimental
| [opentelemetry-instrumentation-logging](./opentelemetry-instrumentation-logging) | logging | No | experimental
| [opentelemetry-instrumentation-mysql](./opentelemetry-instrumentation-mysql) | mysql-connector-python >= 8.0, < 10.0 | No | experimental
| [opentelemetry-instrumentation-mysqlclient](./opentelemetry-instrumentation-mysqlclient) | mysqlclient < 3 | No | experimental
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ classifiers = [
]
dependencies = [
"opentelemetry-instrumentation == 0.48b0.dev",
"opentelemetry-propagator-aws-xray == 1.0.1",
"opentelemetry-propagator-aws-xray ~= 1.0.1",
"opentelemetry-semantic-conventions == 0.48b0.dev",
]

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
MOCK_LAMBDA_ALB_EVENT = {
"requestContext": {
"elb": {
"targetGroupArn": "arn:aws:elasticloadbalancing:region:123456789012:targetgroup/my-target-group/6d0ecf831eec9f09"
}
},
"httpMethod": "GET",
"path": "/",
"queryStringParameters": {"foo": "bar"},
"headers": {
"accept": "text/html,application/xhtml+xml",
"accept-language": "en-US,en;q=0.8",
"content-type": "text/plain",
"cookie": "cookies",
"host": "lambda-846800462-us-east-2.elb.amazonaws.com",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6)",
"x-amzn-trace-id": "Root=1-5bdb40ca-556d8b0c50dc66f0511bf520",
"x-forwarded-for": "72.21.198.66",
"x-forwarded-port": "443",
"x-forwarded-proto": "https",
},
"isBase64Encoded": False,
"body": "request_body",
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""
https://docs.aws.amazon.com/elasticloadbalancing/latest/application/lambda-functions.html#multi-value-headers
When an ALB is configured to send multi-value headers, the headers are sent as a list of values under the key in the multiValueHeaders object.
"""

MOCK_LAMBDA_ALB_MULTI_VALUE_HEADER_EVENT = {
"requestContext": {
"elb": {
"targetGroupArn": "arn:aws:elasticloadbalancing:region:123456789012:targetgroup/my-target-group/6d0ecf831eec9f09"
}
},
"httpMethod": "GET",
"path": "/",
"queryStringParameters": {"foo": "bar"},
"multiValueHeaders": {
"accept": ["text/html,application/xhtml+xml"],
"accept-language": ["en-US,en;q=0.8"],
"content-type": ["text/plain"],
"cookie": ["cookies"],
"host": ["lambda-846800462-us-east-2.elb.amazonaws.com"],
"user-agent": ["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6)"],
"x-amzn-trace-id": ["Root=1-5bdb40ca-556d8b0c50dc66f0511bf520"],
"x-forwarded-for": ["72.21.198.66"],
"x-forwarded-port": ["443"],
"x-forwarded-proto": ["https"],
},
"isBase64Encoded": False,
"body": "request_body",
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
"""
https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html
"""

MOCK_LAMBDA_DYNAMO_DB_EVENT = {
"Records": [
{
"eventID": "1",
"eventVersion": "1.0",
"dynamodb": {
"Keys": {"Id": {"N": "101"}},
"NewImage": {
"Message": {"S": "New item!"},
"Id": {"N": "101"},
},
"StreamViewType": "NEW_AND_OLD_IMAGES",
"SequenceNumber": "111",
"SizeBytes": 26,
},
"awsRegion": "us-west-2",
"eventName": "INSERT",
"eventSourceARN": "arn:aws:dynamodb:us-east-2:123456789012:table/my-table/stream/2023-06-10T19:26:16.525",
"eventSource": "aws:dynamodb",
},
{
"eventID": "2",
"eventVersion": "1.0",
"dynamodb": {
"OldImage": {
"Message": {"S": "New item!"},
"Id": {"N": "101"},
},
"SequenceNumber": "222",
"Keys": {"Id": {"N": "101"}},
"SizeBytes": 59,
"NewImage": {
"Message": {"S": "This item has changed"},
"Id": {"N": "101"},
},
"StreamViewType": "NEW_AND_OLD_IMAGES",
},
"awsRegion": "us-west-2",
"eventName": "MODIFY",
"eventSourceARN": "arn:aws:dynamodb:us-east-2:123456789012:table/my-table/stream/2023-06-10T19:26:16.525",
"eventSource": "aws:dynamodb",
},
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""
https://docs.aws.amazon.com/lambda/latest/dg/with-s3.html
"""

MOCK_LAMBDA_S3_EVENT = {
"Records": [
{
"eventVersion": "2.1",
"eventSource": "aws:s3",
"awsRegion": "us-east-2",
"eventTime": "2019-09-03T19:37:27.192Z",
"eventName": "ObjectCreated:Put",
"userIdentity": {"principalId": "AWS:AIDAINPONIXQXHT3IKHL2"},
"requestParameters": {"sourceIPAddress": "205.255.255.255"},
"responseElements": {
"x-amz-request-id": "D82B88E5F771F645",
"x-amz-id-2": "vlR7PnpV2Ce81l0PRw6jlUpck7Jo5ZsQjryTjKlc5aLWGVHPZLj5NeC6qMa0emYBDXOo6QBU0Wo=",
},
"s3": {
"s3SchemaVersion": "1.0",
"configurationId": "828aa6fc-f7b5-4305-8584-487c791949c1",
"bucket": {
"name": "DOC-EXAMPLE-BUCKET",
"ownerIdentity": {"principalId": "A3I5XTEXAMAI3E"},
"arn": "arn:aws:s3:::lambda-artifacts-deafc19498e3f2df",
},
"object": {
"key": "b21b84d653bb07b05b1e6b33684dc11b",
"size": 1305107,
"eTag": "b21b84d653bb07b05b1e6b33684dc11b",
"sequencer": "0C0F6F405D6ED209E1",
},
},
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""
https://docs.aws.amazon.com/lambda/latest/dg/with-sns.html
"""

MOCK_LAMBDA_SNS_EVENT = {
"Records": [
{
"EventVersion": "1.0",
"EventSubscriptionArn": "arn:aws:sns:us-east-1:123456789012:sns-lambda:21be56ed-a058-49f5-8c98-aedd2564c486",
"EventSource": "aws:sns",
"Sns": {
"SignatureVersion": "1",
"Timestamp": "2019-01-02T12:45:07.000Z",
"Signature": "mock-signature",
"SigningCertURL": "https://sns.us-east-1.amazonaws.com/SimpleNotificationService-ac565b8b1a6c5d002d285f9598aa1d9b.pem",
"MessageId": "95df01b4-ee98-5cb9-9903-4c221d41eb5e",
"Message": "Hello from SNS!",
"MessageAttributes": {
"Test": {"Type": "String", "Value": "TestString"},
"TestBinary": {"Type": "Binary", "Value": "TestBinary"},
},
"Type": "Notification",
"UnsubscribeURL": "https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&amp;SubscriptionArn=arn:aws:sns:us-east-1:123456789012:test-lambda:21be56ed-a058-49f5-8c98-aedd2564c486",
"TopicArn": "arn:aws:sns:us-east-1:123456789012:sns-lambda",
"Subject": "TestInvoke",
},
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""
https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html
"""

MOCK_LAMBDA_SQS_EVENT = {
"Records": [
{
"messageId": "059f36b4-87a3-44ab-83d2-661975830a7d",
"receiptHandle": "AQEBwJnKyrHigUMZj6rYigCgxlaS3SLy0a...",
"body": "Test message.",
"attributes": {
"ApproximateReceiveCount": "1",
"SentTimestamp": "1545082649183",
"SenderId": "AIDAIENQZJOLO23YVJ4VO",
"ApproximateFirstReceiveTimestamp": "1545082649185",
},
"messageAttributes": {},
"md5OfBody": "e4e68fb7bd0e697a0ae8f1bb342846b3",
"eventSource": "aws:sqs",
"eventSourceARN": "arn:aws:sqs:us-east-2:123456789012:my-queue",
"awsRegion": "us-east-2",
}
]
}
Loading

0 comments on commit 60d0730

Please sign in to comment.