Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions terraform/ecs/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,12 @@ module "validator" {
ecsLaunchType : aws_ecs_service.aoc[0].launch_type
})

cloudwatch_context_json = jsonencode({
ignoreEmptyDimSet : var.ignore_empty_dim_set
})

rollup = var.rollup

depends_on = [aws_ecs_service.aoc]
}

Expand Down
12 changes: 12 additions & 0 deletions terraform/ecs/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,15 @@ variable "configuration_source" {
error_message = "Invalid configuration_source for ecs"
}
}

variable "ignore_empty_dim_set" {
type = bool
default = false

description = "Toggles whether or not the validator will ignore an empty EMF dimension set"
}

variable "rollup" {
type = bool
default = true
}
60 changes: 60 additions & 0 deletions terraform/testcases/ec2_resource_detect_metric/otconfig.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
extensions:
pprof:
endpoint: 0.0.0.0:1777
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:${grpc_port}

processors:
batch:
resourcedetection:
detectors:
- ec2
timeout: 5s
override: false
ec2:
resource:
attributes:
- key: host.id
value: "123"
action: update
- key: host.image.id
value: "1234"
action: update
- key: host.name
value: "testname"
action: update
- key: host.type
value: "testtype"
action: update

exporters:
logging:
verbosity: detailed
awsemf:
region: '${region}'
resource_to_telemetry_conversion:
enabled: true
dimension_rollup_option: "NoDimensionRollup"
metric_declarations:
- dimensions: [[host.id, host.image.id, host.name, host.type]]
metric_name_selectors:
- "latency_*"
- "apiBytesSent_*"
- "totalApiBytesSent_*"
- "queueSizeChange_*"
- "actualQueueSize_*"
- "lastLatency_*"

service:
pipelines:
metrics:
receivers: [otlp]
processors: [batch, resourcedetection, resource]
exporters: [logging, awsemf]
extensions: [pprof]
telemetry:
logs:
level: ${log_level}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
validation_config = "ec2-resource-detect-validation.yml"

sample_app = "spark"

sample_app_image = "public.ecr.aws/aws-otel-test/aws-otel-java-spark:latest"

ignore_empty_dim_set = true

rollup = false
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public enum PredefinedExpectedTemplate implements FileConfig {
"/expected-data-template/container-insight/ecs/prometheus"),
FARGATE_EXPECTED_METRIC("/expected-data-template/EKSFargateCWCIExpectedMetric.mustache"),
STANDARD_EXPECTED_METRIC("/expected-data-template/standard/standardExpectedMetric.mustache"),
EC2_RESOURCE_DETECT_EXPECTED_METRIC("/expected-data-template/ec2ResourceDetectMetric.mustache"),

/** trace template, defined in resources. */
// not use default expected trace any more
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
-
metricName: latency_{{testingId}}
namespace: {{metricNamespace}}
dimensions:
-
name: host.id
value: 123
-
name: host.image.id
value: 1234
-
name: host.name
value: testname
-
name: host.type
value: testtype

-
metricName: apiBytesSent_{{testingId}}
namespace: {{metricNamespace}}
dimensions:
-
name: host.id
value: 123
-
name: host.image.id
value: 1234
-
name: host.name
value: testname
-
name: host.type
value: testtype

-
metricName: totalApiBytesSent_{{testingId}}
namespace: {{metricNamespace}}
dimensions:
-
name: host.id
value: 123
-
name: host.image.id
value: 1234
-
name: host.name
value: testname
-
name: host.type
value: testtype

-
metricName: queueSizeChange_{{testingId}}
namespace: {{metricNamespace}}
dimensions:
-
name: host.id
value: 123
-
name: host.image.id
value: 1234
-
name: host.name
value: testname
-
name: host.type
value: testtype

-
metricName: actualQueueSize_{{testingId}}
namespace: {{metricNamespace}}
dimensions:
-
name: host.id
value: 123
-
name: host.image.id
value: 1234
-
name: host.name
value: testname
-
name: host.type
value: testtype

-
metricName: lastLatency_{{testingId}}
namespace: {{metricNamespace}}
dimensions:
-
name: host.id
value: 123
-
name: host.image.id
value: 1234
-
name: host.name
value: testname
-
name: host.type
value: testtype
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-
validationType: "cw-metric"
httpPath: "/outgoing-http-call"
httpMethod: "get"
callingType: "http"
expectedMetricTemplate: "EC2_RESOURCE_DETECT_EXPECTED_METRIC"