Skip to content

Commit

Permalink
fix(exporter): fix exporter indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronwalker committed Jan 6, 2022
1 parent 0624268 commit 581c9ed
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
16 changes: 8 additions & 8 deletions amp-ecs.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ default_aot_config_content:
processors:
batch: {}

exporters:
awsprometheusremotewrite:
endpoint: ${APSWorkspace.PrometheusEndpoint}api/v1/remote_write
aws_auth:
region: ${AWS::Region}
service: "aps"
logging:
loglevel: debug
exporters:
awsprometheusremotewrite:
endpoint: ${APSWorkspace.PrometheusEndpoint}api/v1/remote_write
aws_auth:
region: ${AWS::Region}
service: "aps"
logging:
loglevel: debug


service:
Expand Down
2 changes: 1 addition & 1 deletion spec/custom-ecs-observer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

it 'has Value property' do
expect(properties['Value']).to eq({
"Fn::Sub" => "---\nextensions:\n ecs_observer:\n refresh_interval: 20s\n cluster_name: \"${EnvironmentName}-services\"\n cluster_region: \"${AWS::Region}\"\n result_file: \"/etc/ecs_sd_targets.yaml\"\n docker_labels:\n - port_label: ECS_PROMETHEUS_EXPORTER_PORT\n - port_label: ECS_PROMETHEUS_EXPORTER_PORT_V2\n metrics_path_label: ECS_PROMETHEUS_EXPORTER_METRICS_PATH\nreceivers:\n prometheus:\n config:\n scrape_configs:\n - job_name: custom-ecssd\n file_sd_configs:\n - files:\n - \"/etc/ecs_sd_targets.yaml\"\n relabel_configs:\n - source_labels:\n - __meta_ecs_cluster_name\n action: replace\n target_label: ClusterName\n - source_labels:\n - __meta_ecs_service_name\n action: replace\n target_label: ServiceName\n - source_labels:\n - __meta_ecs_task_definition_family\n action: replace\n target_label: TaskDefinitionFamily\n - source_labels:\n - __meta_ecs_container_name\n action: replace\n target_label: container_name\n - action: labelmap\n regex: \"^__meta_ecs_container_labels_(.+)$\"\n replacement: \"$$1\"\nprocessors:\n batch: {}\n exporters:\n awsprometheusremotewrite:\n endpoint: \"${APSWorkspace.PrometheusEndpoint}api/v1/remote_write\"\n aws_auth:\n region: \"${AWS::Region}\"\n service: aps\n logging:\n loglevel: error\nservice:\n extensions:\n - ecs_observer\n pipelines:\n metrics:\n receivers:\n - prometheus\n processors:\n - batch\n exporters:\n - awsprometheusremotewrite\n",
"Fn::Sub" => "---\nextensions:\n ecs_observer:\n refresh_interval: 20s\n cluster_name: \"${EnvironmentName}-services\"\n cluster_region: \"${AWS::Region}\"\n result_file: \"/etc/ecs_sd_targets.yaml\"\n docker_labels:\n - port_label: ECS_PROMETHEUS_EXPORTER_PORT\n - port_label: ECS_PROMETHEUS_EXPORTER_PORT_V2\n metrics_path_label: ECS_PROMETHEUS_EXPORTER_METRICS_PATH\nreceivers:\n prometheus:\n config:\n scrape_configs:\n - job_name: custom-ecssd\n file_sd_configs:\n - files:\n - \"/etc/ecs_sd_targets.yaml\"\n relabel_configs:\n - source_labels:\n - __meta_ecs_cluster_name\n action: replace\n target_label: ClusterName\n - source_labels:\n - __meta_ecs_service_name\n action: replace\n target_label: ServiceName\n - source_labels:\n - __meta_ecs_task_definition_family\n action: replace\n target_label: TaskDefinitionFamily\n - source_labels:\n - __meta_ecs_container_name\n action: replace\n target_label: container_name\n - action: labelmap\n regex: \"^__meta_ecs_container_labels_(.+)$\"\n replacement: \"$$1\"\nprocessors:\n batch: {}\nexporters:\n awsprometheusremotewrite:\n endpoint: \"${APSWorkspace.PrometheusEndpoint}api/v1/remote_write\"\n aws_auth:\n region: \"${AWS::Region}\"\n service: aps\n logging:\n loglevel: error\nservice:\n extensions:\n - ecs_observer\n pipelines:\n metrics:\n receivers:\n - prometheus\n processors:\n - batch\n exporters:\n - awsprometheusremotewrite\n",
})
end

Expand Down
2 changes: 1 addition & 1 deletion spec/custom-services_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

it 'has Value property' do
expect(properties['Value']).to eq({
"Fn::Sub" => "---\nextensions:\n ecs_observer:\n refresh_interval: 60s\n cluster_name: \"${EnvironmentName}-services\"\n cluster_region: \"${AWS::Region}\"\n result_file: \"/etc/ecs_sd_targets.yaml\"\n docker_labels:\n - port_label: ECS_PROMETHEUS_EXPORTER_PORT\n - port_label: ECS_PROMETHEUS_EXPORTER_PORT_V2\n metrics_path_label: ECS_PROMETHEUS_EXPORTER_METRICS_PATH\n services:\n - name_pattern: \"^myservice-.*$\"\n metrics_ports:\n - 8080\nreceivers:\n prometheus:\n config:\n scrape_configs:\n - job_name: ecssd\n file_sd_configs:\n - files:\n - \"/etc/ecs_sd_targets.yaml\"\n relabel_configs:\n - source_labels:\n - __meta_ecs_cluster_name\n action: replace\n target_label: ClusterName\n - source_labels:\n - __meta_ecs_service_name\n action: replace\n target_label: ServiceName\n - source_labels:\n - __meta_ecs_task_definition_family\n action: replace\n target_label: TaskDefinitionFamily\n - source_labels:\n - __meta_ecs_container_name\n action: replace\n target_label: container_name\n - action: labelmap\n regex: \"^__meta_ecs_container_labels_(.+)$\"\n replacement: \"$$1\"\nprocessors:\n batch: {}\n exporters:\n awsprometheusremotewrite:\n endpoint: \"${APSWorkspace.PrometheusEndpoint}api/v1/remote_write\"\n aws_auth:\n region: \"${AWS::Region}\"\n service: aps\n logging:\n loglevel: debug\nservice:\n extensions:\n - ecs_observer\n pipelines:\n metrics:\n receivers:\n - prometheus\n processors:\n - batch\n exporters:\n - logging\n - awsprometheusremotewrite\n",
"Fn::Sub" => "---\nextensions:\n ecs_observer:\n refresh_interval: 60s\n cluster_name: \"${EnvironmentName}-services\"\n cluster_region: \"${AWS::Region}\"\n result_file: \"/etc/ecs_sd_targets.yaml\"\n docker_labels:\n - port_label: ECS_PROMETHEUS_EXPORTER_PORT\n - port_label: ECS_PROMETHEUS_EXPORTER_PORT_V2\n metrics_path_label: ECS_PROMETHEUS_EXPORTER_METRICS_PATH\n services:\n - name_pattern: \"^myservice-.*$\"\n metrics_ports:\n - 8080\nreceivers:\n prometheus:\n config:\n scrape_configs:\n - job_name: ecssd\n file_sd_configs:\n - files:\n - \"/etc/ecs_sd_targets.yaml\"\n relabel_configs:\n - source_labels:\n - __meta_ecs_cluster_name\n action: replace\n target_label: ClusterName\n - source_labels:\n - __meta_ecs_service_name\n action: replace\n target_label: ServiceName\n - source_labels:\n - __meta_ecs_task_definition_family\n action: replace\n target_label: TaskDefinitionFamily\n - source_labels:\n - __meta_ecs_container_name\n action: replace\n target_label: container_name\n - action: labelmap\n regex: \"^__meta_ecs_container_labels_(.+)$\"\n replacement: \"$$1\"\nprocessors:\n batch: {}\nexporters:\n awsprometheusremotewrite:\n endpoint: \"${APSWorkspace.PrometheusEndpoint}api/v1/remote_write\"\n aws_auth:\n region: \"${AWS::Region}\"\n service: aps\n logging:\n loglevel: debug\nservice:\n extensions:\n - ecs_observer\n pipelines:\n metrics:\n receivers:\n - prometheus\n processors:\n - batch\n exporters:\n - logging\n - awsprometheusremotewrite\n",
})
end

Expand Down
2 changes: 1 addition & 1 deletion spec/custom-taskdef_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

it 'has Value property' do
expect(properties['Value']).to eq({
"Fn::Sub" => "---\nextensions:\n ecs_observer:\n refresh_interval: 60s\n cluster_name: \"${EnvironmentName}-services\"\n cluster_region: \"${AWS::Region}\"\n result_file: \"/etc/ecs_sd_targets.yaml\"\n docker_labels:\n - port_label: ECS_PROMETHEUS_EXPORTER_PORT\n - port_label: ECS_PROMETHEUS_EXPORTER_PORT_V2\n metrics_path_label: ECS_PROMETHEUS_EXPORTER_METRICS_PATH\n task_definitions:\n - arn_pattern: \"^mytask-.*$\"\n - arn_pattern: \"*othertask-.*\"\n metrics_path: \"/mymetrics\"\n metrics_ports:\n - 8080\n - 9090\nreceivers:\n prometheus:\n config:\n scrape_configs:\n - job_name: ecssd\n file_sd_configs:\n - files:\n - \"/etc/ecs_sd_targets.yaml\"\n relabel_configs:\n - source_labels:\n - __meta_ecs_cluster_name\n action: replace\n target_label: ClusterName\n - source_labels:\n - __meta_ecs_service_name\n action: replace\n target_label: ServiceName\n - source_labels:\n - __meta_ecs_task_definition_family\n action: replace\n target_label: TaskDefinitionFamily\n - source_labels:\n - __meta_ecs_container_name\n action: replace\n target_label: container_name\n - action: labelmap\n regex: \"^__meta_ecs_container_labels_(.+)$\"\n replacement: \"$$1\"\nprocessors:\n batch: {}\n exporters:\n awsprometheusremotewrite:\n endpoint: \"${APSWorkspace.PrometheusEndpoint}api/v1/remote_write\"\n aws_auth:\n region: \"${AWS::Region}\"\n service: aps\n logging:\n loglevel: debug\nservice:\n extensions:\n - ecs_observer\n pipelines:\n metrics:\n receivers:\n - prometheus\n processors:\n - batch\n exporters:\n - logging\n - awsprometheusremotewrite\n",
"Fn::Sub" => "---\nextensions:\n ecs_observer:\n refresh_interval: 60s\n cluster_name: \"${EnvironmentName}-services\"\n cluster_region: \"${AWS::Region}\"\n result_file: \"/etc/ecs_sd_targets.yaml\"\n docker_labels:\n - port_label: ECS_PROMETHEUS_EXPORTER_PORT\n - port_label: ECS_PROMETHEUS_EXPORTER_PORT_V2\n metrics_path_label: ECS_PROMETHEUS_EXPORTER_METRICS_PATH\n task_definitions:\n - arn_pattern: \"^mytask-.*$\"\n - arn_pattern: \"*othertask-.*\"\n metrics_path: \"/mymetrics\"\n metrics_ports:\n - 8080\n - 9090\nreceivers:\n prometheus:\n config:\n scrape_configs:\n - job_name: ecssd\n file_sd_configs:\n - files:\n - \"/etc/ecs_sd_targets.yaml\"\n relabel_configs:\n - source_labels:\n - __meta_ecs_cluster_name\n action: replace\n target_label: ClusterName\n - source_labels:\n - __meta_ecs_service_name\n action: replace\n target_label: ServiceName\n - source_labels:\n - __meta_ecs_task_definition_family\n action: replace\n target_label: TaskDefinitionFamily\n - source_labels:\n - __meta_ecs_container_name\n action: replace\n target_label: container_name\n - action: labelmap\n regex: \"^__meta_ecs_container_labels_(.+)$\"\n replacement: \"$$1\"\nprocessors:\n batch: {}\nexporters:\n awsprometheusremotewrite:\n endpoint: \"${APSWorkspace.PrometheusEndpoint}api/v1/remote_write\"\n aws_auth:\n region: \"${AWS::Region}\"\n service: aps\n logging:\n loglevel: debug\nservice:\n extensions:\n - ecs_observer\n pipelines:\n metrics:\n receivers:\n - prometheus\n processors:\n - batch\n exporters:\n - logging\n - awsprometheusremotewrite\n",
})
end

Expand Down
2 changes: 1 addition & 1 deletion spec/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

it 'has Value property' do
expect(properties['Value']).to eq({
"Fn::Sub" => "---\nextensions:\n ecs_observer:\n refresh_interval: 60s\n cluster_name: \"${EnvironmentName}-services\"\n cluster_region: \"${AWS::Region}\"\n result_file: \"/etc/ecs_sd_targets.yaml\"\n docker_labels:\n - port_label: ECS_PROMETHEUS_EXPORTER_PORT\n - port_label: ECS_PROMETHEUS_EXPORTER_PORT_V2\n metrics_path_label: ECS_PROMETHEUS_EXPORTER_METRICS_PATH\nreceivers:\n prometheus:\n config:\n scrape_configs:\n - job_name: ecssd\n file_sd_configs:\n - files:\n - \"/etc/ecs_sd_targets.yaml\"\n relabel_configs:\n - source_labels:\n - __meta_ecs_cluster_name\n action: replace\n target_label: ClusterName\n - source_labels:\n - __meta_ecs_service_name\n action: replace\n target_label: ServiceName\n - source_labels:\n - __meta_ecs_task_definition_family\n action: replace\n target_label: TaskDefinitionFamily\n - source_labels:\n - __meta_ecs_container_name\n action: replace\n target_label: container_name\n - action: labelmap\n regex: \"^__meta_ecs_container_labels_(.+)$\"\n replacement: \"$$1\"\nprocessors:\n batch: {}\n exporters:\n awsprometheusremotewrite:\n endpoint: \"${APSWorkspace.PrometheusEndpoint}api/v1/remote_write\"\n aws_auth:\n region: \"${AWS::Region}\"\n service: aps\n logging:\n loglevel: debug\nservice:\n extensions:\n - ecs_observer\n pipelines:\n metrics:\n receivers:\n - prometheus\n processors:\n - batch\n exporters:\n - logging\n - awsprometheusremotewrite\n",
"Fn::Sub" => "---\nextensions:\n ecs_observer:\n refresh_interval: 60s\n cluster_name: \"${EnvironmentName}-services\"\n cluster_region: \"${AWS::Region}\"\n result_file: \"/etc/ecs_sd_targets.yaml\"\n docker_labels:\n - port_label: ECS_PROMETHEUS_EXPORTER_PORT\n - port_label: ECS_PROMETHEUS_EXPORTER_PORT_V2\n metrics_path_label: ECS_PROMETHEUS_EXPORTER_METRICS_PATH\nreceivers:\n prometheus:\n config:\n scrape_configs:\n - job_name: ecssd\n file_sd_configs:\n - files:\n - \"/etc/ecs_sd_targets.yaml\"\n relabel_configs:\n - source_labels:\n - __meta_ecs_cluster_name\n action: replace\n target_label: ClusterName\n - source_labels:\n - __meta_ecs_service_name\n action: replace\n target_label: ServiceName\n - source_labels:\n - __meta_ecs_task_definition_family\n action: replace\n target_label: TaskDefinitionFamily\n - source_labels:\n - __meta_ecs_container_name\n action: replace\n target_label: container_name\n - action: labelmap\n regex: \"^__meta_ecs_container_labels_(.+)$\"\n replacement: \"$$1\"\nprocessors:\n batch: {}\nexporters:\n awsprometheusremotewrite:\n endpoint: \"${APSWorkspace.PrometheusEndpoint}api/v1/remote_write\"\n aws_auth:\n region: \"${AWS::Region}\"\n service: aps\n logging:\n loglevel: debug\nservice:\n extensions:\n - ecs_observer\n pipelines:\n metrics:\n receivers:\n - prometheus\n processors:\n - batch\n exporters:\n - logging\n - awsprometheusremotewrite\n",
})
end

Expand Down
16 changes: 8 additions & 8 deletions tests/custom-ecs-observer.test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ aot_config_content:
processors:
batch: {}

exporters:
awsprometheusremotewrite:
endpoint: ${APSWorkspace.PrometheusEndpoint}api/v1/remote_write
aws_auth:
region: ${AWS::Region}
service: "aps"
logging:
loglevel: error
exporters:
awsprometheusremotewrite:
endpoint: ${APSWorkspace.PrometheusEndpoint}api/v1/remote_write
aws_auth:
region: ${AWS::Region}
service: "aps"
logging:
loglevel: error


service:
Expand Down

0 comments on commit 581c9ed

Please sign in to comment.