Skip to content

Commit ec9362b

Browse files
author
Jeel Mehta
committed
Testing logs availability on the backend
1 parent 7599169 commit ec9362b

File tree

2 files changed

+33
-5
lines changed

2 files changed

+33
-5
lines changed

.github/workflows/python-ec2-adot-sigv4-test.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
# Read more about reusable workflows: https://docs.github.com/en/actions/using-workflows/reusing-workflows#overview
77
name: Python EC2 ADOT SigV4 (Stand-Alone ADOT) Use Case
88
on:
9+
push:
10+
branches:
11+
- Python_SigV4_logs_release_testing
912
workflow_call:
1013
inputs:
1114
caller-workflow-name:
@@ -33,13 +36,14 @@ permissions:
3336
env:
3437
E2E_TEST_AWS_REGION: 'us-west-2'
3538
CALLER_WORKFLOW_NAME: ${{ inputs.caller-workflow-name }}
36-
PYTHON_VERSION: ${{ inputs.python-version }}
37-
CPU_ARCHITECTURE: ${{ inputs.cpu-architecture }}
38-
ADOT_WHEEL_NAME: ${{ inputs.staging-wheel-name }}
39+
PYTHON_VERSION: ${{ inputs.python-version || '3.9' }}
40+
CPU_ARCHITECTURE: ${{ inputs.cpu-architecture || 'x86_64' }}
41+
ADOT_WHEEL_NAME: ${{ inputs.staging-wheel-name || 'aws-opentelemetry-distro' }}
3942
E2E_TEST_ACCOUNT_ID: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}
4043
E2E_TEST_ROLE_NAME: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }}
4144
METRIC_NAMESPACE: ApplicationSignals
4245
LOG_GROUP_NAME: aws/spans
46+
TEST_LOG_GROUP_NAME: otlp_sigv4_logs
4347
TEST_RESOURCES_FOLDER: ${GITHUB_WORKSPACE}
4448

4549
jobs:
@@ -184,6 +188,22 @@ jobs:
184188
--instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }}
185189
--rollup'
186190

191+
- name: Validate generated SigV4 logs
192+
id: log-validation
193+
run: ./gradlew validator:run --args='-c python/ec2/adot-sigv4/log-validation.yml
194+
--testing-id ${{ env.TESTING_ID }}
195+
--endpoint http://localhost:8000
196+
--remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8001
197+
--region ${{ env.E2E_TEST_AWS_REGION }}
198+
--metric-namespace ${{ env.METRIC_NAMESPACE }}
199+
--log-group ${{ env.LOG_GROUP_NAME }}
200+
--service-name python-sample-application-${{ env.TESTING_ID }}
201+
--remote-service-name python-sample-remote-application-${{ env.TESTING_ID }}
202+
--query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }}
203+
--instance-ami ${{ env.EC2_INSTANCE_AMI }}
204+
--instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }}
205+
--rollup'
206+
187207
- name: Validate generated metrics
188208
id: metric-validation
189209
if: (success() || steps.log-validation.outcome == 'failure') && !cancelled()

terraform/python/ec2/adot-sigv4/main.tf

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,14 @@ resource "null_resource" "main_service_setup" {
163163
export OTEL_PYTHON_CONFIGURATOR="aws_configurator"
164164
export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=false
165165
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf \
166-
export OTEL_LOGS_EXPORT=none \
166+
export OTEL_EXPORTER_OTLP_LOGS_PROTOCOL=http/protobuf \
167+
export OTEL_LOGS_EXPORTER=otlp \
167168
export OTEL_METRICS_EXPORTER=none \
168169
export OTEL_TRACES_EXPORTER=otlp
169170
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://xray.${var.aws_region}.amazonaws.com/v1/traces \
171+
export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=https://logs.${var.aws_region}.amazonaws.com/v1/logs \
172+
export OTEL_EXPORTER_OTLP_LOGS_HEADERS=x-aws-log-group=otlp_sigv4_logs,x-aws-log-stream=default \
173+
export OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true \
170174
export OTEL_SERVICE_NAME=python-sample-application-${var.test_id}
171175
export OTEL_TRACES_SAMPLER=always_on
172176
python${var.language_version} manage.py migrate
@@ -284,10 +288,14 @@ resource "null_resource" "remote_service_setup" {
284288
export OTEL_PYTHON_CONFIGURATOR="aws_configurator"
285289
export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=false
286290
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf \
287-
export OTEL_LOGS_EXPORT=none \
291+
export OTEL_EXPORTER_OTLP_LOGS_PROTOCOL=http/protobuf \
292+
export OTEL_LOGS_EXPORTER=otlp \
288293
export OTEL_METRICS_EXPORTER=none \
289294
export OTEL_TRACES_EXPORTER=otlp
290295
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://xray.${var.aws_region}.amazonaws.com/v1/traces \
296+
export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=https://logs.${var.aws_region}.amazonaws.com/v1/logs \
297+
export OTEL_EXPORTER_OTLP_LOGS_HEADERS=x-aws-log-group=otlp_sigv4_logs,x-aws-log-stream=default \
298+
export OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true \
291299
export OTEL_SERVICE_NAME=python-sample-remote-application-${var.test_id}
292300
export OTEL_TRACES_SAMPLER=always_on
293301
python${var.language_version} manage.py migrate

0 commit comments

Comments
 (0)