Skip to content

Commit

Permalink
Merge pull request #40 from hossain-rayhan/ecsv9
Browse files Browse the repository at this point in the history
ecscontainermetrics: update otconfig, expected metrics, and Validator logic
  • Loading branch information
wyTrivail authored Oct 27, 2020
2 parents 0345525 + 343f8a7 commit 8352978
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 22 deletions.
28 changes: 28 additions & 0 deletions terraform/template/otconfig/ecscontainermetric_otconfig.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,40 @@ processors:
include:
match_type: strict
metric_names:
- ecs.task.memory.reserved
- ecs.task.memory.utilized
- ecs.task.cpu.reserved
- ecs.task.cpu.utilized
- ecs.task.network.rate.rx
- ecs.task.network.rate.tx
- ecs.task.storage.read_bytes
- ecs.task.storage.write_bytes
metricstransform:
transforms:
- metric_name: ecs.task.memory.reserved
action: update
new_name: ecs.task.memory.reserved_${testing_id}
- metric_name: ecs.task.memory.utilized
action: update
new_name: ecs.task.memory.utilized_${testing_id}
- metric_name: ecs.task.cpu.reserved
action: update
new_name: ecs.task.cpu.reserved_${testing_id}
- metric_name: ecs.task.cpu.utilized
action: update
new_name: ecs.task.cpu.utilized_${testing_id}
- metric_name: ecs.task.network.rate.rx
action: update
new_name: ecs.task.network.rate.rx_${testing_id}
- metric_name: ecs.task.network.rate.tx
action: update
new_name: ecs.task.network.rate.tx_${testing_id}
- metric_name: ecs.task.storage.read_bytes
action: update
new_name: ecs.task.storage.read_bytes_${testing_id}
- metric_name: ecs.task.storage.write_bytes
action: update
new_name: ecs.task.storage.write_bytes_${testing_id}
exporters:
logging:
loglevel: debug
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,16 @@ private List<Metric> listMetricFromCloudWatch(
private List<Metric> rollupMetric(List<Metric> metricList) {
List<Metric> rollupMetricList = new ArrayList<>();
for (Metric metric : metricList) {
// get otellib dimension out
// assuming the first dimension is otellib, if not the validation fails
Dimension otellibDimension = metric.getDimensions().get(0);
boolean otelLibDimensionExisted = otellibDimension.getName().equals(DEFAULT_DIMENSION_NAME);
Dimension otellibDimension = new Dimension();
boolean otelLibDimensionExisted = false;

if (metric.getDimensions().size() > 0) {
// get otellib dimension out
// assuming the first dimension is otellib, if not the validation fails
otellibDimension = metric.getDimensions().get(0);
otelLibDimensionExisted = otellibDimension.getName().equals(DEFAULT_DIMENSION_NAME);
}

if (otelLibDimensionExisted) {
metric.getDimensions().remove(0);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
-
metricName: ecs.task.memory.reserved_{{testingId}}
namespace: {{metricNamespace}}
dimensions:
-
metricName: ecs.task.memory.utilized_{{testingId}}
namespace: {{metricNamespace}}
dimensions:
-
name: ecs.cluster
value: "{{ecsContext.ecsClusterName}}"
-
name: ecs.service
value: "undefined"
-
name: ecs.task-arn
value: "SKIP"
-
name: ecs.task-definition-family
value: "{{ecsContext.ecsTaskDefFamily}}"
-
name: ecs.task-definition-version
value: "{{ecsContext.ecsTaskDefVersion}}"
-
name: ecs.task-id
value: "SKIP"
-
metricName: ecs.task.cpu.reserved_{{testingId}}
namespace: {{metricNamespace}}
dimensions:
-
metricName: ecs.task.cpu.utilized_{{testingId}}
namespace: {{metricNamespace}}
dimensions:
-
metricName: ecs.task.network.rate.rx_{{testingId}}
namespace: {{metricNamespace}}
dimensions:
-
metricName: ecs.task.network.rate.tx_{{testingId}}
namespace: {{metricNamespace}}
dimensions:
-
metricName: ecs.task.storage.read_bytes_{{testingId}}
namespace: {{metricNamespace}}
dimensions:
-
metricName: ecs.task.storage.write_bytes_{{testingId}}
namespace: {{metricNamespace}}
dimensions:

0 comments on commit 8352978

Please sign in to comment.