packagemainimport ("fmt""net/http")funchandler(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, exportData)}funcmain() { http.HandleFunc("/", handler) http.ListenAndServe(":8080", nil)}var exportData string=`# HELP sample_http_requests_total The total number of HTTP requests.# TYPE sample_http_requests_total countersample_http_requests_total{method="post",code="200"} 1027 1395066363000sample_http_requests_total{method="post",code="400"} 3 1395066363000# Escaping in label values:sample_msdos_file_access_time_seconds{path="C:\\DIR\\FILE.TXT",error="Cannot find file:\n\"FILE.TXT\""} 1.458255915e9# Minimalistic line:sample_metric_without_timestamp_and_labels 12.47# A histogram, which has a pretty complex representation in the text format:# HELP sample_http_request_duration_seconds A histogram of the request duration.# TYPE sample_http_request_duration_seconds histogramsample_http_request_duration_seconds_bucket{le="0.05"} 24054sample_http_request_duration_seconds_bucket{le="0.1"} 33444sample_http_request_duration_seconds_bucket{le="0.2"} 100392sample_http_request_duration_seconds_bucket{le="0.5"} 129389sample_http_request_duration_seconds_bucket{le="1"} 133988sample_http_request_duration_seconds_bucket{le="+Inf"} 144320sample_http_request_duration_seconds_sum 53423sample_http_request_duration_seconds_count 144320# Finally a summary, which has a complex representation, too:# HELP sample_rpc_duration_seconds A summary of the RPC duration in seconds.# TYPE sample_rpc_duration_seconds summarysample_rpc_duration_seconds{quantile="0.01"} 3102sample_rpc_duration_seconds{quantile="0.05"} 3272sample_rpc_duration_seconds{quantile="0.5"} 4773sample_rpc_duration_seconds{quantile="0.9"} 9001sample_rpc_duration_seconds{quantile="0.99"} 76656sample_rpc_duration_seconds_sum 1.7560473e+07sample_rpc_duration_seconds_count 2693`