diff --git a/docker-compose/monitor/docker-compose.yml b/docker-compose/monitor/docker-compose.yml index ac6b03b620b..983e3c2e68b 100644 --- a/docker-compose/monitor/docker-compose.yml +++ b/docker-compose/monitor/docker-compose.yml @@ -9,7 +9,6 @@ services: environment: - METRICS_STORAGE_TYPE=prometheus - PROMETHEUS_SERVER_URL=http://prometheus:9090 - - PROMETHEUS_QUERY_SUPPORT_SPANMETRICS_CONNECTOR=${PROMETHEUS_QUERY_SUPPORT_SPANMETRICS_CONNECTOR:-true} - PROMETHEUS_QUERY_NAMESPACE=${PROMETHEUS_QUERY_NAMESPACE:-} - PROMETHEUS_QUERY_DURATION_UNIT=${PROMETHEUS_QUERY_DURATION_UNIT:-} - PROMETHEUS_QUERY_NORMALIZE_CALLS=true @@ -22,7 +21,7 @@ services: backend: # This is the host name used in Prometheus scrape configuration. aliases: [spm_metrics_source] - image: otel/opentelemetry-collector-contrib:${OTEL_IMAGE_TAG:-0.89.0} + image: otel/opentelemetry-collector-contrib:${OTEL_IMAGE_TAG:-0.109.0} volumes: - ${OTEL_CONFIG_SRC:-./otel-collector-config-connector.yml}:/etc/otelcol/otel-collector-config.yml command: --config /etc/otelcol/otel-collector-config.yml diff --git a/docker-compose/monitor/otel-collector-config-connector.yml b/docker-compose/monitor/otel-collector-config-connector.yml index 72d577d4321..8a3bed4521e 100644 --- a/docker-compose/monitor/otel-collector-config-connector.yml +++ b/docker-compose/monitor/otel-collector-config-connector.yml @@ -3,6 +3,7 @@ receivers: protocols: grpc: http: + endpoint: "0.0.0.0:4318" exporters: prometheus: diff --git a/go.mod b/go.mod index 54f2ee6c7e5..6072dfb9211 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 github.com/kr/pretty v0.3.1 github.com/olivere/elastic v6.2.37+incompatible - github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.108.0 + github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.109.0 github.com/open-telemetry/opentelemetry-collector-contrib/exporter/kafkaexporter v0.108.0 github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter v0.108.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckv2extension v0.108.0 @@ -96,6 +96,11 @@ require ( gopkg.in/yaml.v3 v3.0.1 ) +require ( + github.com/elastic/lunes v0.1.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.109.0 // indirect +) + require ( github.com/IBM/sarama v1.43.3 // indirect github.com/alecthomas/participle/v2 v2.1.1 // indirect @@ -162,12 +167,12 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/onsi/ginkgo v1.16.5 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.108.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.108.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.109.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.108.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/kafka v0.108.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal v0.108.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.108.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.108.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.109.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.108.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/azure v0.108.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.108.0 // indirect diff --git a/go.sum b/go.sum index fd342f973e7..571ae52af6c 100644 --- a/go.sum +++ b/go.sum @@ -112,6 +112,8 @@ github.com/elastic/go-elasticsearch/v8 v8.15.0 h1:IZyJhe7t7WI3NEFdcHnf6IJXqpRf+8 github.com/elastic/go-elasticsearch/v8 v8.15.0/go.mod h1:HCON3zj4btpqs2N1jjsAy4a/fiAul+YBP00mBH4xik8= github.com/elastic/go-grok v0.3.1 h1:WEhUxe2KrwycMnlvMimJXvzRa7DoByJB4PVUIE1ZD/U= github.com/elastic/go-grok v0.3.1/go.mod h1:n38ls8ZgOboZRgKcjMY8eFeZFMmcL9n2lP0iHhIDk64= +github.com/elastic/lunes v0.1.0 h1:amRtLPjwkWtzDF/RKzcEPMvSsSseLDLW+bnhfNSLRe4= +github.com/elastic/lunes v0.1.0/go.mod h1:xGphYIt3XdZRtyWosHQTErsQTd4OP1p9wsbVoHelrd4= github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -394,8 +396,8 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= -github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.108.0 h1:K50wU48oObjZPAJI5H5o5Awe3bvCV26Oj1+4fU++wtY= -github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.108.0/go.mod h1:YF2SGiBXD6gcG2ZURhthEfSeYsKNGYqxONp2hr7b0ss= +github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.109.0 h1:d/eNSZeGwocYCxTGUT05xExxg2FdGtNylPeU/MbmFPE= +github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.109.0/go.mod h1:AHXtu7UsgawW1p5N7h46yImYhAco4wzCUlAJcdkxvI4= github.com/open-telemetry/opentelemetry-collector-contrib/exporter/kafkaexporter v0.108.0 h1:42coTKWVcCQV3sbfdfebi+Js0+XorXgBOTJItiKAy+s= github.com/open-telemetry/opentelemetry-collector-contrib/exporter/kafkaexporter v0.108.0/go.mod h1:krFix2JnTlapRQkaSEs9g9oVCSrIRIy5/7hrUluJaHE= github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter v0.108.0 h1:UM6fhqbCQra8SGfdAiR21toB4Kcvnds4aqj9Yi9kwWQ= @@ -406,20 +408,22 @@ github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.1 github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.108.0/go.mod h1:uCn10h/QlirtEIPyEkEYLuf6IorSabZ4JTp1+dFUip0= github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.108.0 h1:NCY/JZmljwOjtWOcWqZWz7sOEHgPcW+JNORNPcIBSjg= github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.108.0/go.mod h1:osDf+vagg+N6yH5HBZNnDxCMA0oiMg/C3wVckFe/QHo= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.108.0 h1:+VLLHBSbtEiLMtSi8ESWM4PPDs/H6XKf0RHWWIX8RjE= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.108.0/go.mod h1:L4KHT5M01zjg0wYmNSX2VArC088vccVa7p4XBrcb48g= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.109.0 h1:4VBRgtyh3hHSgAVGgs4bvNwJd0oUGyxVA3eQO2ujNsA= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.109.0/go.mod h1:9MGQCqxdCNBhdD+7QBZ6hH9HipXe5CajMafVKglD5f0= github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.108.0 h1:DGQwT+PdalEB/LYiE36r/XnFTaU3h+z8cR2LfS3qxm0= github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.108.0/go.mod h1:pPQV7fCCb3HOo70YMUnnhN3d+0toR23W+eqvOQckpuM= github.com/open-telemetry/opentelemetry-collector-contrib/internal/kafka v0.108.0 h1:ZABQPbay+ilVHJbbmpuHmtIJBFCbGfMNdkAP7zNXb04= github.com/open-telemetry/opentelemetry-collector-contrib/internal/kafka v0.108.0/go.mod h1:CQyrhcehFnuGRSYQtqrLT1V9mstkN66SSIEDzHuIcLA= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.109.0 h1:A2YjC0zAh4oe8rBV94hUCwq0NEWA6TsVkKnwMa5TF10= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.109.0/go.mod h1:Qz5ugyCxgcAiGjvp6UkJqMVtco6+d8VXj/6J6U7JVlo= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal v0.108.0 h1:7EKRVuc8GRrAfde2/fh+CFMsJQAQGICg686sRyIk3QI= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal v0.108.0/go.mod h1:+ghcpLt2BBbqOm+vv6CeSXK/aLHB4cXiLdsfFNZXeqg= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.108.0 h1:WUV7wEVjjEgp8TRcQquQj/2NfRY84Vch43+zG/Pizqk= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.108.0/go.mod h1:9mkPZ5pz6HktjWtUdqRmqAsP7VzP/gpIwQ8z/h2YXAU= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.108.0 h1:so+V3rT18oyHJmPs5lBNBLlU8tnHU9h/tkA3Q7q8m7c= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.108.0/go.mod h1:G+N43ID1sP2CnffxkYdMyuJpep2UcGQUyq4HiAmcYSw= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.108.0 h1:vU6a7EKHBu80err/1SCn+8fLpSCdR1PoSzdyydXDcjQ= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.108.0/go.mod h1:dHSW1ec9ZHZ/92+NoLEJd5UaL4tRVmnn+DvEQqdJ7f0= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.109.0 h1:Mi0qKcH4VjyyZsbaWYG038drk5FCFL7igVM8abEL4ZY= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.109.0/go.mod h1:KvJWxR0bDk9Qh0ktw4gOFsd/ZrJ7p5KTAQueEJsaK9Q= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.109.0 h1:3kXFgdEEKw37ftdRC7SmXAiZuLahVavqOYRhlJVMLc8= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.109.0/go.mod h1:HtaWI5WJKJkBhHz2R7Xb2n7R3fdBPhfKieYcQajNCTo= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.108.0 h1:LtTLGiv057JhM621FUr+dZ+hlgkTqC7kq/9MbaUAKoM= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.108.0/go.mod h1:uCAM9cEmQ5bQtzMvbkW/MhjSrB3j7vGzQMwhJdfRuNY= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/azure v0.108.0 h1:+QJK3dwdX3LOwbagbWDkgoK/47fUmBcLCjxqXjHjc3o= diff --git a/plugin/metrics/prometheus/factory_test.go b/plugin/metrics/prometheus/factory_test.go index 2c3085ba44c..8662badb54a 100644 --- a/plugin/metrics/prometheus/factory_test.go +++ b/plugin/metrics/prometheus/factory_test.go @@ -42,7 +42,7 @@ func TestWithDefaultConfiguration(t *testing.T) { assert.Equal(t, "http://localhost:9090", f.options.ServerURL) assert.Equal(t, 30*time.Second, f.options.ConnectTimeout) - assert.Empty(t, f.options.MetricNamespace) + assert.Equal(t, "traces_span_metrics", f.options.MetricNamespace) assert.Equal(t, "ms", f.options.LatencyUnit) } diff --git a/plugin/metrics/prometheus/options.go b/plugin/metrics/prometheus/options.go index ecaaa977a58..ad259a0b196 100644 --- a/plugin/metrics/prometheus/options.go +++ b/plugin/metrics/prometheus/options.go @@ -32,11 +32,11 @@ const ( defaultConnectTimeout = 30 * time.Second defaultTokenFilePath = "" - defaultSupportSpanmetricsConnector = true - defaultMetricNamespace = "" - defaultLatencyUnit = "ms" - defaultNormalizeCalls = false - defaultNormalizeDuration = false + // the default configuration here matches the default namespace in the span metrics connector + defaultMetricNamespace = "traces_span_metrics" + defaultLatencyUnit = "ms" + defaultNormalizeCalls = false + defaultNormalizeDuration = false ) // Options stores the configuration entries for this storage.