flush() {
		const series = this.generateDatadogSeries();

		if (series.length == 0) return;

		return fetch(
			`${this.opts.baseUrl}${this.opts.apiVersion}${this.opts.path}?api_key=${this.opts.apiKey}`,
			{
				method: "post",
				body: JSON.stringify({ series }),
				headers: {
					"Content-Type": "application/json"
				}
			}
		)
			.then(res => {
				this.logger.debug("Metrics are uploaded to DataDog. Status: ", res.statusText);
			})
			.catch(err => {
				/* istanbul ignore next */
				this.logger.warn(
					"Unable to upload metrics to Datadog server. Error:" + err.message,
					err
				);
			});
	}
Flush metric data to Datadog server

@memberof DatadogReporter