-
Notifications
You must be signed in to change notification settings - Fork 24
[Python] Custom Metrics E2E Test #471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 81 commits
f02dcb3
383791c
c74f03f
d89c43b
3e1be9b
f5b6b0e
c5f28fd
3455277
ddd2993
446bd08
75c47a2
0c75867
e285993
dd9e778
a3fedbc
81500c6
72c88c5
b0e450f
0e3aff2
d070aab
67329dc
59b9f12
284c65e
761a7ed
02e58d5
bc4a37a
f3dbdf4
3807ca9
2883c2f
c826fa0
791c366
3c2cbe1
b8cb6c5
9cfa435
f616720
b4356ba
801286c
50d9ebd
a9e2feb
92e8620
effd5d6
ce893f2
c3b25d0
f83f427
79f9a09
29c32d6
7153eaf
1c5f429
710b4c3
0a29d7e
e2e01a8
5d84db6
9a649bc
a4ba51d
dd6c12c
f0f890d
b6bab9e
34087f4
1f74499
db6fda5
ea96f6e
f360d97
523e41b
9149f84
567e84c
fc77459
e3034a5
3359c0b
2883bbe
b1b9e7a
e458468
0de1b5a
6e55891
c840ace
f6b3b67
3d7b835
ee3b357
5fe3e7a
3985b9b
12f6e21
a2c4041
e1717f1
c1401e7
02b0489
f1ab5d1
6f29d95
113714c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -170,15 +170,20 @@ resource "null_resource" "main_service_setup" { | |
export DJANGO_SETTINGS_MODULE="django_frontend_service.settings" | ||
export OTEL_PYTHON_DISTRO="aws_distro" | ||
export OTEL_PYTHON_CONFIGURATOR="aws_configurator" | ||
export OTEL_METRICS_EXPORTER=none | ||
export OTEL_METRICS_EXPORTER=otlp | ||
majanjua-amzn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
export OTEL_TRACES_EXPORTER=otlp | ||
export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true | ||
export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4315 | ||
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4315 | ||
export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=grpc | ||
export OTEL_EXPORTER_OTLP_METRICS_PROTOCOL=grpc | ||
export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=localhost:4317 | ||
export OTEL_EXPORTER_OTLP_INSECURE=true | ||
export OTEL_SERVICE_NAME=python-sample-application-${var.test_id} | ||
export OTEL_TRACES_SAMPLER=always_on | ||
export OTEL_RESOURCE_ATTRIBUTES="Service=python-sample-application-${var.test_id},Environment=ec2:default" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this line |
||
export AWS_REGION='${var.aws_region}' | ||
export CUSTOM_METRICS_ENABLED='${var.custom_metrics_enabled}' | ||
majanjua-amzn marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
python${var.language_version} manage.py migrate | ||
nohup opentelemetry-instrument python${var.language_version} manage.py runserver 0.0.0.0:8000 --noreload & | ||
|
||
|
@@ -276,7 +281,7 @@ resource "null_resource" "remote_service_setup" { | |
|
||
# Copy in CW Agent configuration | ||
agent_config='${replace(replace(file("./amazon-cloudwatch-agent.json"), "/\\s+/", ""), "$REGION", var.aws_region)}' | ||
echo $agent_config > amazon-cloudwatch-agent.json | ||
echo "$agent_config" > amazon-cloudwatch-agent.json | ||
majanjua-amzn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# Get and run CW agent rpm | ||
${var.get_cw_agent_rpm_command} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like the changes to this file don't do anything functionally different then before, is that correct? If so, should probably not change it at all |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
# OpenTelemetry Custom Metrics Validation Templates - AWS SDK Call Only | ||
# ANY_VALUE defines a string to = 'ANY_VALUE' to pass validation testing | ||
- | ||
metricName: custom_export_counter | ||
namespace: CWAgent | ||
dimensions: | ||
- | ||
name: Environment | ||
value: ec2:default | ||
- | ||
name: Service | ||
value: {{serviceName}} | ||
- | ||
name: aws.local.service | ||
value: {{serviceName}} | ||
- | ||
name: cloud.account.id | ||
value: 654654176582 | ||
majanjua-amzn marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
- | ||
name: cloud.availability_zone | ||
value: ANY_VALUE | ||
- | ||
name: cloud.platform | ||
value: aws_ec2 | ||
- | ||
name: cloud.provider | ||
value: aws | ||
- | ||
name: cloud.region | ||
value: us-east-1 | ||
majanjua-amzn marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
- | ||
name: host.id | ||
value: ANY_VALUE | ||
- | ||
name: host.name | ||
value: ANY_VALUE | ||
- | ||
name: host.type | ||
value: t3.micro | ||
majanjua-amzn marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
- | ||
name: operation.type | ||
value: custom_export_1 | ||
- | ||
name: service.name | ||
value: {{serviceName}} | ||
- | ||
name: telemetry.auto.version | ||
value: ANY_VALUE | ||
- | ||
name: telemetry.sdk.language | ||
value: python | ||
- | ||
name: telemetry.sdk.name | ||
value: opentelemetry | ||
- | ||
name: telemetry.sdk.version | ||
value: ANY_VALUE | ||
- | ||
metricName: test_histogram | ||
namespace: CWAgent | ||
dimensions: | ||
- | ||
name: Environment | ||
value: ec2:default | ||
- | ||
name: Service | ||
value: {{serviceName}} | ||
- | ||
name: aws.local.service | ||
value: {{serviceName}} | ||
- | ||
name: cloud.account.id | ||
value: 654654176582 | ||
- | ||
name: cloud.availability_zone | ||
value: ANY_VALUE | ||
- | ||
name: cloud.platform | ||
value: aws_ec2 | ||
- | ||
name: cloud.provider | ||
value: aws | ||
- | ||
name: cloud.region | ||
value: us-east-1 | ||
- | ||
name: host.id | ||
value: ANY_VALUE | ||
- | ||
name: host.name | ||
value: ANY_VALUE | ||
- | ||
name: host.type | ||
value: t3.micro | ||
- | ||
name: operation.type | ||
value: histogram | ||
- | ||
name: service.name | ||
value: {{serviceName}} | ||
- | ||
name: telemetry.auto.version | ||
value: ANY_VALUE | ||
- | ||
name: telemetry.sdk.language | ||
value: python | ||
- | ||
name: telemetry.sdk.name | ||
value: opentelemetry | ||
- | ||
name: telemetry.sdk.version | ||
value: ANY_VALUE |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- | ||
validationType: "cw-metric" | ||
httpPath: "aws-sdk-call" | ||
httpMethod: "get" | ||
callingType: "http-with-query" | ||
expectedMetricTemplate: "PYTHON_EC2_DEFAULT_AWS_OTEL_CUSTOM_METRIC" |
Uh oh!
There was an error while loading. Please reload this page.