Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix][spm]: Change default metrics namespace to match new default in spanmetricsconnector #6007

Merged
merged 13 commits into from
Sep 22, 2024
Merged
3 changes: 1 addition & 2 deletions docker-compose/monitor/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ services:
- METRICS_STORAGE_TYPE=prometheus
- PROMETHEUS_SERVER_URL=http://prometheus:9090
- PROMETHEUS_QUERY_SUPPORT_SPANMETRICS_CONNECTOR=${PROMETHEUS_QUERY_SUPPORT_SPANMETRICS_CONNECTOR:-true}
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
- PROMETHEUS_QUERY_NAMESPACE=${PROMETHEUS_QUERY_NAMESPACE:-}
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
- PROMETHEUS_QUERY_DURATION_UNIT=${PROMETHEUS_QUERY_DURATION_UNIT:-}
- PROMETHEUS_QUERY_NORMALIZE_CALLS=true
- PROMETHEUS_QUERY_NORMALIZE_DURATION=true
Expand All @@ -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:latest
volumes:
- ${OTEL_CONFIG_SRC:-./otel-collector-config-connector.yml}:/etc/otelcol/otel-collector-config.yml
command: --config /etc/otelcol/otel-collector-config.yml
Expand Down
11 changes: 8 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
20 changes: 12 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand All @@ -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=
Expand Down
2 changes: 1 addition & 1 deletion plugin/metrics/prometheus/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion plugin/metrics/prometheus/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const (
defaultTokenFilePath = ""

defaultSupportSpanmetricsConnector = true
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
defaultMetricNamespace = ""
defaultMetricNamespace = "traces_span_metrics"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yurishkuro setting this default here seems to take care of the v2 test but the v1 test is still getting an empty response. do you have any idea why that could be? both v1 and v2 read this config.

Copy link
Contributor Author

@mahadzaryab1 mahadzaryab1 Sep 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was actually not related to the changes in this PR and was failing due to missing http receiver endpoint in the otel collector config but wasn't failing before because the version was pinned to 0.89.0

defaultLatencyUnit = "ms"
defaultNormalizeCalls = false
defaultNormalizeDuration = false
Expand Down
Loading