diff --git a/NOTICE.txt b/NOTICE.txt index a91419463b5..691566bd384 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -288,11 +288,11 @@ SOFTWARE. -------------------------------------------------------------------------------- Dependency : github.com/elastic/apm-data -Version: v0.1.1-0.20230309014206-3ad1a5caedc9 +Version: v0.1.1-0.20230511095520-caaa44e1c286 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/elastic/apm-data@v0.1.1-0.20230309014206-3ad1a5caedc9/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/elastic/apm-data@v0.1.1-0.20230511095520-caaa44e1c286/LICENSE: Apache License Version 2.0, January 2004 @@ -5963,11 +5963,11 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector@v0.6 -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/pdata -Version: v0.63.1 +Version: v1.0.0-rcv0011 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/pdata@v0.63.1/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/pdata@v1.0.0-rcv0011/LICENSE: Apache License @@ -6380,11 +6380,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- Dependency : google.golang.org/grpc -Version: v1.53.0 +Version: v1.54.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/google.golang.org/grpc@v1.53.0/LICENSE: +Contents of probable licence file $GOMODCACHE/google.golang.org/grpc@v1.54.0/LICENSE: Apache License @@ -14544,11 +14544,11 @@ Contents of probable licence file $GOMODCACHE/go.elastic.co/ecszap@v1.0.1/LICENS -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/semconv -Version: v0.63.1 +Version: v0.76.1 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/semconv@v0.63.1/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/semconv@v0.76.1/LICENSE: Apache License diff --git a/changelogs/head.asciidoc b/changelogs/head.asciidoc index 96f619f6196..f632fb35643 100644 --- a/changelogs/head.asciidoc +++ b/changelogs/head.asciidoc @@ -14,7 +14,8 @@ https://github.com/elastic/apm-server/compare/8.8\...main[View commits] [float] ==== Intake API Changes +- Span events now default to having a representative count of 1, if no `sample_rate` field is sent by the agent {pull}10792[10792] [float] ==== Added -- Span events now carry `host` and `service.version` attributes. {pull}10697[10697] \ No newline at end of file +- Span events now carry `host` and `service.version` attributes. {pull}10697[10697] diff --git a/go.mod b/go.mod index 74c11bc6cd8..67ceebf81fd 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 github.com/dgraph-io/badger/v2 v2.2007.3-0.20201012072640-f5a7e0a1c83b github.com/dustin/go-humanize v1.0.1 - github.com/elastic/apm-data v0.1.1-0.20230309014206-3ad1a5caedc9 + github.com/elastic/apm-data v0.1.1-0.20230511095520-caaa44e1c286 github.com/elastic/beats/v7 v7.0.0-alpha2.0.20230512130148-b4411de255fa github.com/elastic/elastic-agent-client/v7 v7.1.1 github.com/elastic/elastic-agent-libs v0.3.8 @@ -49,14 +49,14 @@ require ( go.elastic.co/apm/v2 v2.4.1 go.elastic.co/fastjson v1.1.0 go.opentelemetry.io/collector v0.63.1 - go.opentelemetry.io/collector/pdata v0.63.1 + go.opentelemetry.io/collector/pdata v1.0.0-rcv0011 go.uber.org/automaxprocs v1.5.1 go.uber.org/zap v1.24.0 golang.org/x/net v0.10.0 golang.org/x/sync v0.1.0 golang.org/x/term v0.8.0 golang.org/x/time v0.3.0 - google.golang.org/grpc v1.53.0 + google.golang.org/grpc v1.54.0 google.golang.org/protobuf v1.30.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -135,7 +135,7 @@ require ( github.com/yusufpapurcu/wmi v1.2.2 // indirect go.elastic.co/apm/module/apmzap/v2 v2.2.0 // indirect go.elastic.co/ecszap v1.0.1 // indirect - go.opentelemetry.io/collector/semconv v0.63.1 // indirect + go.opentelemetry.io/collector/semconv v0.76.1 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.9.0 // indirect diff --git a/go.sum b/go.sum index 1902e405858..39de4480c17 100644 --- a/go.sum +++ b/go.sum @@ -370,8 +370,8 @@ github.com/eapache/go-xerial-snappy v0.0.0-20230111030713-bf00bc1b83b6/go.mod h1 github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/eclipse/paho.mqtt.golang v1.3.5 h1:sWtmgNxYM9P2sP+xEItMozsR3w0cqZFlqnNN1bdl41Y= -github.com/elastic/apm-data v0.1.1-0.20230309014206-3ad1a5caedc9 h1:nj0nBnU3hI/h3s4+6CnyOTcQqwH7U6y/2i1XM44wOaU= -github.com/elastic/apm-data v0.1.1-0.20230309014206-3ad1a5caedc9/go.mod h1:8oEk/myQSw+GHqxPD3e8Oz2qPMawcOH+t9HYZ51p+rE= +github.com/elastic/apm-data v0.1.1-0.20230511095520-caaa44e1c286 h1:2SoliozFfpyREEl8D7sT5stInZBUygXn+2P1KXUYSvA= +github.com/elastic/apm-data v0.1.1-0.20230511095520-caaa44e1c286/go.mod h1:0c39ujqEzuWaGzKqgbGSutGL6ZTyj8yRc9dnkxv7Lrg= github.com/elastic/bayeux v1.0.5 h1:UceFq01ipmT3S8DzFK+uVAkbCdiPR0Bqei8qIGmUeY0= github.com/elastic/beats/v7 v7.0.0-alpha2.0.20230512130148-b4411de255fa h1:qLpi9ivKE5EsGbonqUm80IBvuEsWgn8k9tSjpf1xdHg= github.com/elastic/beats/v7 v7.0.0-alpha2.0.20230512130148-b4411de255fa/go.mod h1:I9e+q0rqGsXmczIsYTVH8uMJCRYr8GcgmaE/kDocVVI= @@ -612,7 +612,7 @@ github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5O github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E= +github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= @@ -942,10 +942,11 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opentelemetry.io/collector v0.63.1 h1:hXhoo0VCn2NP1uKqrY1BnZYr87AoIgW9lB5TcCJwTQg= go.opentelemetry.io/collector v0.63.1/go.mod h1:FZC9Px2N5CRiOG1VWH4XvkDeFx+Bu5tO8+gaqDSfXAA= -go.opentelemetry.io/collector/pdata v0.63.1 h1:g+xdmIjGwZAQFq1+bFF2khcsyRmnECILI0ZjwqMQ04Q= -go.opentelemetry.io/collector/pdata v0.63.1/go.mod h1:IzvXUGQml2mrnvdb8zIlEW3qQs9oFLdD2hLwJdZ+pek= -go.opentelemetry.io/collector/semconv v0.63.1 h1:o9Zz/vwqT85XXYf9XTIXa0qkmfEY8b/JMm4lXf+dwpc= -go.opentelemetry.io/collector/semconv v0.63.1/go.mod h1:5o9yhOa+ABt7g2E5JABDxGZ1PQPbtfxrKNbYn+LOTXU= +go.opentelemetry.io/collector/consumer v0.76.1 h1:+bSz3oATwrQD3Uu8drSyGqrp3OsFo+PS2BguRgiwTuY= +go.opentelemetry.io/collector/pdata v1.0.0-rcv0011 h1:7lT0vseP89mHtUpvgmWYRvQZ0eY+SHbVsnXY20xkoMg= +go.opentelemetry.io/collector/pdata v1.0.0-rcv0011/go.mod h1:9vrXSQBeMRrdfGt9oMgYweqERJ8adaiQjN6LSbqRMMA= +go.opentelemetry.io/collector/semconv v0.76.1 h1:cY5z4uXLB15AuU7GkJFfFCTD82l83fqK7DBRqQ7sZCY= +go.opentelemetry.io/collector/semconv v0.76.1/go.mod h1:eRAIvw3omXfvZxt1GAt9o4R/NFGSruOVkZ6JiJwPo6U= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.40.0 h1:5jD3teb4Qh7mx/nfzq4jO2WFFpvXD0vYWFDrdvNWmXk= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.4 h1:aUEBEdCa6iamGzg6fuYxDA8ThxvOG240mAvWDU+XLio= go.opentelemetry.io/contrib/propagators/b3 v1.11.1 h1:icQ6ttRV+r/2fnU46BIo/g/mPu6Rs5Ug8Rtohe3KqzI= @@ -1280,8 +1281,8 @@ google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc= -google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= +google.golang.org/grpc v1.54.0 h1:EhTqbhiYeixwWQtAEZAxmV9MGqcjEU2mFx52xCzNyag= +google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= google.golang.org/grpc/examples v0.0.0-20201010204749-3c400e7fcc87 h1:JA56ipSuANY2Fwx4OITOAj+QXlHyCJEma6VVWTRBG+k= google.golang.org/grpc/examples v0.0.0-20201010204749-3c400e7fcc87/go.mod h1:Lh55/1hxmVHEkOvSIQ2uj0P12QyOCUNyRwnUlSS13hw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= diff --git a/internal/beater/beater.go b/internal/beater/beater.go index 40ec1e706c4..0c1b71f2ac3 100644 --- a/internal/beater/beater.go +++ b/internal/beater/beater.go @@ -402,7 +402,6 @@ func (s *Runner) Run(ctx context.Context) error { modelprocessor.NewDropUnsampled(false /* don't drop RUM unsampled transactions*/, func(i int64) { transactionsDroppedCounter.Add(i) }), - modelprocessor.DroppedSpansStatsDiscarder{}, finalBatchProcessor, } diff --git a/internal/beater/otlp/grpc.go b/internal/beater/otlp/grpc.go index 1b4fdcc83fc..c828093a7d5 100644 --- a/internal/beater/otlp/grpc.go +++ b/internal/beater/otlp/grpc.go @@ -77,16 +77,17 @@ func RegisterGRPCServices( }) gRPCMonitoredConsumer.set(consumer) - ptraceotlp.RegisterGRPCServer(grpcServer, tracesService{consumer}) - pmetricotlp.RegisterGRPCServer(grpcServer, metricsService{consumer}) - plogotlp.RegisterGRPCServer(grpcServer, logsService{consumer}) + ptraceotlp.RegisterGRPCServer(grpcServer, &tracesService{consumer: consumer}) + pmetricotlp.RegisterGRPCServer(grpcServer, &metricsService{consumer: consumer}) + plogotlp.RegisterGRPCServer(grpcServer, &logsService{consumer: consumer}) } type tracesService struct { + ptraceotlp.UnimplementedGRPCServer consumer *otlp.Consumer } -func (s tracesService) Export(ctx context.Context, req ptraceotlp.ExportRequest) (ptraceotlp.ExportResponse, error) { +func (s *tracesService) Export(ctx context.Context, req ptraceotlp.ExportRequest) (ptraceotlp.ExportResponse, error) { td := req.Traces() if td.SpanCount() == 0 { return ptraceotlp.NewExportResponse(), nil @@ -96,10 +97,11 @@ func (s tracesService) Export(ctx context.Context, req ptraceotlp.ExportRequest) } type metricsService struct { + pmetricotlp.UnimplementedGRPCServer consumer *otlp.Consumer } -func (s metricsService) Export(ctx context.Context, req pmetricotlp.ExportRequest) (pmetricotlp.ExportResponse, error) { +func (s *metricsService) Export(ctx context.Context, req pmetricotlp.ExportRequest) (pmetricotlp.ExportResponse, error) { md := req.Metrics() if md.DataPointCount() == 0 { return pmetricotlp.NewExportResponse(), nil @@ -109,10 +111,11 @@ func (s metricsService) Export(ctx context.Context, req pmetricotlp.ExportReques } type logsService struct { + plogotlp.UnimplementedGRPCServer consumer *otlp.Consumer } -func (s logsService) Export(ctx context.Context, req plogotlp.ExportRequest) (plogotlp.ExportResponse, error) { +func (s *logsService) Export(ctx context.Context, req plogotlp.ExportRequest) (plogotlp.ExportResponse, error) { ld := req.Logs() if ld.LogRecordCount() == 0 { return plogotlp.NewExportResponse(), nil diff --git a/systemtest/approvals/TestCompressedSpans.approved.json b/systemtest/approvals/TestCompressedSpans.approved.json index 20ac3ec69cc..df762454ab0 100644 --- a/systemtest/approvals/TestCompressedSpans.approved.json +++ b/systemtest/approvals/TestCompressedSpans.approved.json @@ -63,6 +63,7 @@ }, "id": "0000000000000002", "name": "Calls to redis", + "representative_count": 1, "subtype": "redis", "type": "db" }, @@ -139,6 +140,7 @@ }, "id": "0000000000000034", "name": "_bulk", + "representative_count": 1, "subtype": "elasticsearch", "type": "db" }, diff --git a/systemtest/approvals/TestIntake/Events.approved.json b/systemtest/approvals/TestIntake/Events.approved.json index a2581baa828..fd7ac1b3fd6 100644 --- a/systemtest/approvals/TestIntake/Events.approved.json +++ b/systemtest/approvals/TestIntake/Events.approved.json @@ -486,6 +486,7 @@ }, "id": "1234567890aaaade", "name": "GET users-authenticated", + "representative_count": 1, "stacktrace": [ { "exclude_from_grouping": false, diff --git a/systemtest/approvals/TestIntake/MinimalEvents.approved.json b/systemtest/approvals/TestIntake/MinimalEvents.approved.json index 137cc3d15e0..c260aedbf35 100644 --- a/systemtest/approvals/TestIntake/MinimalEvents.approved.json +++ b/systemtest/approvals/TestIntake/MinimalEvents.approved.json @@ -210,6 +210,7 @@ }, "id": "0123456a89012345", "name": "GET /api/types", + "representative_count": 1, "type": "request" }, "timestamp": { @@ -259,6 +260,7 @@ }, "id": "0123456a89012345", "name": "GET /api/types", + "representative_count": 1, "type": "request" }, "timestamp": { diff --git a/systemtest/approvals/TestIntake/Spans.approved.json b/systemtest/approvals/TestIntake/Spans.approved.json index 0c1d9b01e41..89bc388555a 100644 --- a/systemtest/approvals/TestIntake/Spans.approved.json +++ b/systemtest/approvals/TestIntake/Spans.approved.json @@ -114,6 +114,7 @@ }, "id": "1234567890aaaade", "name": "SELECT FROM product_types", + "representative_count": 1, "stacktrace": [ { "classname": "Core.js", @@ -253,6 +254,7 @@ }, "id": "abcde56a89012345", "name": "get /api/types", + "representative_count": 1, "subtype": "http", "sync": false, "type": "request" @@ -344,6 +346,7 @@ }, "id": "0123456a89012345", "name": "GET /api/types", + "representative_count": 1, "subtype": "http", "type": "request" }, @@ -432,6 +435,7 @@ }, "id": "1234abcdef567895", "name": "GET /api/types", + "representative_count": 1, "type": "request" }, "timestamp": { @@ -528,6 +532,7 @@ }, "id": "abcdef01234567", "name": "SELECT FROM p_details", + "representative_count": 1, "subtype": "postgresql", "type": "db" }, @@ -655,6 +660,7 @@ }, "id": "fdc4567890aaaade", "name": "SELECT FROM product_types", + "representative_count": 1, "stacktrace": [ { "classname": "Core.js", @@ -807,6 +813,7 @@ "routing_key": "user-created-span" }, "name": "Rabbitmq receive", + "representative_count": 1, "subtype": "JMS", "type": "messaging" }, @@ -902,6 +909,7 @@ }, "id": "abcdef01234567", "name": "GET /api/types", + "representative_count": 1, "subtype": "postgresql", "type": "db" }, @@ -1008,6 +1016,7 @@ }, "id": "ljf4567890aaaade", "name": "Request", + "representative_count": 1, "subtype": "http", "type": "external" }, @@ -1135,6 +1144,7 @@ }, "id": "ute4567890aaaade", "name": "SELECT FROM product_types", + "representative_count": 1, "stacktrace": [ { "classname": "Core.js", diff --git a/systemtest/approvals/TestIntake/Transactions.approved.json b/systemtest/approvals/TestIntake/Transactions.approved.json index ea1a72a29de..b55c33cc2b9 100644 --- a/systemtest/approvals/TestIntake/Transactions.approved.json +++ b/systemtest/approvals/TestIntake/Transactions.approved.json @@ -594,7 +594,8 @@ "http": { "request": { "method": "POST" - } + }, + "response": {} }, "kubernetes": { "namespace": "namespace1", @@ -718,10 +719,14 @@ "type": "machine_type" }, "origin": { - "account.id": "abc123", + "account": { + "id": "abc123" + }, "provider": "aws", "region": "us-east-1", - "service.name": "serviceName" + "service": { + "name": "serviceName" + } }, "project": { "id": "project_id", @@ -748,8 +753,10 @@ "coldstart": false, "execution": "2e13b309-23e1-417f-8bf7-074fc96bc683", "name": "faasName", - "trigger.request_id": "FuH2Cir_vHcEMUA=", - "trigger.type": "http", + "trigger": { + "request_id": "FuH2Cir_vHcEMUA=", + "type": "http" + }, "version": "1.0.0" }, "host": { diff --git a/systemtest/approvals/TestIntake/UnknownSpanType.approved.json b/systemtest/approvals/TestIntake/UnknownSpanType.approved.json index 3ee156475d6..81300cc5dcd 100644 --- a/systemtest/approvals/TestIntake/UnknownSpanType.approved.json +++ b/systemtest/approvals/TestIntake/UnknownSpanType.approved.json @@ -66,6 +66,7 @@ }, "id": "0aaaaaaaaaaaaaaa", "name": "SELECT FROM product_types", + "representative_count": 1, "stacktrace": [ { "abs_path": "net.js", diff --git a/systemtest/approvals/TestNoMatchingSourcemap.approved.json b/systemtest/approvals/TestNoMatchingSourcemap.approved.json index 9e0217a1de0..3cf95e4bfec 100644 --- a/systemtest/approvals/TestNoMatchingSourcemap.approved.json +++ b/systemtest/approvals/TestNoMatchingSourcemap.approved.json @@ -42,6 +42,7 @@ }, "id": "aaaaaaaaaaaaaaaa", "name": "transaction", + "representative_count": 1, "stacktrace": [ { "abs_path": "http://subdomain1.localhost:8000/test/e2e/general-usecase/bundle.js.map", diff --git a/systemtest/approvals/TestRUMSpanSourcemapping.approved.json b/systemtest/approvals/TestRUMSpanSourcemapping.approved.json index 6e898dadb8f..dbe1b5a07f4 100644 --- a/systemtest/approvals/TestRUMSpanSourcemapping.approved.json +++ b/systemtest/approvals/TestRUMSpanSourcemapping.approved.json @@ -42,6 +42,7 @@ }, "id": "aaaaaaaaaaaaaaaa", "name": "transaction", + "representative_count": 1, "stacktrace": [ { "abs_path": "http://subdomain1.localhost:8000/test/e2e/general-usecase/bundle.js.map",