public async Task <HttpResponseMessage> PostToDataDog(DataDogPayload payload) { var json = JsonConvert.SerializeObject(payload); var content = new StringContent(json, Encoding.UTF8, "application/json"); var result = await httpClient.PostAsync(apiUrl, content); return(result); }
public async Task <HttpResponseMessage> Gauge(string metric, IEnumerable <DataDogPoint> points, IEnumerable <string> tags) { DataDogMetric dataMetric = new DataDogMetric() { Metric = metric, Points = points, Tags = tags, Type = "gauge" }; DataDogPayload payload = new DataDogPayload() { Series = new List <DataDogMetric>() { dataMetric } }; return(await PostToDataDog(payload)); }