Commit b6b7cf8
authored
Add OtlpAwsLogExporter and OtlpAwsSpanExporter (#360)
*Background:*
#358
The above PR got rid of OtlpAwsSpanExporter and OtlpAwsLogExporter as to
use the default upstream exporters as that was a cleaner approach.
However, we need the OtlpAwsSpanExporter and OtlpAwsLogExporter classes
to support later requirements for Gen AI as we need to override the
export method.
*Description of changes:*
This PR reintroduces the OtlpAwsSpanExporter and OtlpAwsLogExporter
classes to support later requirements for Gen AI as we need to override
the export method.
This change does not introduce anything new and the Sigv4 span + logs
exporter still work as intended:
Logs:
```
{
"resource": {
"attributes": {
"aws.local.service": "test",
"service.name": "test",
"cloud.region": "us-west-2",
"host.type": "c5.4xlarge",
"cloud.availability_zone": "us-west-2c",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.language": "python",
"cloud.provider": "aws",
"cloud.account.id": "571600841604",
"telemetry.sdk.version": "1.27.0",
"host.name": "ip-172-31-7-29.us-west-2.compute.internal",
"cloud.platform": "aws_ec2",
"host.id": "i-0b04d6affbae7d629",
"telemetry.auto.version": "0.9.0.dev0-aws"
}
},
"scope": {
"name": "opentelemetry.sdk._logs._internal"
},
"timeUnixNano": 1747074906326769664,
"observedTimeUnixNano": 1747074906326822815,
"severityNumber": 9,
"severityText": "INFO",
"body": "127.0.0.1 - - [12/May/2025 18:35:06] \"GET /server_request HTTP/1.1\" 200 -",
"attributes": {
"code.filepath": "/home/ec2-user/.local/lib/python3.9/site-packages/werkzeug/_internal.py",
"otelTraceSampled": false,
"code.function": "_log",
"code.lineno": 97,
"otelTraceID": "0",
"otelSpanID": "0",
"otelServiceName": "test"
},
"traceId": "",
"spanId": ""
}
```
Spans:
```
{
"resource": {
"attributes": {
"aws.local.service": "test",
"service.name": "test",
"cloud.region": "us-west-2",
"host.type": "c5.4xlarge",
"cloud.availability_zone": "us-west-2c",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.language": "python",
"cloud.provider": "aws",
"cloud.account.id": "571600841604",
"telemetry.sdk.version": "1.27.0",
"host.name": "ip-172-31-7-29.us-west-2.compute.internal",
"cloud.platform": "aws_ec2",
"host.id": "i-0b04d6affbae7d629",
"telemetry.auto.version": "0.9.0.dev0-aws"
}
},
"scope": {
"name": "opentelemetry.instrumentation.flask",
"version": "0.48b0"
},
"traceId": "68223f2d375733237e24512171012437",
"spanId": "34dd5a89d7a21fdf",
"flags": 256,
"name": "GET /",
"kind": "SERVER",
"startTimeUnixNano": 1747074861988123056,
"endTimeUnixNano": 1747074861988911516,
"durationNano": 788460,
"attributes": {
"net.host.name": "localhost:8082",
"aws.local.service": "test",
"net.peer.port": 57356,
"telemetry.extended": "true",
"http.target": "/",
"http.flavor": "1.1",
"net.peer.ip": "127.0.0.1",
"http.host": "localhost:8082",
"aws.local.environment": "ec2:default",
"http.status_code": 404,
"aws.local.operation": "GET /",
"aws.span.kind": "LOCAL_ROOT",
"http.server_name": "127.0.0.1",
"http.user_agent": "curl/8.5.0",
"net.host.port": 8082,
"PlatformType": "AWS::EC2",
"http.method": "GET",
"http.response.status_code": 404,
"http.scheme": "http"
},
"status": {
"code": "UNSET"
}
}
```
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 cb3a1b0 commit b6b7cf8
File tree
4 files changed
+86
-13
lines changed- aws-opentelemetry-distro
- src/amazon/opentelemetry/distro
- exporter/otlp/aws
- logs
- traces
- tests/amazon/opentelemetry/distro
4 files changed
+86
-13
lines changedLines changed: 4 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
| 362 | + | |
366 | 363 | | |
367 | 364 | | |
368 | 365 | | |
| |||
386 | 383 | | |
387 | 384 | | |
388 | 385 | | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
| 386 | + | |
394 | 387 | | |
395 | 388 | | |
396 | 389 | | |
| |||
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
aws-opentelemetry-distro/tests/amazon/opentelemetry/distro/test_aws_opentelementry_configurator.py
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
377 | 379 | | |
378 | 380 | | |
379 | 381 | | |
380 | | - | |
| 382 | + | |
381 | 383 | | |
382 | 384 | | |
383 | 385 | | |
| |||
480 | 482 | | |
481 | 483 | | |
482 | 484 | | |
483 | | - | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
484 | 491 | | |
485 | 492 | | |
486 | 493 | | |
| |||
0 commit comments