{
    "agent": {
        "metrics_collection_interval": 60,
	"region": "eu-west-3",
        "logfile": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
        "run_as_user": "root",
	"debug": true
    },
    "logs": {
        "metrics_collected":{
            "prometheus": {
                "log_group_name":"berty",
                "prometheus_config_path":"/home/ec2-user/prometheus.yaml",
                "emf_processor":{
		    "metric_declaration_dedup": true,
		    "metric_namespace":"CWAgent-Prometheus",
		    "metric_unit": {
                        "go_goroutines": "Count",
			"go_threads": "Count",
                        "ipfs_host_open_connection": "Count"
                    },
		    "metric_declaration":[
			{
			    "source_labels": ["protocol_id"],
			    "label_matcher": "/.+",
			    "dimensions": [["service", "job", "protocol_id"]],
			    "metric_selectors":[
				"^ipfs_host_open_stream$",
				"^ipfs_bandwidth_in$",
				"^ipfs_bandwidth_out$"
			    ]
			},
			{
			    "source_labels": ["job"],
			    "label_matcher": "berty-metrics",
			    "dimensions": [["service", "job"]],
			    "metric_selectors":[
				"^ipfs_host_open_connection$",
				"^go_gc_duration_seconds_count$",
				"^go_gc_duration_seconds_sum$",
				"^go_goroutines$",
				"^go_memstats_alloc_bytes$",
				"^go_memstats_alloc_bytes_total$",
				"^go_memstats_buck_hash_sys_bytes$",
				"^go_memstats_frees_total$",
				"^go_memstats_gc_cpu_fraction$",
				"^go_memstats_gc_sys_bytes$",
				"^go_memstats_heap_alloc_bytes$",
				"^go_memstats_heap_idle_bytes$",
				"^go_memstats_heap_inuse_bytes$",
				"^go_memstats_heap_objects$",
				"^go_memstats_heap_released_bytes$",
				"^go_memstats_heap_sys_bytes$",
				"^go_memstats_last_gc_time_seconds$",
				"^go_memstats_lookups_total$",
				"^go_memstats_mallocs_total$",
				"^go_memstats_mcache_inuse_bytes$",
				"^go_memstats_mcache_sys_bytes$",
				"^go_memstats_mspan_inuse_bytes$",
				"^go_memstats_mspan_sys_bytes$",
				"^go_memstats_next_gc_bytes$",
				"^go_memstats_other_sys_bytes$",
				"^go_memstats_stack_inuse_bytes$",
				"^go_memstats_stack_sys_bytes$",
				"^go_memstats_sys_bytes$",
				"^go_threads$"
			    ]
			}
		    ]
                }
            }
        }
    },
    "logs_collected": {
        "files": {
            "collect_list": [{
                "file_path": "/home/ec2-user/logs/berty.log",
                "log_group_name": "berty",
                "log_stream_name": "{instance_id}",
                "retention_in_days": -1
            }]
        }
    }
}
