From d8a9e7b321e76ef270534f641bb9927d3327a321 Mon Sep 17 00:00:00 2001 From: Jacob Marble Date: Wed, 14 Jul 2021 14:56:03 -0700 Subject: [PATCH 1/2] chore: update dependencies influxdb-observability and line-protocol --- exporter/influxdbexporter/go.mod | 6 +++--- exporter/influxdbexporter/go.sum | 22 ++++++++++++++-------- exporter/influxdbexporter/writer.go | 2 +- go.sum | 26 ++++++++++++++++---------- receiver/influxdbreceiver/README.md | 11 ++++------- receiver/influxdbreceiver/config.go | 6 ------ receiver/influxdbreceiver/factory.go | 1 - receiver/influxdbreceiver/go.mod | 6 +++--- receiver/influxdbreceiver/go.sum | 22 ++++++++++++++-------- receiver/influxdbreceiver/receiver.go | 8 ++------ 10 files changed, 57 insertions(+), 53 deletions(-) diff --git a/exporter/influxdbexporter/go.mod b/exporter/influxdbexporter/go.mod index d83c54cd77da..3b001ad6b5c4 100644 --- a/exporter/influxdbexporter/go.mod +++ b/exporter/influxdbexporter/go.mod @@ -3,9 +3,9 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/influx go 1.16 require ( - github.com/influxdata/influxdb-observability/common v0.1.0 - github.com/influxdata/influxdb-observability/otel2influx v0.1.0 - github.com/influxdata/line-protocol/v2 v2.0.0-20210428091617-0567a5134992 + github.com/influxdata/influxdb-observability/common v0.1.1 + github.com/influxdata/influxdb-observability/otel2influx v0.1.1 + github.com/influxdata/line-protocol/v2 v2.0.0-20210520103755-6551a972d603 github.com/stretchr/testify v1.7.0 go.opentelemetry.io/collector v0.30.2-0.20210719230137-809cae954ed3 go.opentelemetry.io/collector/model v0.30.2-0.20210719230137-809cae954ed3 diff --git a/exporter/influxdbexporter/go.sum b/exporter/influxdbexporter/go.sum index 268d4930e2ac..1a9f38ae1566 100644 --- a/exporter/influxdbexporter/go.sum +++ b/exporter/influxdbexporter/go.sum @@ -274,8 +274,10 @@ github.com/foxcpp/go-mockdns v0.0.0-20201212160233-ede2f9158d15/go.mod h1:tPg4cp github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.11.0/go.mod h1:K+q6oSqb0W0Ininfk863uOk1lMy69l/P6txr3mVT54s= -github.com/frankban/quicktest v1.11.3 h1:8sXhOn0uLys67V8EsXLc6eszDs8VXWxL3iRvebPhedY= +github.com/frankban/quicktest v1.11.2/go.mod h1:K+q6oSqb0W0Ininfk863uOk1lMy69l/P6txr3mVT54s= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= +github.com/frankban/quicktest v1.13.0 h1:yNZif1OkDfNoDfb9zZa9aXIpejNR4F23Wely0c+Qdqk= +github.com/frankban/quicktest v1.13.0/go.mod h1:qLE0fzW0VuyUAJgPU19zByoIr0HtCHN/r/VLSOOIySU= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -634,21 +636,25 @@ github.com/influxdata/flux v0.113.0/go.mod h1:3TJtvbm/Kwuo5/PEo5P6HUzwVg4bXWkb2w github.com/influxdata/httprouter v1.3.1-0.20191122104820-ee83e2772f69/go.mod h1:pwymjR6SrP3gD3pRj9RJwdl1j5s3doEEV8gS4X9qSzA= github.com/influxdata/influxdb v1.8.0/go.mod h1:SIzcnsjaHRFpmlxpJ4S3NT64qtEKYweNTUMb/vh0OMQ= github.com/influxdata/influxdb v1.9.2/go.mod h1:UEe3MeD9AaP5rlPIes102IhYua3FhIWZuOXNHxDjSrI= -github.com/influxdata/influxdb-observability/common v0.0.0-20210503043157-6ea7daf489f3/go.mod h1:PMngVYsW4uwtzIVmj0ZfLL9UIOwo7Vs+09QHkoYMZv8= -github.com/influxdata/influxdb-observability/common v0.1.0 h1:ZMZkAgoU1KckYXtjrP9VemqeTrbJRwJrC+CPrSPAnLY= github.com/influxdata/influxdb-observability/common v0.1.0/go.mod h1:LynmG92zQlDsATlw2q2RyVTdMcXxo7mMuT1e5+0//HU= -github.com/influxdata/influxdb-observability/otel2influx v0.1.0 h1:yZvi4if3Dr+cL0EM1mVR80d45AKb7jeNuLGdkb83Esw= -github.com/influxdata/influxdb-observability/otel2influx v0.1.0/go.mod h1:gWN7iMQiw0cufAf7CN0WQrL2BDlrgnpzsFywgwOXoW4= -github.com/influxdata/influxdb-observability/otlp v0.0.0-20210605003714-a868e4b21ba8 h1:j2Ei8Z4OMUfSEvWCikYRxjkkw6eBiMxlOhc7izs1hts= +github.com/influxdata/influxdb-observability/common v0.1.1 h1:d/MoKoN79gJ03nxVVh4rytsL3H5XzsXfvFKuURZ2Fss= +github.com/influxdata/influxdb-observability/common v0.1.1/go.mod h1:TA+gA3DRQXJ8FAhvAdeOsy9RGTdAFZBx6vFGxhbhYbI= +github.com/influxdata/influxdb-observability/otel2influx v0.1.1 h1:q/PNFBkV1ZLd0etKGtumsjm7xkfHEbYHFvqJQEz5hGw= +github.com/influxdata/influxdb-observability/otel2influx v0.1.1/go.mod h1:k1ydZuZ+pqyPXvLNmwpBOByT4gV5qe20hyVpngU7HHI= github.com/influxdata/influxdb-observability/otlp v0.0.0-20210605003714-a868e4b21ba8/go.mod h1:23SLY21Ag84PC0TbvVhdKoOVvrQF6nq5j5sFOW09ZBU= +github.com/influxdata/influxdb-observability/otlp v0.1.0 h1:aAG7M6OG+iR52srH7TO7+cKwqFa3E3CUdTQ5LfpfPZo= +github.com/influxdata/influxdb-observability/otlp v0.1.0/go.mod h1:dUIflut4U5fjtFcU0FUQPKvnN/eF3lR1m4Zt3PNe8cg= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/influxql v1.1.0/go.mod h1:KpVI7okXjK6PRi3Z5B+mtKZli+R1DnZgb3N+tzevNgo= github.com/influxdata/influxql v1.1.1-0.20210223160523-b6ab99450c93/go.mod h1:gHp9y86a/pxhjJ+zMjNXiQAA197Xk9wLxaz+fGG+kWk= github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e h1:/o3vQtpWJhvnIbXley4/jwzzqNeigJK9z+LZcJZ9zfM= github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE= -github.com/influxdata/line-protocol/v2 v2.0.0-20210428091617-0567a5134992 h1:bvd+v422XMzbuLvkfRSXyV9Lt/v05Zi80D//kUeS1yU= -github.com/influxdata/line-protocol/v2 v2.0.0-20210428091617-0567a5134992/go.mod h1:6+9Xt5Sq1rWx+glMgxhcg2c0DUaehK+5TDcPZ76GypY= +github.com/influxdata/line-protocol-corpus v0.0.0-20210519164801-ca6fa5da0184 h1:modYba1g1we+YJf0yGTwmohVWVAxcAch18nPg3e24OY= +github.com/influxdata/line-protocol-corpus v0.0.0-20210519164801-ca6fa5da0184/go.mod h1:03nmhxzZ7Xk2pdG+lmMd7mHDfeVOYFyhOgwO61qWU98= +github.com/influxdata/line-protocol/v2 v2.0.0-20210312151457-c52fdecb625a/go.mod h1:6+9Xt5Sq1rWx+glMgxhcg2c0DUaehK+5TDcPZ76GypY= +github.com/influxdata/line-protocol/v2 v2.0.0-20210520103755-6551a972d603 h1:ia96+xt3Z0lh8glUXFsXATBwTzU9tmTXqnVsBd5r8ME= +github.com/influxdata/line-protocol/v2 v2.0.0-20210520103755-6551a972d603/go.mod h1:QKw43hdUBg3GTk2iC3iyCxksNj7PX9aUSeYOYE/ceHY= github.com/influxdata/pkg-config v0.2.6/go.mod h1:EMS7Ll0S4qkzDk53XS3Z72/egBsPInt+BeRxb0WeSwk= github.com/influxdata/pkg-config v0.2.7/go.mod h1:EMS7Ll0S4qkzDk53XS3Z72/egBsPInt+BeRxb0WeSwk= github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8= diff --git a/exporter/influxdbexporter/writer.go b/exporter/influxdbexporter/writer.go index 697ac9f8a3b6..503a8f2e769f 100644 --- a/exporter/influxdbexporter/writer.go +++ b/exporter/influxdbexporter/writer.go @@ -172,7 +172,7 @@ func (b *influxHTTPWriterBatch) convertFields(m map[string]interface{}) (fields if k == "" { b.logger.Debug("empty field key") } else if lpv, ok := lineprotocol.NewValue(v); !ok { - b.logger.Debug("invalid field value %q for key %q", v, k) + b.logger.Debug("invalid field value", "key", k, "value", v) } else { fields[k] = lpv } diff --git a/go.sum b/go.sum index c16848a8ea27..69c78ea45834 100644 --- a/go.sum +++ b/go.sum @@ -562,8 +562,10 @@ github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2 github.com/frankban/quicktest v1.7.3/go.mod h1:V1d2J5pfxYH6EjBAgSK7YNXcXlTWxUHdE1sVDXkjnig= github.com/frankban/quicktest v1.10.2/go.mod h1:K+q6oSqb0W0Ininfk863uOk1lMy69l/P6txr3mVT54s= github.com/frankban/quicktest v1.11.0/go.mod h1:K+q6oSqb0W0Ininfk863uOk1lMy69l/P6txr3mVT54s= -github.com/frankban/quicktest v1.11.3 h1:8sXhOn0uLys67V8EsXLc6eszDs8VXWxL3iRvebPhedY= +github.com/frankban/quicktest v1.11.2/go.mod h1:K+q6oSqb0W0Ininfk863uOk1lMy69l/P6txr3mVT54s= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= +github.com/frankban/quicktest v1.13.0 h1:yNZif1OkDfNoDfb9zZa9aXIpejNR4F23Wely0c+Qdqk= +github.com/frankban/quicktest v1.13.0/go.mod h1:qLE0fzW0VuyUAJgPU19zByoIr0HtCHN/r/VLSOOIySU= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -1071,15 +1073,16 @@ github.com/influxdata/httprouter v1.3.1-0.20191122104820-ee83e2772f69/go.mod h1: github.com/influxdata/influxdb v1.8.0/go.mod h1:SIzcnsjaHRFpmlxpJ4S3NT64qtEKYweNTUMb/vh0OMQ= github.com/influxdata/influxdb v1.8.4/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= github.com/influxdata/influxdb v1.9.2/go.mod h1:UEe3MeD9AaP5rlPIes102IhYua3FhIWZuOXNHxDjSrI= -github.com/influxdata/influxdb-observability/common v0.0.0-20210503043157-6ea7daf489f3/go.mod h1:PMngVYsW4uwtzIVmj0ZfLL9UIOwo7Vs+09QHkoYMZv8= -github.com/influxdata/influxdb-observability/common v0.1.0 h1:ZMZkAgoU1KckYXtjrP9VemqeTrbJRwJrC+CPrSPAnLY= github.com/influxdata/influxdb-observability/common v0.1.0/go.mod h1:LynmG92zQlDsATlw2q2RyVTdMcXxo7mMuT1e5+0//HU= -github.com/influxdata/influxdb-observability/influx2otel v0.1.0 h1:ZM50JMI+K7tK+EMiCE4H8ENwdS475LNdogcSMCPvSCs= -github.com/influxdata/influxdb-observability/influx2otel v0.1.0/go.mod h1:DGy5/YNkWR07nYrdGmYW3hGkz1pz3LamCJGX/fgTW+Q= -github.com/influxdata/influxdb-observability/otel2influx v0.1.0 h1:yZvi4if3Dr+cL0EM1mVR80d45AKb7jeNuLGdkb83Esw= -github.com/influxdata/influxdb-observability/otel2influx v0.1.0/go.mod h1:gWN7iMQiw0cufAf7CN0WQrL2BDlrgnpzsFywgwOXoW4= -github.com/influxdata/influxdb-observability/otlp v0.0.0-20210605003714-a868e4b21ba8 h1:j2Ei8Z4OMUfSEvWCikYRxjkkw6eBiMxlOhc7izs1hts= +github.com/influxdata/influxdb-observability/common v0.1.1 h1:d/MoKoN79gJ03nxVVh4rytsL3H5XzsXfvFKuURZ2Fss= +github.com/influxdata/influxdb-observability/common v0.1.1/go.mod h1:TA+gA3DRQXJ8FAhvAdeOsy9RGTdAFZBx6vFGxhbhYbI= +github.com/influxdata/influxdb-observability/influx2otel v0.1.1 h1:4fDDEP/QV2XdAk/jRRMOneDL3mZylgIe74UZvmeKSFk= +github.com/influxdata/influxdb-observability/influx2otel v0.1.1/go.mod h1:XtUge9BKDrSWl7lwF4ML4MZUvgzWtj/1F2f1/yR9NXw= +github.com/influxdata/influxdb-observability/otel2influx v0.1.1 h1:q/PNFBkV1ZLd0etKGtumsjm7xkfHEbYHFvqJQEz5hGw= +github.com/influxdata/influxdb-observability/otel2influx v0.1.1/go.mod h1:k1ydZuZ+pqyPXvLNmwpBOByT4gV5qe20hyVpngU7HHI= github.com/influxdata/influxdb-observability/otlp v0.0.0-20210605003714-a868e4b21ba8/go.mod h1:23SLY21Ag84PC0TbvVhdKoOVvrQF6nq5j5sFOW09ZBU= +github.com/influxdata/influxdb-observability/otlp v0.1.0 h1:aAG7M6OG+iR52srH7TO7+cKwqFa3E3CUdTQ5LfpfPZo= +github.com/influxdata/influxdb-observability/otlp v0.1.0/go.mod h1:dUIflut4U5fjtFcU0FUQPKvnN/eF3lR1m4Zt3PNe8cg= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/influxql v1.1.0/go.mod h1:KpVI7okXjK6PRi3Z5B+mtKZli+R1DnZgb3N+tzevNgo= @@ -1087,8 +1090,11 @@ github.com/influxdata/influxql v1.1.1-0.20200828144457-65d3ef77d385/go.mod h1:gH github.com/influxdata/influxql v1.1.1-0.20210223160523-b6ab99450c93/go.mod h1:gHp9y86a/pxhjJ+zMjNXiQAA197Xk9wLxaz+fGG+kWk= github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e h1:/o3vQtpWJhvnIbXley4/jwzzqNeigJK9z+LZcJZ9zfM= github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE= -github.com/influxdata/line-protocol/v2 v2.0.0-20210428091617-0567a5134992 h1:bvd+v422XMzbuLvkfRSXyV9Lt/v05Zi80D//kUeS1yU= -github.com/influxdata/line-protocol/v2 v2.0.0-20210428091617-0567a5134992/go.mod h1:6+9Xt5Sq1rWx+glMgxhcg2c0DUaehK+5TDcPZ76GypY= +github.com/influxdata/line-protocol-corpus v0.0.0-20210519164801-ca6fa5da0184 h1:modYba1g1we+YJf0yGTwmohVWVAxcAch18nPg3e24OY= +github.com/influxdata/line-protocol-corpus v0.0.0-20210519164801-ca6fa5da0184/go.mod h1:03nmhxzZ7Xk2pdG+lmMd7mHDfeVOYFyhOgwO61qWU98= +github.com/influxdata/line-protocol/v2 v2.0.0-20210312151457-c52fdecb625a/go.mod h1:6+9Xt5Sq1rWx+glMgxhcg2c0DUaehK+5TDcPZ76GypY= +github.com/influxdata/line-protocol/v2 v2.0.0-20210520103755-6551a972d603 h1:ia96+xt3Z0lh8glUXFsXATBwTzU9tmTXqnVsBd5r8ME= +github.com/influxdata/line-protocol/v2 v2.0.0-20210520103755-6551a972d603/go.mod h1:QKw43hdUBg3GTk2iC3iyCxksNj7PX9aUSeYOYE/ceHY= github.com/influxdata/pkg-config v0.2.6/go.mod h1:EMS7Ll0S4qkzDk53XS3Z72/egBsPInt+BeRxb0WeSwk= github.com/influxdata/pkg-config v0.2.7/go.mod h1:EMS7Ll0S4qkzDk53XS3Z72/egBsPInt+BeRxb0WeSwk= github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8= diff --git a/receiver/influxdbreceiver/README.md b/receiver/influxdbreceiver/README.md index 37926d02b926..b0ff6ce8e019 100644 --- a/receiver/influxdbreceiver/README.md +++ b/receiver/influxdbreceiver/README.md @@ -18,10 +18,7 @@ Write responses: The following configuration options are supported: * `endpoint` (default = 0.0.0.0:8086) HTTP service endpoint for the line protocol receiver -* `metrics_schema` (default = telegraf-prometheus-v1) The chosen metrics schema to parse; must be one of: - * `telegraf-prometheus-v1` - * `telegraf-prometheus-v2` - + The full list of settings exposed for this receiver are documented in [config.go](config.go). Example: @@ -29,7 +26,6 @@ Example: receivers: influxdb: endpoint: 0.0.0.0:8080 - metrics_schema: telegraf-prometheus-v1 ``` ## Definitions @@ -44,8 +40,9 @@ Telegraf has [hundreds of plugins](https://www.influxdata.com/products/integrati ## Schema The InfluxDB->OpenTelemetry conversion [schema](https://github.com/influxdata/influxdb-observability/blob/main/docs/index.md) and [implementation](https://github.com/influxdata/influxdb-observability/tree/main/influx2otel) are hosted at https://github.com/influxdata/influxdb-observability . +This receiver automatically detects schema at parse time. -### Example: Metrics - `telegraf-prometheus-v1` +### Example: Metrics - `prometheus-v1` ``` cpu_temp,foo=bar gauge=87.332 http_requests_total,method=post,code=200 counter=1027 @@ -54,7 +51,7 @@ http_request_duration_seconds 0.05=24054,0.1=33444,0.2=100392,0.5=129389,1=13398 rpc_duration_seconds 0.01=3102,0.05=3272,0.5=4773,0.9=9001,0.99=76656,sum=1.7560473e+07,count=2693 ``` -### Example: Metrics - `telegraf-prometheus-v2` +### Example: Metrics - `prometheus-v2` ``` prometheus,foo=bar cpu_temp=87.332 prometheus,method=post,code=200 http_requests_total=1027 diff --git a/receiver/influxdbreceiver/config.go b/receiver/influxdbreceiver/config.go index 9ab4109783e1..f73134336955 100644 --- a/receiver/influxdbreceiver/config.go +++ b/receiver/influxdbreceiver/config.go @@ -23,10 +23,4 @@ import ( type Config struct { config.ReceiverSettings `mapstructure:"-"` confighttp.HTTPServerSettings `mapstructure:",squash"` - - // MetricsSchema indicates the metrics schema to emit to line protocol. - // Options: - // - telegraf-prometheus-v1 - // - telegraf-prometheus-v2 - MetricsSchema string `mapstructure:"metrics_schema"` } diff --git a/receiver/influxdbreceiver/factory.go b/receiver/influxdbreceiver/factory.go index ba0358f28cfc..e1a39779f292 100644 --- a/receiver/influxdbreceiver/factory.go +++ b/receiver/influxdbreceiver/factory.go @@ -42,7 +42,6 @@ func createDefaultConfig() config.Receiver { HTTPServerSettings: confighttp.HTTPServerSettings{ Endpoint: "0.0.0.0:8086", }, - MetricsSchema: "telegraf-prometheus-v1", } } diff --git a/receiver/influxdbreceiver/go.mod b/receiver/influxdbreceiver/go.mod index ffc3f6b309f0..f214c3cd0ceb 100644 --- a/receiver/influxdbreceiver/go.mod +++ b/receiver/influxdbreceiver/go.mod @@ -4,9 +4,9 @@ go 1.16 require ( github.com/gorilla/mux v1.8.0 - github.com/influxdata/influxdb-observability/common v0.1.0 - github.com/influxdata/influxdb-observability/influx2otel v0.1.0 - github.com/influxdata/line-protocol/v2 v2.0.0-20210428091617-0567a5134992 + github.com/influxdata/influxdb-observability/common v0.1.1 + github.com/influxdata/influxdb-observability/influx2otel v0.1.1 + github.com/influxdata/line-protocol/v2 v2.0.0-20210520103755-6551a972d603 go.opentelemetry.io/collector v0.30.2-0.20210719230137-809cae954ed3 go.opentelemetry.io/collector/model v0.30.2-0.20210719230137-809cae954ed3 go.uber.org/zap v1.18.1 diff --git a/receiver/influxdbreceiver/go.sum b/receiver/influxdbreceiver/go.sum index b5541910f15b..45e4db69443d 100644 --- a/receiver/influxdbreceiver/go.sum +++ b/receiver/influxdbreceiver/go.sum @@ -271,8 +271,10 @@ github.com/foxcpp/go-mockdns v0.0.0-20201212160233-ede2f9158d15/go.mod h1:tPg4cp github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.11.0/go.mod h1:K+q6oSqb0W0Ininfk863uOk1lMy69l/P6txr3mVT54s= -github.com/frankban/quicktest v1.11.3 h1:8sXhOn0uLys67V8EsXLc6eszDs8VXWxL3iRvebPhedY= +github.com/frankban/quicktest v1.11.2/go.mod h1:K+q6oSqb0W0Ininfk863uOk1lMy69l/P6txr3mVT54s= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= +github.com/frankban/quicktest v1.13.0 h1:yNZif1OkDfNoDfb9zZa9aXIpejNR4F23Wely0c+Qdqk= +github.com/frankban/quicktest v1.13.0/go.mod h1:qLE0fzW0VuyUAJgPU19zByoIr0HtCHN/r/VLSOOIySU= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -630,21 +632,25 @@ github.com/influxdata/flux v0.113.0/go.mod h1:3TJtvbm/Kwuo5/PEo5P6HUzwVg4bXWkb2w github.com/influxdata/httprouter v1.3.1-0.20191122104820-ee83e2772f69/go.mod h1:pwymjR6SrP3gD3pRj9RJwdl1j5s3doEEV8gS4X9qSzA= github.com/influxdata/influxdb v1.8.0/go.mod h1:SIzcnsjaHRFpmlxpJ4S3NT64qtEKYweNTUMb/vh0OMQ= github.com/influxdata/influxdb v1.9.2/go.mod h1:UEe3MeD9AaP5rlPIes102IhYua3FhIWZuOXNHxDjSrI= -github.com/influxdata/influxdb-observability/common v0.0.0-20210503043157-6ea7daf489f3/go.mod h1:PMngVYsW4uwtzIVmj0ZfLL9UIOwo7Vs+09QHkoYMZv8= -github.com/influxdata/influxdb-observability/common v0.1.0 h1:ZMZkAgoU1KckYXtjrP9VemqeTrbJRwJrC+CPrSPAnLY= github.com/influxdata/influxdb-observability/common v0.1.0/go.mod h1:LynmG92zQlDsATlw2q2RyVTdMcXxo7mMuT1e5+0//HU= -github.com/influxdata/influxdb-observability/influx2otel v0.1.0 h1:ZM50JMI+K7tK+EMiCE4H8ENwdS475LNdogcSMCPvSCs= -github.com/influxdata/influxdb-observability/influx2otel v0.1.0/go.mod h1:DGy5/YNkWR07nYrdGmYW3hGkz1pz3LamCJGX/fgTW+Q= -github.com/influxdata/influxdb-observability/otlp v0.0.0-20210605003714-a868e4b21ba8 h1:j2Ei8Z4OMUfSEvWCikYRxjkkw6eBiMxlOhc7izs1hts= +github.com/influxdata/influxdb-observability/common v0.1.1 h1:d/MoKoN79gJ03nxVVh4rytsL3H5XzsXfvFKuURZ2Fss= +github.com/influxdata/influxdb-observability/common v0.1.1/go.mod h1:TA+gA3DRQXJ8FAhvAdeOsy9RGTdAFZBx6vFGxhbhYbI= +github.com/influxdata/influxdb-observability/influx2otel v0.1.1 h1:4fDDEP/QV2XdAk/jRRMOneDL3mZylgIe74UZvmeKSFk= +github.com/influxdata/influxdb-observability/influx2otel v0.1.1/go.mod h1:XtUge9BKDrSWl7lwF4ML4MZUvgzWtj/1F2f1/yR9NXw= github.com/influxdata/influxdb-observability/otlp v0.0.0-20210605003714-a868e4b21ba8/go.mod h1:23SLY21Ag84PC0TbvVhdKoOVvrQF6nq5j5sFOW09ZBU= +github.com/influxdata/influxdb-observability/otlp v0.1.0 h1:aAG7M6OG+iR52srH7TO7+cKwqFa3E3CUdTQ5LfpfPZo= +github.com/influxdata/influxdb-observability/otlp v0.1.0/go.mod h1:dUIflut4U5fjtFcU0FUQPKvnN/eF3lR1m4Zt3PNe8cg= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/influxql v1.1.0/go.mod h1:KpVI7okXjK6PRi3Z5B+mtKZli+R1DnZgb3N+tzevNgo= github.com/influxdata/influxql v1.1.1-0.20210223160523-b6ab99450c93/go.mod h1:gHp9y86a/pxhjJ+zMjNXiQAA197Xk9wLxaz+fGG+kWk= github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e h1:/o3vQtpWJhvnIbXley4/jwzzqNeigJK9z+LZcJZ9zfM= github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE= -github.com/influxdata/line-protocol/v2 v2.0.0-20210428091617-0567a5134992 h1:bvd+v422XMzbuLvkfRSXyV9Lt/v05Zi80D//kUeS1yU= -github.com/influxdata/line-protocol/v2 v2.0.0-20210428091617-0567a5134992/go.mod h1:6+9Xt5Sq1rWx+glMgxhcg2c0DUaehK+5TDcPZ76GypY= +github.com/influxdata/line-protocol-corpus v0.0.0-20210519164801-ca6fa5da0184 h1:modYba1g1we+YJf0yGTwmohVWVAxcAch18nPg3e24OY= +github.com/influxdata/line-protocol-corpus v0.0.0-20210519164801-ca6fa5da0184/go.mod h1:03nmhxzZ7Xk2pdG+lmMd7mHDfeVOYFyhOgwO61qWU98= +github.com/influxdata/line-protocol/v2 v2.0.0-20210312151457-c52fdecb625a/go.mod h1:6+9Xt5Sq1rWx+glMgxhcg2c0DUaehK+5TDcPZ76GypY= +github.com/influxdata/line-protocol/v2 v2.0.0-20210520103755-6551a972d603 h1:ia96+xt3Z0lh8glUXFsXATBwTzU9tmTXqnVsBd5r8ME= +github.com/influxdata/line-protocol/v2 v2.0.0-20210520103755-6551a972d603/go.mod h1:QKw43hdUBg3GTk2iC3iyCxksNj7PX9aUSeYOYE/ceHY= github.com/influxdata/pkg-config v0.2.6/go.mod h1:EMS7Ll0S4qkzDk53XS3Z72/egBsPInt+BeRxb0WeSwk= github.com/influxdata/pkg-config v0.2.7/go.mod h1:EMS7Ll0S4qkzDk53XS3Z72/egBsPInt+BeRxb0WeSwk= github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8= diff --git a/receiver/influxdbreceiver/receiver.go b/receiver/influxdbreceiver/receiver.go index 3f0a13e36c26..e2c705c7ba0a 100644 --- a/receiver/influxdbreceiver/receiver.go +++ b/receiver/influxdbreceiver/receiver.go @@ -51,11 +51,7 @@ var metricsSchemata = map[string]common.MetricsSchema{ } func newMetricsReceiver(config *Config, influxLogger common.Logger, nextConsumer consumer.Metrics) (*metricsReceiver, error) { - schema, found := metricsSchemata[config.MetricsSchema] - if !found { - return nil, fmt.Errorf("schema '%s' not recognized", config.MetricsSchema) - } - converter, err := influx2otel.NewLineProtocolToOtelMetrics(influxLogger, schema) + converter, err := influx2otel.NewLineProtocolToOtelMetrics(influxLogger) if err != nil { return nil, err } @@ -194,7 +190,7 @@ func (r *metricsReceiver) handleWrite(w http.ResponseWriter, req *http.Request) } else { w.WriteHeader(http.StatusInternalServerError) } - r.logger.Debug("failed to pass metrics to next consumer: %s", err.Error()) + r.logger.Debug("failed to pass metrics to next consumer: %s", err) return } From bbd8e4b581f5b644550be1f10ce83a739dd2fe2f Mon Sep 17 00:00:00 2001 From: Jacob Marble Date: Mon, 19 Jul 2021 16:18:41 -0700 Subject: [PATCH 2/2] chore: update dependency influxdb-observability --- exporter/influxdbexporter/exporter.go | 25 +++---------------------- exporter/influxdbexporter/go.mod | 4 ++-- exporter/influxdbexporter/go.sum | 10 ++++------ go.sum | 14 ++++++-------- receiver/influxdbreceiver/go.mod | 5 ++--- receiver/influxdbreceiver/go.sum | 13 +++++-------- receiver/influxdbreceiver/receiver.go | 22 +--------------------- 7 files changed, 23 insertions(+), 70 deletions(-) diff --git a/exporter/influxdbexporter/exporter.go b/exporter/influxdbexporter/exporter.go index 31d565a78dc3..856dfb277c2b 100644 --- a/exporter/influxdbexporter/exporter.go +++ b/exporter/influxdbexporter/exporter.go @@ -22,16 +22,9 @@ import ( "github.com/influxdata/influxdb-observability/otel2influx" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer/consumererror" - "go.opentelemetry.io/collector/model/otlp" "go.opentelemetry.io/collector/model/pdata" ) -var ( - tracesMarshaler = otlp.NewProtobufTracesMarshaler() - metricsMarshaler = otlp.NewProtobufMetricsMarshaler() - logsMarshaler = otlp.NewProtobufLogsMarshaler() -) - type tracesExporter struct { logger common.Logger cfg *Config @@ -53,11 +46,7 @@ func newTracesExporter(config *Config, params component.ExporterCreateSettings) func (e *tracesExporter) pushTraces(ctx context.Context, td pdata.Traces) error { batch := e.writer.newBatch() - protoBytes, err := tracesMarshaler.MarshalTraces(td) - if err != nil { - return consumererror.Permanent(err) - } - err = e.converter.WriteTracesFromRequestBytes(ctx, protoBytes, batch) + err := e.converter.WriteTraces(ctx, td, batch) if err != nil { return consumererror.Permanent(err) } @@ -110,11 +99,7 @@ func newMetricsExporter(config *Config, params component.ExporterCreateSettings) func (e *metricsExporter) pushMetrics(ctx context.Context, md pdata.Metrics) error { batch := e.writer.newBatch() - protoBytes, err := metricsMarshaler.MarshalMetrics(md) - if err != nil { - return consumererror.Permanent(err) - } - err = e.converter.WriteMetricsFromRequestBytes(ctx, protoBytes, batch) + err := e.converter.WriteMetrics(ctx, md, batch) if err != nil { return consumererror.Permanent(err) } @@ -154,11 +139,7 @@ func newLogsExporter(config *Config, params component.ExporterCreateSettings) *l func (e *logsExporter) pushLogs(ctx context.Context, ld pdata.Logs) error { batch := e.writer.newBatch() - protoBytes, err := logsMarshaler.MarshalLogs(ld) - if err != nil { - return consumererror.Permanent(err) - } - err = e.converter.WriteLogsFromRequestBytes(ctx, protoBytes, batch) + err := e.converter.WriteLogs(ctx, ld, batch) if err != nil { return consumererror.Permanent(err) } diff --git a/exporter/influxdbexporter/go.mod b/exporter/influxdbexporter/go.mod index 3b001ad6b5c4..e384911f0f4a 100644 --- a/exporter/influxdbexporter/go.mod +++ b/exporter/influxdbexporter/go.mod @@ -3,8 +3,8 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/influx go 1.16 require ( - github.com/influxdata/influxdb-observability/common v0.1.1 - github.com/influxdata/influxdb-observability/otel2influx v0.1.1 + github.com/influxdata/influxdb-observability/common v0.2.0 + github.com/influxdata/influxdb-observability/otel2influx v0.2.0 github.com/influxdata/line-protocol/v2 v2.0.0-20210520103755-6551a972d603 github.com/stretchr/testify v1.7.0 go.opentelemetry.io/collector v0.30.2-0.20210719230137-809cae954ed3 diff --git a/exporter/influxdbexporter/go.sum b/exporter/influxdbexporter/go.sum index 1a9f38ae1566..798e4beec521 100644 --- a/exporter/influxdbexporter/go.sum +++ b/exporter/influxdbexporter/go.sum @@ -636,13 +636,11 @@ github.com/influxdata/flux v0.113.0/go.mod h1:3TJtvbm/Kwuo5/PEo5P6HUzwVg4bXWkb2w github.com/influxdata/httprouter v1.3.1-0.20191122104820-ee83e2772f69/go.mod h1:pwymjR6SrP3gD3pRj9RJwdl1j5s3doEEV8gS4X9qSzA= github.com/influxdata/influxdb v1.8.0/go.mod h1:SIzcnsjaHRFpmlxpJ4S3NT64qtEKYweNTUMb/vh0OMQ= github.com/influxdata/influxdb v1.9.2/go.mod h1:UEe3MeD9AaP5rlPIes102IhYua3FhIWZuOXNHxDjSrI= -github.com/influxdata/influxdb-observability/common v0.1.0/go.mod h1:LynmG92zQlDsATlw2q2RyVTdMcXxo7mMuT1e5+0//HU= -github.com/influxdata/influxdb-observability/common v0.1.1 h1:d/MoKoN79gJ03nxVVh4rytsL3H5XzsXfvFKuURZ2Fss= github.com/influxdata/influxdb-observability/common v0.1.1/go.mod h1:TA+gA3DRQXJ8FAhvAdeOsy9RGTdAFZBx6vFGxhbhYbI= -github.com/influxdata/influxdb-observability/otel2influx v0.1.1 h1:q/PNFBkV1ZLd0etKGtumsjm7xkfHEbYHFvqJQEz5hGw= -github.com/influxdata/influxdb-observability/otel2influx v0.1.1/go.mod h1:k1ydZuZ+pqyPXvLNmwpBOByT4gV5qe20hyVpngU7HHI= -github.com/influxdata/influxdb-observability/otlp v0.0.0-20210605003714-a868e4b21ba8/go.mod h1:23SLY21Ag84PC0TbvVhdKoOVvrQF6nq5j5sFOW09ZBU= -github.com/influxdata/influxdb-observability/otlp v0.1.0 h1:aAG7M6OG+iR52srH7TO7+cKwqFa3E3CUdTQ5LfpfPZo= +github.com/influxdata/influxdb-observability/common v0.2.0 h1:m20dvNhuUPbINVJkIvW5/3hQVIFHUYsGkN0Gj6/AG9o= +github.com/influxdata/influxdb-observability/common v0.2.0/go.mod h1:9lqc6Wv6mZKB6kD3pGTyRUEh0RC34cYG6NEwsbFxvbU= +github.com/influxdata/influxdb-observability/otel2influx v0.2.0 h1:IPaNTkiKZQZtuGpwyIQC5/KUuuOi8Bnq2g9SI6CjNRY= +github.com/influxdata/influxdb-observability/otel2influx v0.2.0/go.mod h1:PxqOsO5mxONWw2YiBGjjhG+JLICjTD8BrSRh3C1Hwdo= github.com/influxdata/influxdb-observability/otlp v0.1.0/go.mod h1:dUIflut4U5fjtFcU0FUQPKvnN/eF3lR1m4Zt3PNe8cg= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= diff --git a/go.sum b/go.sum index 69c78ea45834..45d943a7cceb 100644 --- a/go.sum +++ b/go.sum @@ -1073,15 +1073,13 @@ github.com/influxdata/httprouter v1.3.1-0.20191122104820-ee83e2772f69/go.mod h1: github.com/influxdata/influxdb v1.8.0/go.mod h1:SIzcnsjaHRFpmlxpJ4S3NT64qtEKYweNTUMb/vh0OMQ= github.com/influxdata/influxdb v1.8.4/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= github.com/influxdata/influxdb v1.9.2/go.mod h1:UEe3MeD9AaP5rlPIes102IhYua3FhIWZuOXNHxDjSrI= -github.com/influxdata/influxdb-observability/common v0.1.0/go.mod h1:LynmG92zQlDsATlw2q2RyVTdMcXxo7mMuT1e5+0//HU= -github.com/influxdata/influxdb-observability/common v0.1.1 h1:d/MoKoN79gJ03nxVVh4rytsL3H5XzsXfvFKuURZ2Fss= github.com/influxdata/influxdb-observability/common v0.1.1/go.mod h1:TA+gA3DRQXJ8FAhvAdeOsy9RGTdAFZBx6vFGxhbhYbI= -github.com/influxdata/influxdb-observability/influx2otel v0.1.1 h1:4fDDEP/QV2XdAk/jRRMOneDL3mZylgIe74UZvmeKSFk= -github.com/influxdata/influxdb-observability/influx2otel v0.1.1/go.mod h1:XtUge9BKDrSWl7lwF4ML4MZUvgzWtj/1F2f1/yR9NXw= -github.com/influxdata/influxdb-observability/otel2influx v0.1.1 h1:q/PNFBkV1ZLd0etKGtumsjm7xkfHEbYHFvqJQEz5hGw= -github.com/influxdata/influxdb-observability/otel2influx v0.1.1/go.mod h1:k1ydZuZ+pqyPXvLNmwpBOByT4gV5qe20hyVpngU7HHI= -github.com/influxdata/influxdb-observability/otlp v0.0.0-20210605003714-a868e4b21ba8/go.mod h1:23SLY21Ag84PC0TbvVhdKoOVvrQF6nq5j5sFOW09ZBU= -github.com/influxdata/influxdb-observability/otlp v0.1.0 h1:aAG7M6OG+iR52srH7TO7+cKwqFa3E3CUdTQ5LfpfPZo= +github.com/influxdata/influxdb-observability/common v0.2.0 h1:m20dvNhuUPbINVJkIvW5/3hQVIFHUYsGkN0Gj6/AG9o= +github.com/influxdata/influxdb-observability/common v0.2.0/go.mod h1:9lqc6Wv6mZKB6kD3pGTyRUEh0RC34cYG6NEwsbFxvbU= +github.com/influxdata/influxdb-observability/influx2otel v0.2.0 h1:qW1kmFiEIkBf3eT7ZFb17bxDx+bGajrL6jx0KZ1bUs8= +github.com/influxdata/influxdb-observability/influx2otel v0.2.0/go.mod h1:VlObtNUYXNqqGPWCjYwteu+/bMdO/dW0frj6G6wtHsE= +github.com/influxdata/influxdb-observability/otel2influx v0.2.0 h1:IPaNTkiKZQZtuGpwyIQC5/KUuuOi8Bnq2g9SI6CjNRY= +github.com/influxdata/influxdb-observability/otel2influx v0.2.0/go.mod h1:PxqOsO5mxONWw2YiBGjjhG+JLICjTD8BrSRh3C1Hwdo= github.com/influxdata/influxdb-observability/otlp v0.1.0/go.mod h1:dUIflut4U5fjtFcU0FUQPKvnN/eF3lR1m4Zt3PNe8cg= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= diff --git a/receiver/influxdbreceiver/go.mod b/receiver/influxdbreceiver/go.mod index f214c3cd0ceb..0dd2b0342afb 100644 --- a/receiver/influxdbreceiver/go.mod +++ b/receiver/influxdbreceiver/go.mod @@ -4,10 +4,9 @@ go 1.16 require ( github.com/gorilla/mux v1.8.0 - github.com/influxdata/influxdb-observability/common v0.1.1 - github.com/influxdata/influxdb-observability/influx2otel v0.1.1 + github.com/influxdata/influxdb-observability/common v0.2.0 + github.com/influxdata/influxdb-observability/influx2otel v0.2.0 github.com/influxdata/line-protocol/v2 v2.0.0-20210520103755-6551a972d603 go.opentelemetry.io/collector v0.30.2-0.20210719230137-809cae954ed3 - go.opentelemetry.io/collector/model v0.30.2-0.20210719230137-809cae954ed3 go.uber.org/zap v1.18.1 ) diff --git a/receiver/influxdbreceiver/go.sum b/receiver/influxdbreceiver/go.sum index 45e4db69443d..7c7062d40f84 100644 --- a/receiver/influxdbreceiver/go.sum +++ b/receiver/influxdbreceiver/go.sum @@ -632,13 +632,11 @@ github.com/influxdata/flux v0.113.0/go.mod h1:3TJtvbm/Kwuo5/PEo5P6HUzwVg4bXWkb2w github.com/influxdata/httprouter v1.3.1-0.20191122104820-ee83e2772f69/go.mod h1:pwymjR6SrP3gD3pRj9RJwdl1j5s3doEEV8gS4X9qSzA= github.com/influxdata/influxdb v1.8.0/go.mod h1:SIzcnsjaHRFpmlxpJ4S3NT64qtEKYweNTUMb/vh0OMQ= github.com/influxdata/influxdb v1.9.2/go.mod h1:UEe3MeD9AaP5rlPIes102IhYua3FhIWZuOXNHxDjSrI= -github.com/influxdata/influxdb-observability/common v0.1.0/go.mod h1:LynmG92zQlDsATlw2q2RyVTdMcXxo7mMuT1e5+0//HU= -github.com/influxdata/influxdb-observability/common v0.1.1 h1:d/MoKoN79gJ03nxVVh4rytsL3H5XzsXfvFKuURZ2Fss= github.com/influxdata/influxdb-observability/common v0.1.1/go.mod h1:TA+gA3DRQXJ8FAhvAdeOsy9RGTdAFZBx6vFGxhbhYbI= -github.com/influxdata/influxdb-observability/influx2otel v0.1.1 h1:4fDDEP/QV2XdAk/jRRMOneDL3mZylgIe74UZvmeKSFk= -github.com/influxdata/influxdb-observability/influx2otel v0.1.1/go.mod h1:XtUge9BKDrSWl7lwF4ML4MZUvgzWtj/1F2f1/yR9NXw= -github.com/influxdata/influxdb-observability/otlp v0.0.0-20210605003714-a868e4b21ba8/go.mod h1:23SLY21Ag84PC0TbvVhdKoOVvrQF6nq5j5sFOW09ZBU= -github.com/influxdata/influxdb-observability/otlp v0.1.0 h1:aAG7M6OG+iR52srH7TO7+cKwqFa3E3CUdTQ5LfpfPZo= +github.com/influxdata/influxdb-observability/common v0.2.0 h1:m20dvNhuUPbINVJkIvW5/3hQVIFHUYsGkN0Gj6/AG9o= +github.com/influxdata/influxdb-observability/common v0.2.0/go.mod h1:9lqc6Wv6mZKB6kD3pGTyRUEh0RC34cYG6NEwsbFxvbU= +github.com/influxdata/influxdb-observability/influx2otel v0.2.0 h1:qW1kmFiEIkBf3eT7ZFb17bxDx+bGajrL6jx0KZ1bUs8= +github.com/influxdata/influxdb-observability/influx2otel v0.2.0/go.mod h1:VlObtNUYXNqqGPWCjYwteu+/bMdO/dW0frj6G6wtHsE= github.com/influxdata/influxdb-observability/otlp v0.1.0/go.mod h1:dUIflut4U5fjtFcU0FUQPKvnN/eF3lR1m4Zt3PNe8cg= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= @@ -1101,9 +1099,8 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/collector v0.30.2-0.20210719230137-809cae954ed3 h1:tydyP3mQ5wyE3VODuP4YjyjI0mGkPF/HtFs++IGGOUo= go.opentelemetry.io/collector v0.30.2-0.20210719230137-809cae954ed3/go.mod h1:SBH2feGmW/GEomhJEJo9T8L6f0SghjVA/NBxqZCIL+8= +go.opentelemetry.io/collector/model v0.30.0 h1:hK/nxq5IABHnpdGHRgeRtg89BErvYcI2zxD78QFmysA= go.opentelemetry.io/collector/model v0.30.0/go.mod h1:PcHNnM+RUl0uD8VkSn93PO78N7kQYhfqpI/eki57pl4= -go.opentelemetry.io/collector/model v0.30.2-0.20210719230137-809cae954ed3 h1:UbVyz4rYL0W+Y9nrsGqdDHhn5H1WxIOTbcUH5nVcVQk= -go.opentelemetry.io/collector/model v0.30.2-0.20210719230137-809cae954ed3/go.mod h1:PcHNnM+RUl0uD8VkSn93PO78N7kQYhfqpI/eki57pl4= go.opentelemetry.io/contrib v0.21.0 h1:RMJ6GlUVzLYp/zmItxTTdAmr1gnpO/HHMFmvjAhvJQM= go.opentelemetry.io/contrib v0.21.0/go.mod h1:EH4yDYeNoaTqn/8yCWQmfNB78VHfGX2Jt2bvnvzBlGM= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.21.0/go.mod h1:Vm5u/mtkj1OMhtao0v+BGo2LUoLCgHYXvRmj0jWITlE= diff --git a/receiver/influxdbreceiver/receiver.go b/receiver/influxdbreceiver/receiver.go index e2c705c7ba0a..e1fa3285d810 100644 --- a/receiver/influxdbreceiver/receiver.go +++ b/receiver/influxdbreceiver/receiver.go @@ -29,11 +29,8 @@ import ( "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/consumererror" - "go.opentelemetry.io/collector/model/otlp" ) -var metricsUnmarshaler = otlp.NewProtobufMetricsUnmarshaler() - type metricsReceiver struct { nextConsumer consumer.Metrics httpServerSettings *confighttp.HTTPServerSettings @@ -45,11 +42,6 @@ type metricsReceiver struct { logger common.Logger } -var metricsSchemata = map[string]common.MetricsSchema{ - "telegraf-prometheus-v1": common.MetricsSchemaTelegrafPrometheusV1, - "telegraf-prometheus-v2": common.MetricsSchemaTelegrafPrometheusV2, -} - func newMetricsReceiver(config *Config, influxLogger common.Logger, nextConsumer consumer.Metrics) (*metricsReceiver, error) { converter, err := influx2otel.NewLineProtocolToOtelMetrics(influxLogger) if err != nil { @@ -172,19 +164,7 @@ func (r *metricsReceiver) handleWrite(w http.ResponseWriter, req *http.Request) } } - b, err := batch.ToProtoBytes() - if err != nil { - w.WriteHeader(http.StatusBadRequest) - _, _ = fmt.Fprintf(w, "failed to convert batch to protobuf bytes") - return - } - md, err := metricsUnmarshaler.UnmarshalMetrics(b) - if err != nil { - w.WriteHeader(http.StatusBadRequest) - _, _ = fmt.Fprintf(w, "failed to convert protobuf bytes to OTLP object") - return - } - if err = r.nextConsumer.ConsumeMetrics(req.Context(), md); err != nil { + if err := r.nextConsumer.ConsumeMetrics(req.Context(), batch.GetMetrics()); err != nil { if consumererror.IsPermanent(err) { w.WriteHeader(http.StatusBadRequest) } else {