From 7586b3ccf9ebff4515dcc14589c6a0467c878b9e Mon Sep 17 00:00:00 2001 From: Szilard Parrag Date: Fri, 10 May 2024 15:11:47 +0200 Subject: [PATCH 1/5] Merge pull request #1 from axoflow/v0.98.0-bytes feat(pkg/stanza): add bytes metrics --- pkg/stanza/adapter/factory.go | 2 + pkg/stanza/adapter/receiver.go | 5 +- pkg/stanza/go.mod | 4 ++ pkg/stanza/go.sum | 94 +++++++++++++++------------------ receiver/filelogreceiver/go.mod | 6 ++- receiver/filelogreceiver/go.sum | 86 ++++++++++++++---------------- 6 files changed, 98 insertions(+), 99 deletions(-) diff --git a/pkg/stanza/adapter/factory.go b/pkg/stanza/adapter/factory.go index 2f42a1480bb6..4ee59887c53c 100644 --- a/pkg/stanza/adapter/factory.go +++ b/pkg/stanza/adapter/factory.go @@ -8,6 +8,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/pdata/plog" rcvr "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receiverhelper" @@ -83,6 +84,7 @@ func createLogsReceiver(logReceiverType LogReceiverType) rcvr.CreateLogsFunc { converter: converter, obsrecv: obsrecv, storageID: baseCfg.StorageID, + sizer: &plog.ProtoMarshaler{}, }, nil } } diff --git a/pkg/stanza/adapter/receiver.go b/pkg/stanza/adapter/receiver.go index 61124e3bf3c7..4ad236a02722 100644 --- a/pkg/stanza/adapter/receiver.go +++ b/pkg/stanza/adapter/receiver.go @@ -11,6 +11,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/extension/experimental/storage" + "go.opentelemetry.io/collector/pdata/plog" rcvr "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receiverhelper" "go.uber.org/multierr" @@ -35,6 +36,7 @@ type receiver struct { storageID *component.ID storageClient storage.Client + sizer plog.Sizer } // Ensure this receiver adheres to required interface @@ -106,12 +108,13 @@ func (r *receiver) consumerLoop(ctx context.Context) { for pLogs := range r.converter.OutChannel() { obsrecvCtx := r.obsrecv.StartLogsOp(ctx) logRecordCount := pLogs.LogRecordCount() + logRecordsSize := r.sizer.LogsSize(pLogs) cErr := r.consumer.ConsumeLogs(ctx, pLogs) if cErr != nil { r.set.Logger.Error("ConsumeLogs() failed", zap.Error(cErr)) } - r.obsrecv.EndLogsOp(obsrecvCtx, "stanza", logRecordCount, cErr) + r.obsrecv.EndLogsOp(obsrecvCtx, "stanza", logRecordCount, logRecordsSize, cErr) } r.set.Logger.Debug("Consumer loop stopped") diff --git a/pkg/stanza/go.mod b/pkg/stanza/go.mod index 6d99409c56d4..5d4af48931a3 100644 --- a/pkg/stanza/go.mod +++ b/pkg/stanza/go.mod @@ -98,3 +98,7 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../pdatatest replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../golden + +replace go.opentelemetry.io/collector/pdata => github.com/axoflow/opentelemetry-collector/pdata v0.104.0-dev1 + +replace go.opentelemetry.io/collector/receiver => github.com/axoflow/opentelemetry-collector/receiver v0.104.0-dev1 diff --git a/pkg/stanza/go.sum b/pkg/stanza/go.sum index ab4cb221eb94..08659e4a4a47 100644 --- a/pkg/stanza/go.sum +++ b/pkg/stanza/go.sum @@ -1,5 +1,11 @@ -github.com/bmatcuk/doublestar/v4 v4.7.1 h1:fdDeAqgT47acgwd9bd9HxJRDmc9UAmPpc+2m0CXv75Q= -github.com/bmatcuk/doublestar/v4 v4.7.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= +github.com/axoflow/opentelemetry-collector/pdata v0.104.0-dev1 h1:Mc7o/oUGoCUdwOlKXcQEYlfS7JIoYfaWeJAyC3Sqn34= +github.com/axoflow/opentelemetry-collector/pdata v0.104.0-dev1/go.mod h1:IHxHsp+Jq/xfjORQMDJjSH6jvedOSTOyu3nbxqhWSYE= +github.com/axoflow/opentelemetry-collector/receiver v0.104.0-dev1 h1:KTuUFrm8Sps8HxBYkzHaPa1FCAacFMV6V7p5wnqWSMU= +github.com/axoflow/opentelemetry-collector/receiver v0.104.0-dev1/go.mod h1:NM06euqrApTpzietV7cCPAwP8k4PyKlPBfSr3tqlMz4= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I= +github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= @@ -79,54 +85,42 @@ github.com/valyala/fastjson v1.6.4 h1:uAUNq9Z6ymTgGhcm0UynUAB6tlbakBrz6CQFax3BXV github.com/valyala/fastjson v1.6.4/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opentelemetry.io/collector/component v0.112.0 h1:Hw125Tdb427yKkzFx3U/OsfPATYXsbURkc27dn19he8= -go.opentelemetry.io/collector/component v0.112.0/go.mod h1:hV9PEgkNlVAySX+Oo/g7+NcLe234L04kRXw6uGj3VEw= -go.opentelemetry.io/collector/config/configopaque v1.18.0 h1:aoEecgd5m8iZCX+S+iH6SK/lG6ULqCqtrtz7PeHw7vE= -go.opentelemetry.io/collector/config/configopaque v1.18.0/go.mod h1:6zlLIyOoRpJJ+0bEKrlZOZon3rOp5Jrz9fMdR4twOS4= -go.opentelemetry.io/collector/config/configtelemetry v0.112.0 h1:MVBrWJUoqfKrORI38dY8OV0i5d1RRHR/ACIBu9TOcZ8= -go.opentelemetry.io/collector/config/configtelemetry v0.112.0/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= -go.opentelemetry.io/collector/config/configtls v1.18.0 h1:IQemIIuryeHgrpBJMbLl+LgTxvFBbv7Hhi+0WwlxpCU= -go.opentelemetry.io/collector/config/configtls v1.18.0/go.mod h1:lD2dlDqeTKq7OecFwIZMufDaa8erSlEoHMJrFPHrZNw= -go.opentelemetry.io/collector/confmap v1.18.0 h1:UEOeJY8RW8lZ1O4lzHSGqolS7uzkpXQi5fa8SidKqQg= -go.opentelemetry.io/collector/confmap v1.18.0/go.mod h1:GgNu1ElPGmLn9govqIfjaopvdspw4PJ9KeDtWC4E2Q4= -go.opentelemetry.io/collector/consumer v0.112.0 h1:tfO4FpuQ8MsD7AxgslC3tRNVYjd9Xkus34BOExsG4fM= -go.opentelemetry.io/collector/consumer v0.112.0/go.mod h1:ZKSeGvXvaofIlvPrWlARKQpONOmuw6R/yifgYCWHKRw= -go.opentelemetry.io/collector/consumer/consumererror v0.112.0 h1:dCqWEi3Yws5V5oGhCSOwxCHK6tYya5UzfzXmSLMHZ8E= -go.opentelemetry.io/collector/consumer/consumererror v0.112.0/go.mod h1:X9RJt5caDnwxoG++GhQHvlmDi2TMWEr6S/XRhZTSmOI= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.112.0 h1:ym+QxemlbWwfMSUto1hRTfcZeYbj2q8FpMzjk8O+X60= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.112.0/go.mod h1:4PjDUpURFh85R6NLEHrEf/uZjpk4LAYmmOrqu+iZsyE= -go.opentelemetry.io/collector/consumer/consumertest v0.112.0 h1:pGvNH+H4rMygUOql6ynVQim6UFdimTiJ0HRfQL6v0GE= -go.opentelemetry.io/collector/consumer/consumertest v0.112.0/go.mod h1:rfVo0tYt/BaLWw3IaQKVQafjUlMsA5qTkvsSOfFrr9c= -go.opentelemetry.io/collector/extension v0.112.0 h1:NsCDMMbuZp8dSBLoAqHn/AtbcspbAqcubc4qogXo+zc= -go.opentelemetry.io/collector/extension v0.112.0/go.mod h1:CZrWN4sRQ2cLpEP+zb7DAG+RFSSGcmswEjTt8UvcycM= -go.opentelemetry.io/collector/extension/experimental/storage v0.112.0 h1:IBRQcwEo7RKytjTEFnEsOcd52ffvNeEmSl6FeYPZzpk= -go.opentelemetry.io/collector/extension/experimental/storage v0.112.0/go.mod h1:+3j0GK3WRNb2noOOGdcx7b5FQUBP1AzLl+y3y+Qns1c= -go.opentelemetry.io/collector/featuregate v1.18.0 h1:1CvP1K3XmVs7WZCs/A1j8rsC7JQWu+y+vF8vxKjLaOU= -go.opentelemetry.io/collector/featuregate v1.18.0/go.mod h1:47xrISO71vJ83LSMm8+yIDsUbKktUp48Ovt7RR6VbRs= -go.opentelemetry.io/collector/pdata v1.18.0 h1:/yg2rO2dxqDM2p6GutsMCxXN6sKlXwyIz/ZYyUPONBg= -go.opentelemetry.io/collector/pdata v1.18.0/go.mod h1:Ox1YVLe87cZDB/TL30i4SUz1cA5s6AM6SpFMfY61ICs= -go.opentelemetry.io/collector/pdata/pprofile v0.112.0 h1:t+LYorcMqZ3sDz5/jp3xU2l5lIhIXuIOOGO4Ef9CG2c= -go.opentelemetry.io/collector/pdata/pprofile v0.112.0/go.mod h1:F2aTCoDzIaxEUK1g92LZvMwradySFMo3ZsAnBIpOdUg= -go.opentelemetry.io/collector/pdata/testdata v0.112.0 h1:7jJzNvRE+CpYrwHbAYwPiN9a/hqmVRlRADJNeDJTvYI= -go.opentelemetry.io/collector/pdata/testdata v0.112.0/go.mod h1:9kO148Qp12B93SSUE52s0QGGV8Nf9RFN2G/PnZx3l+w= -go.opentelemetry.io/collector/pipeline v0.112.0 h1:jqKDdb8k53OLPibvxzX6fmMec0ZHAtqe4p2+cuHclEI= -go.opentelemetry.io/collector/pipeline v0.112.0/go.mod h1:4vOvjVsoYTHVGTbfFwqfnQOSV2K3RKUHofh3jNRc2Mg= -go.opentelemetry.io/collector/receiver v0.112.0 h1:gdTBDOPGKMZlZghtN5A7ZLNlNwCHWYcoJQeIiXvyGEQ= -go.opentelemetry.io/collector/receiver v0.112.0/go.mod h1:3QmfSUiyFzRTnHUqF8fyEvQpU5q/xuwS43jGt8JXEEA= -go.opentelemetry.io/collector/receiver/receiverprofiles v0.112.0 h1:SShkZsWRsFss3iWZa9JwMC7h4gD5RbWDhUcz1/9dXSs= -go.opentelemetry.io/collector/receiver/receiverprofiles v0.112.0/go.mod h1:615smszDXiz4YWwXslxlAjX7FzOVDU7Bk6xARFk+zpk= -go.opentelemetry.io/collector/semconv v0.112.0 h1:JPQyvZhlNLVSuVI+FScONaiFygB7h7NTZceUEKIQUEc= -go.opentelemetry.io/collector/semconv v0.112.0/go.mod h1:zCJ5njhWpejR+A40kiEoeFm1xq1uzyZwMnRNX6/D82A= -go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= -go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= -go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= -go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= -go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= -go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= -go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= -go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= -go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= -go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= +go.opentelemetry.io/collector v0.104.0 h1:R3zjM4O3K3+ttzsjPV75P80xalxRbwYTURlK0ys7uyo= +go.opentelemetry.io/collector v0.104.0/go.mod h1:Tm6F3na9ajnOm6I5goU9dURKxq1fSBK1yA94nvUix3k= +go.opentelemetry.io/collector/component v0.104.0 h1:jqu/X9rnv8ha0RNZ1a9+x7OU49KwSMsPbOuIEykHuQE= +go.opentelemetry.io/collector/component v0.104.0/go.mod h1:1C7C0hMVSbXyY1ycCmaMUAR9fVwpgyiNQqxXtEWhVpw= +go.opentelemetry.io/collector/config/configopaque v1.11.0 h1:Pt06PXWVmRaiSX63mzwT8Z9SV/hOc6VHNZbfZ10YY4o= +go.opentelemetry.io/collector/config/configopaque v1.11.0/go.mod h1:0xURn2sOy5j4fbaocpEYfM97HPGsiffkkVudSPyTJlM= +go.opentelemetry.io/collector/config/configtelemetry v0.104.0 h1:eHv98XIhapZA8MgTiipvi+FDOXoFhCYOwyKReOt+E4E= +go.opentelemetry.io/collector/config/configtelemetry v0.104.0/go.mod h1:WxWKNVAQJg/Io1nA3xLgn/DWLE/W1QOB2+/Js3ACi40= +go.opentelemetry.io/collector/config/configtls v0.104.0 h1:bMmLz2+r+REpO7cDOR+srOJHfitqTZfSZCffDpKfwWk= +go.opentelemetry.io/collector/config/configtls v0.104.0/go.mod h1:e33o7TWcKfe4ToLFyGISEPGMgp6ezf3yHRGY4gs9nKk= +go.opentelemetry.io/collector/confmap v0.104.0 h1:d3yuwX+CHpoyCh0iMv3rqb/vwAekjSm4ZDL6UK1nZSA= +go.opentelemetry.io/collector/confmap v0.104.0/go.mod h1:F8Lue+tPPn2oldXcfqI75PPMJoyzgUsKVtM/uHZLA4w= +go.opentelemetry.io/collector/consumer v0.104.0 h1:Z1ZjapFp5mUcbkGEL96ljpqLIUMhRgQQpYKkDRtxy+4= +go.opentelemetry.io/collector/consumer v0.104.0/go.mod h1:60zcIb0W9GW0z9uJCv6NmjpSbCfBOeRUyrtEwqK6Hzo= +go.opentelemetry.io/collector/extension v0.104.0 h1:bftkgFMKya/QIwK+bOxEAPVs/TvTez+s1mlaiUznJkA= +go.opentelemetry.io/collector/extension v0.104.0/go.mod h1:x7K0KyM1JGrtLbafEbRoVp0VpGBHpyx9hu87bsja6S4= +go.opentelemetry.io/collector/featuregate v1.11.0 h1:Z7puIymKoQRm3oNM/NH8reWc2zRPz2PNaJvuokh0lQY= +go.opentelemetry.io/collector/featuregate v1.11.0/go.mod h1:PsOINaGgTiFc+Tzu2K/X2jP+Ngmlp7YKGV1XrnBkH7U= +go.opentelemetry.io/collector/pdata/pprofile v0.104.0 h1:MYOIHvPlKEJbWLiBKFQWGD0xd2u22xGVLt4jPbdxP4Y= +go.opentelemetry.io/collector/pdata/pprofile v0.104.0/go.mod h1:7WpyHk2wJZRx70CGkBio8klrYTTXASbyIhf+rH4FKnA= +go.opentelemetry.io/collector/pdata/testdata v0.104.0 h1:BKTZ7hIyAX5DMPecrXkVB2e86HwWtJyOlXn/5vSVXNw= +go.opentelemetry.io/collector/pdata/testdata v0.104.0/go.mod h1:3SnYKu8gLfxURJMWS/cFEUFs+jEKS6jvfqKXnOZsdkQ= +go.opentelemetry.io/collector/semconv v0.104.0 h1:dUvajnh+AYJLEW/XOPk0T0BlwltSdi3vrjO7nSOos3k= +go.opentelemetry.io/collector/semconv v0.104.0/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw= +go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= +go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= +go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= +go.opentelemetry.io/otel/exporters/prometheus v0.49.0/go.mod h1:KfQ1wpjf3zsHjzP149P4LyAwWRupc6c7t1ZJ9eXpKQM= +go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= +go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= +go.opentelemetry.io/otel/sdk v1.27.0 h1:mlk+/Y1gLPLn84U4tI8d3GNJmGT/eXe3ZuOXN9kTWmI= +go.opentelemetry.io/otel/sdk v1.27.0/go.mod h1:Ha9vbLwJE6W86YstIywK2xFfPjbWlCuwPtMkKdz/Y4A= +go.opentelemetry.io/otel/sdk/metric v1.27.0 h1:5uGNOlpXi+Hbo/DRoI31BSb1v+OGcpv2NemcCrOL8gI= +go.opentelemetry.io/otel/sdk/metric v1.27.0/go.mod h1:we7jJVrYN2kh3mVBlswtPU22K0SA+769l93J6bsyvqw= +go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= +go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= diff --git a/receiver/filelogreceiver/go.mod b/receiver/filelogreceiver/go.mod index 18e4c4337645..a9c2b7f9d005 100644 --- a/receiver/filelogreceiver/go.mod +++ b/receiver/filelogreceiver/go.mod @@ -77,8 +77,6 @@ require ( replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza => ../../pkg/stanza - retract ( v0.76.2 v0.76.1 @@ -94,3 +92,7 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza => ../../pkg/stanza + +replace go.opentelemetry.io/collector/receiver => github.com/axoflow/opentelemetry-collector/receiver v0.104.0-dev1 diff --git a/receiver/filelogreceiver/go.sum b/receiver/filelogreceiver/go.sum index b10ffdcb9828..99ea345e0d72 100644 --- a/receiver/filelogreceiver/go.sum +++ b/receiver/filelogreceiver/go.sum @@ -1,5 +1,9 @@ -github.com/bmatcuk/doublestar/v4 v4.7.1 h1:fdDeAqgT47acgwd9bd9HxJRDmc9UAmPpc+2m0CXv75Q= -github.com/bmatcuk/doublestar/v4 v4.7.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= +github.com/axoflow/opentelemetry-collector/receiver v0.104.0-dev1 h1:KTuUFrm8Sps8HxBYkzHaPa1FCAacFMV6V7p5wnqWSMU= +github.com/axoflow/opentelemetry-collector/receiver v0.104.0-dev1/go.mod h1:NM06euqrApTpzietV7cCPAwP8k4PyKlPBfSr3tqlMz4= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I= +github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= @@ -75,50 +79,40 @@ github.com/valyala/fastjson v1.6.4 h1:uAUNq9Z6ymTgGhcm0UynUAB6tlbakBrz6CQFax3BXV github.com/valyala/fastjson v1.6.4/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opentelemetry.io/collector/component v0.112.0 h1:Hw125Tdb427yKkzFx3U/OsfPATYXsbURkc27dn19he8= -go.opentelemetry.io/collector/component v0.112.0/go.mod h1:hV9PEgkNlVAySX+Oo/g7+NcLe234L04kRXw6uGj3VEw= -go.opentelemetry.io/collector/config/configtelemetry v0.112.0 h1:MVBrWJUoqfKrORI38dY8OV0i5d1RRHR/ACIBu9TOcZ8= -go.opentelemetry.io/collector/config/configtelemetry v0.112.0/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= -go.opentelemetry.io/collector/confmap v1.18.0 h1:UEOeJY8RW8lZ1O4lzHSGqolS7uzkpXQi5fa8SidKqQg= -go.opentelemetry.io/collector/confmap v1.18.0/go.mod h1:GgNu1ElPGmLn9govqIfjaopvdspw4PJ9KeDtWC4E2Q4= -go.opentelemetry.io/collector/consumer v0.112.0 h1:tfO4FpuQ8MsD7AxgslC3tRNVYjd9Xkus34BOExsG4fM= -go.opentelemetry.io/collector/consumer v0.112.0/go.mod h1:ZKSeGvXvaofIlvPrWlARKQpONOmuw6R/yifgYCWHKRw= -go.opentelemetry.io/collector/consumer/consumererror v0.112.0 h1:dCqWEi3Yws5V5oGhCSOwxCHK6tYya5UzfzXmSLMHZ8E= -go.opentelemetry.io/collector/consumer/consumererror v0.112.0/go.mod h1:X9RJt5caDnwxoG++GhQHvlmDi2TMWEr6S/XRhZTSmOI= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.112.0 h1:ym+QxemlbWwfMSUto1hRTfcZeYbj2q8FpMzjk8O+X60= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.112.0/go.mod h1:4PjDUpURFh85R6NLEHrEf/uZjpk4LAYmmOrqu+iZsyE= -go.opentelemetry.io/collector/consumer/consumertest v0.112.0 h1:pGvNH+H4rMygUOql6ynVQim6UFdimTiJ0HRfQL6v0GE= -go.opentelemetry.io/collector/consumer/consumertest v0.112.0/go.mod h1:rfVo0tYt/BaLWw3IaQKVQafjUlMsA5qTkvsSOfFrr9c= -go.opentelemetry.io/collector/extension v0.112.0 h1:NsCDMMbuZp8dSBLoAqHn/AtbcspbAqcubc4qogXo+zc= -go.opentelemetry.io/collector/extension v0.112.0/go.mod h1:CZrWN4sRQ2cLpEP+zb7DAG+RFSSGcmswEjTt8UvcycM= -go.opentelemetry.io/collector/extension/experimental/storage v0.112.0 h1:IBRQcwEo7RKytjTEFnEsOcd52ffvNeEmSl6FeYPZzpk= -go.opentelemetry.io/collector/extension/experimental/storage v0.112.0/go.mod h1:+3j0GK3WRNb2noOOGdcx7b5FQUBP1AzLl+y3y+Qns1c= -go.opentelemetry.io/collector/featuregate v1.18.0 h1:1CvP1K3XmVs7WZCs/A1j8rsC7JQWu+y+vF8vxKjLaOU= -go.opentelemetry.io/collector/featuregate v1.18.0/go.mod h1:47xrISO71vJ83LSMm8+yIDsUbKktUp48Ovt7RR6VbRs= -go.opentelemetry.io/collector/pdata v1.18.0 h1:/yg2rO2dxqDM2p6GutsMCxXN6sKlXwyIz/ZYyUPONBg= -go.opentelemetry.io/collector/pdata v1.18.0/go.mod h1:Ox1YVLe87cZDB/TL30i4SUz1cA5s6AM6SpFMfY61ICs= -go.opentelemetry.io/collector/pdata/pprofile v0.112.0 h1:t+LYorcMqZ3sDz5/jp3xU2l5lIhIXuIOOGO4Ef9CG2c= -go.opentelemetry.io/collector/pdata/pprofile v0.112.0/go.mod h1:F2aTCoDzIaxEUK1g92LZvMwradySFMo3ZsAnBIpOdUg= -go.opentelemetry.io/collector/pdata/testdata v0.112.0 h1:7jJzNvRE+CpYrwHbAYwPiN9a/hqmVRlRADJNeDJTvYI= -go.opentelemetry.io/collector/pdata/testdata v0.112.0/go.mod h1:9kO148Qp12B93SSUE52s0QGGV8Nf9RFN2G/PnZx3l+w= -go.opentelemetry.io/collector/pipeline v0.112.0 h1:jqKDdb8k53OLPibvxzX6fmMec0ZHAtqe4p2+cuHclEI= -go.opentelemetry.io/collector/pipeline v0.112.0/go.mod h1:4vOvjVsoYTHVGTbfFwqfnQOSV2K3RKUHofh3jNRc2Mg= -go.opentelemetry.io/collector/receiver v0.112.0 h1:gdTBDOPGKMZlZghtN5A7ZLNlNwCHWYcoJQeIiXvyGEQ= -go.opentelemetry.io/collector/receiver v0.112.0/go.mod h1:3QmfSUiyFzRTnHUqF8fyEvQpU5q/xuwS43jGt8JXEEA= -go.opentelemetry.io/collector/receiver/receiverprofiles v0.112.0 h1:SShkZsWRsFss3iWZa9JwMC7h4gD5RbWDhUcz1/9dXSs= -go.opentelemetry.io/collector/receiver/receiverprofiles v0.112.0/go.mod h1:615smszDXiz4YWwXslxlAjX7FzOVDU7Bk6xARFk+zpk= -go.opentelemetry.io/collector/semconv v0.112.0 h1:JPQyvZhlNLVSuVI+FScONaiFygB7h7NTZceUEKIQUEc= -go.opentelemetry.io/collector/semconv v0.112.0/go.mod h1:zCJ5njhWpejR+A40kiEoeFm1xq1uzyZwMnRNX6/D82A= -go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= -go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= -go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= -go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= -go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= -go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= -go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= -go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= -go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= -go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= +go.opentelemetry.io/collector v0.104.0 h1:R3zjM4O3K3+ttzsjPV75P80xalxRbwYTURlK0ys7uyo= +go.opentelemetry.io/collector v0.104.0/go.mod h1:Tm6F3na9ajnOm6I5goU9dURKxq1fSBK1yA94nvUix3k= +go.opentelemetry.io/collector/component v0.104.0 h1:jqu/X9rnv8ha0RNZ1a9+x7OU49KwSMsPbOuIEykHuQE= +go.opentelemetry.io/collector/component v0.104.0/go.mod h1:1C7C0hMVSbXyY1ycCmaMUAR9fVwpgyiNQqxXtEWhVpw= +go.opentelemetry.io/collector/config/configtelemetry v0.104.0 h1:eHv98XIhapZA8MgTiipvi+FDOXoFhCYOwyKReOt+E4E= +go.opentelemetry.io/collector/config/configtelemetry v0.104.0/go.mod h1:WxWKNVAQJg/Io1nA3xLgn/DWLE/W1QOB2+/Js3ACi40= +go.opentelemetry.io/collector/confmap v0.104.0 h1:d3yuwX+CHpoyCh0iMv3rqb/vwAekjSm4ZDL6UK1nZSA= +go.opentelemetry.io/collector/confmap v0.104.0/go.mod h1:F8Lue+tPPn2oldXcfqI75PPMJoyzgUsKVtM/uHZLA4w= +go.opentelemetry.io/collector/consumer v0.104.0 h1:Z1ZjapFp5mUcbkGEL96ljpqLIUMhRgQQpYKkDRtxy+4= +go.opentelemetry.io/collector/consumer v0.104.0/go.mod h1:60zcIb0W9GW0z9uJCv6NmjpSbCfBOeRUyrtEwqK6Hzo= +go.opentelemetry.io/collector/extension v0.104.0 h1:bftkgFMKya/QIwK+bOxEAPVs/TvTez+s1mlaiUznJkA= +go.opentelemetry.io/collector/extension v0.104.0/go.mod h1:x7K0KyM1JGrtLbafEbRoVp0VpGBHpyx9hu87bsja6S4= +go.opentelemetry.io/collector/featuregate v1.11.0 h1:Z7puIymKoQRm3oNM/NH8reWc2zRPz2PNaJvuokh0lQY= +go.opentelemetry.io/collector/featuregate v1.11.0/go.mod h1:PsOINaGgTiFc+Tzu2K/X2jP+Ngmlp7YKGV1XrnBkH7U= +go.opentelemetry.io/collector/pdata v1.11.0 h1:rzYyV1zfTQQz1DI9hCiaKyyaczqawN75XO9mdXmR/hE= +go.opentelemetry.io/collector/pdata v1.11.0/go.mod h1:IHxHsp+Jq/xfjORQMDJjSH6jvedOSTOyu3nbxqhWSYE= +go.opentelemetry.io/collector/pdata/pprofile v0.104.0 h1:MYOIHvPlKEJbWLiBKFQWGD0xd2u22xGVLt4jPbdxP4Y= +go.opentelemetry.io/collector/pdata/pprofile v0.104.0/go.mod h1:7WpyHk2wJZRx70CGkBio8klrYTTXASbyIhf+rH4FKnA= +go.opentelemetry.io/collector/pdata/testdata v0.104.0 h1:BKTZ7hIyAX5DMPecrXkVB2e86HwWtJyOlXn/5vSVXNw= +go.opentelemetry.io/collector/pdata/testdata v0.104.0/go.mod h1:3SnYKu8gLfxURJMWS/cFEUFs+jEKS6jvfqKXnOZsdkQ= +go.opentelemetry.io/collector/semconv v0.104.0 h1:dUvajnh+AYJLEW/XOPk0T0BlwltSdi3vrjO7nSOos3k= +go.opentelemetry.io/collector/semconv v0.104.0/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw= +go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= +go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= +go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= +go.opentelemetry.io/otel/exporters/prometheus v0.49.0/go.mod h1:KfQ1wpjf3zsHjzP149P4LyAwWRupc6c7t1ZJ9eXpKQM= +go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= +go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= +go.opentelemetry.io/otel/sdk v1.27.0 h1:mlk+/Y1gLPLn84U4tI8d3GNJmGT/eXe3ZuOXN9kTWmI= +go.opentelemetry.io/otel/sdk v1.27.0/go.mod h1:Ha9vbLwJE6W86YstIywK2xFfPjbWlCuwPtMkKdz/Y4A= +go.opentelemetry.io/otel/sdk/metric v1.27.0 h1:5uGNOlpXi+Hbo/DRoI31BSb1v+OGcpv2NemcCrOL8gI= +go.opentelemetry.io/otel/sdk/metric v1.27.0/go.mod h1:we7jJVrYN2kh3mVBlswtPU22K0SA+769l93J6bsyvqw= +go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= +go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= From 9119ca0c95cedd84160ca0cefad074ad9e01f953 Mon Sep 17 00:00:00 2001 From: Kristof Gyuracz Date: Thu, 18 Apr 2024 16:48:53 +0200 Subject: [PATCH 2/5] try resource attrs for count connector --- connector/countconnector/connector.go | 18 +++++++++--------- connector/countconnector/counter.go | 9 ++++++++- connector/countconnector/factory.go | 7 ++++--- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/connector/countconnector/connector.go b/connector/countconnector/connector.go index 3a6ef3f443f0..c53ce133a3f2 100644 --- a/connector/countconnector/connector.go +++ b/connector/countconnector/connector.go @@ -56,12 +56,12 @@ func (c *count) ConsumeTraces(ctx context.Context, td ptrace.Traces) error { for k := 0; k < scopeSpan.Spans().Len(); k++ { span := scopeSpan.Spans().At(k) sCtx := ottlspan.NewTransformContext(span, scopeSpan.Scope(), resourceSpan.Resource(), scopeSpan, resourceSpan) - multiError = errors.Join(multiError, spansCounter.update(ctx, span.Attributes(), sCtx)) + multiError = errors.Join(multiError, spansCounter.update(ctx, span.Attributes(), scopeSpan.Scope().Attributes(), sCtx)) for l := 0; l < span.Events().Len(); l++ { event := span.Events().At(l) eCtx := ottlspanevent.NewTransformContext(event, span, scopeSpan.Scope(), resourceSpan.Resource(), scopeSpan, resourceSpan) - multiError = errors.Join(multiError, spanEventsCounter.update(ctx, event.Attributes(), eCtx)) + multiError = errors.Join(multiError, spanEventsCounter.update(ctx, event.Attributes(), scopeSpan.Scope().Attributes(), eCtx)) } } } @@ -101,7 +101,7 @@ func (c *count) ConsumeMetrics(ctx context.Context, md pmetric.Metrics) error { for k := 0; k < scopeMetrics.Metrics().Len(); k++ { metric := scopeMetrics.Metrics().At(k) mCtx := ottlmetric.NewTransformContext(metric, scopeMetrics.Metrics(), scopeMetrics.Scope(), resourceMetric.Resource(), scopeMetrics, resourceMetric) - multiError = errors.Join(multiError, metricsCounter.update(ctx, pcommon.NewMap(), mCtx)) + multiError = errors.Join(multiError, metricsCounter.update(ctx, pcommon.NewMap(), pcommon.NewMap(), mCtx)) //exhaustive:enforce switch metric.Type() { @@ -109,31 +109,31 @@ func (c *count) ConsumeMetrics(ctx context.Context, md pmetric.Metrics) error { dps := metric.Gauge().DataPoints() for i := 0; i < dps.Len(); i++ { dCtx := ottldatapoint.NewTransformContext(dps.At(i), metric, scopeMetrics.Metrics(), scopeMetrics.Scope(), resourceMetric.Resource(), scopeMetrics, resourceMetric) - multiError = errors.Join(multiError, dataPointsCounter.update(ctx, dps.At(i).Attributes(), dCtx)) + multiError = errors.Join(multiError, dataPointsCounter.update(ctx, dps.At(i).Attributes(), resourceMetric.Resource().Attributes(), dCtx)) } case pmetric.MetricTypeSum: dps := metric.Sum().DataPoints() for i := 0; i < dps.Len(); i++ { dCtx := ottldatapoint.NewTransformContext(dps.At(i), metric, scopeMetrics.Metrics(), scopeMetrics.Scope(), resourceMetric.Resource(), scopeMetrics, resourceMetric) - multiError = errors.Join(multiError, dataPointsCounter.update(ctx, dps.At(i).Attributes(), dCtx)) + multiError = errors.Join(multiError, dataPointsCounter.update(ctx, dps.At(i).Attributes(), resourceMetric.Resource().Attributes(), dCtx)) } case pmetric.MetricTypeSummary: dps := metric.Summary().DataPoints() for i := 0; i < dps.Len(); i++ { dCtx := ottldatapoint.NewTransformContext(dps.At(i), metric, scopeMetrics.Metrics(), scopeMetrics.Scope(), resourceMetric.Resource(), scopeMetrics, resourceMetric) - multiError = errors.Join(multiError, dataPointsCounter.update(ctx, dps.At(i).Attributes(), dCtx)) + multiError = errors.Join(multiError, dataPointsCounter.update(ctx, dps.At(i).Attributes(), resourceMetric.Resource().Attributes(), dCtx)) } case pmetric.MetricTypeHistogram: dps := metric.Histogram().DataPoints() for i := 0; i < dps.Len(); i++ { dCtx := ottldatapoint.NewTransformContext(dps.At(i), metric, scopeMetrics.Metrics(), scopeMetrics.Scope(), resourceMetric.Resource(), scopeMetrics, resourceMetric) - multiError = errors.Join(multiError, dataPointsCounter.update(ctx, dps.At(i).Attributes(), dCtx)) + multiError = errors.Join(multiError, dataPointsCounter.update(ctx, dps.At(i).Attributes(), resourceMetric.Resource().Attributes(), dCtx)) } case pmetric.MetricTypeExponentialHistogram: dps := metric.ExponentialHistogram().DataPoints() for i := 0; i < dps.Len(); i++ { dCtx := ottldatapoint.NewTransformContext(dps.At(i), metric, scopeMetrics.Metrics(), scopeMetrics.Scope(), resourceMetric.Resource(), scopeMetrics, resourceMetric) - multiError = errors.Join(multiError, dataPointsCounter.update(ctx, dps.At(i).Attributes(), dCtx)) + multiError = errors.Join(multiError, dataPointsCounter.update(ctx, dps.At(i).Attributes(), resourceMetric.Resource().Attributes(), dCtx)) } case pmetric.MetricTypeEmpty: multiError = errors.Join(multiError, fmt.Errorf("metric %q: invalid metric type: %v", metric.Name(), metric.Type())) @@ -176,7 +176,7 @@ func (c *count) ConsumeLogs(ctx context.Context, ld plog.Logs) error { logRecord := scopeLogs.LogRecords().At(k) lCtx := ottllog.NewTransformContext(logRecord, scopeLogs.Scope(), resourceLog.Resource(), scopeLogs, resourceLog) - multiError = errors.Join(multiError, counter.update(ctx, logRecord.Attributes(), lCtx)) + multiError = errors.Join(multiError, counter.update(ctx, logRecord.Attributes(), resourceLog.Resource().Attributes(), lCtx)) } } diff --git a/connector/countconnector/counter.go b/connector/countconnector/counter.go index e08178e1964d..c723c31facaa 100644 --- a/connector/countconnector/counter.go +++ b/connector/countconnector/counter.go @@ -35,7 +35,7 @@ type attrCounter struct { count uint64 } -func (c *counter[K]) update(ctx context.Context, attrs pcommon.Map, tCtx K) error { +func (c *counter[K]) update(ctx context.Context, attrs pcommon.Map, resourceAttrs pcommon.Map, tCtx K) error { var multiError error for name, md := range c.metricDefs { countAttrs := pcommon.NewMap() @@ -66,6 +66,13 @@ func (c *counter[K]) update(ctx context.Context, attrs pcommon.Map, tCtx K) erro } } } + for _, resAttr := range md.resourceAttrs { + if resAttrVal, ok := resourceAttrs.Get(resAttr.Key); ok { + countAttrs.PutStr(resAttr.Key, resAttrVal.Str()) + } else if resAttr.DefaultValue != "" { + countAttrs.PutStr(resAttr.Key, resAttr.DefaultValue) + } + } // Missing necessary attributes to be counted if countAttrs.Len() != len(md.attrs) { diff --git a/connector/countconnector/factory.go b/connector/countconnector/factory.go index e9a44d3111a4..1e8916a90504 100644 --- a/connector/countconnector/factory.go +++ b/connector/countconnector/factory.go @@ -156,7 +156,8 @@ func createLogsToMetrics( } type metricDef[K any] struct { - condition expr.BoolExpr[K] - desc string - attrs []AttributeConfig + condition expr.BoolExpr[K] + desc string + attrs []AttributeConfig + resourceAttrs []AttributeConfig } From a25684d0c20c839d95c542c818166b272d318f44 Mon Sep 17 00:00:00 2001 From: Kristof Gyuracz Date: Wed, 12 Jun 2024 14:24:21 +0200 Subject: [PATCH 3/5] fixes for counter to allow partial attributes to be counted --- connector/countconnector/counter.go | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/connector/countconnector/counter.go b/connector/countconnector/counter.go index c723c31facaa..67a3adb311c1 100644 --- a/connector/countconnector/counter.go +++ b/connector/countconnector/counter.go @@ -68,17 +68,32 @@ func (c *counter[K]) update(ctx context.Context, attrs pcommon.Map, resourceAttr } for _, resAttr := range md.resourceAttrs { if resAttrVal, ok := resourceAttrs.Get(resAttr.Key); ok { - countAttrs.PutStr(resAttr.Key, resAttrVal.Str()) + switch typeAttr := resAttrVal.Type(); typeAttr { + case pcommon.ValueTypeInt: + countAttrs.PutInt(resAttr.Key, resAttrVal.Int()) + case pcommon.ValueTypeDouble: + countAttrs.PutDouble(resAttr.Key, resAttrVal.Double()) + default: + countAttrs.PutStr(resAttr.Key, resAttrVal.Str()) + } } else if resAttr.DefaultValue != "" { - countAttrs.PutStr(resAttr.Key, resAttr.DefaultValue) + switch v := resAttr.DefaultValue.(type) { + case string: + if v != "" { + countAttrs.PutStr(resAttr.Key, v) + } + case int: + if v != 0 { + countAttrs.PutInt(resAttr.Key, int64(v)) + } + case float64: + if v != 0 { + countAttrs.PutDouble(resAttr.Key, float64(v)) + } + } } } - // Missing necessary attributes to be counted - if countAttrs.Len() != len(md.attrs) { - continue - } - // No conditions, so match all. if md.condition == nil { multiError = errors.Join(multiError, c.increment(name, countAttrs)) From 492a944c224fd4af4d65f453452af3bc08fbb725 Mon Sep 17 00:00:00 2001 From: Kristof Gyuracz Date: Wed, 12 Jun 2024 14:24:39 +0200 Subject: [PATCH 4/5] update testdata with new expected results --- .../logs/condition_and_attribute.yaml | 24 +- .../logs/default_attribute_value.yaml | 125 ++++---- .../testdata/logs/multiple_attributes.yaml | 119 ++++++-- .../testdata/logs/multiple_conditions.yaml | 52 +++- .../testdata/logs/multiple_metrics.yaml | 65 +++- .../testdata/logs/one_attribute.yaml | 73 ++++- .../testdata/logs/one_condition.yaml | 16 +- .../testdata/logs/zero_conditions.yaml | 49 ++- .../metrics/condition_and_attribute.yaml | 30 +- .../metrics/default_attribute_value.yaml | 175 ++++++++--- .../metrics/default_int_attribute_value.yaml | 123 +++++++- .../testdata/metrics/int_attribute_value.yaml | 84 +++++- .../testdata/metrics/multiple_attributes.yaml | 139 +++++++-- .../testdata/metrics/multiple_conditions.yaml | 86 +++++- .../testdata/metrics/multiple_metrics.yaml | 161 +++++++--- .../testdata/metrics/one_attribute.yaml | 93 +++++- .../testdata/metrics/one_condition.yaml | 20 +- .../testdata/metrics/zero_conditions.yaml | 85 +++++- .../traces/condition_and_attribute.yaml | 36 ++- .../traces/default_attribute_value.yaml | 280 ++++++++++++------ .../testdata/traces/multiple_attributes.yaml | 213 ++++++++++--- .../testdata/traces/multiple_conditions.yaml | 70 ++++- .../testdata/traces/multiple_metrics.yaml | 98 ++++-- .../testdata/traces/one_attribute.yaml | 111 +++++-- .../testdata/traces/one_condition.yaml | 20 +- .../testdata/traces/zero_conditions.yaml | 63 +++- 26 files changed, 1836 insertions(+), 574 deletions(-) diff --git a/connector/countconnector/testdata/logs/condition_and_attribute.yaml b/connector/countconnector/testdata/logs/condition_and_attribute.yaml index 82c440744d29..41e15841dda0 100644 --- a/connector/countconnector/testdata/logs/condition_and_attribute.yaml +++ b/connector/countconnector/testdata/logs/condition_and_attribute.yaml @@ -1,12 +1,12 @@ resourceMetrics: - resource: attributes: - - key: resource.required - value: - stringValue: foo - key: resource.optional value: stringValue: bar + - key: resource.required + value: + stringValue: foo scopeMetrics: - metrics: - description: Log count by attribute if ... @@ -14,29 +14,31 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: + - asInt: "1" + timeUnixNano: "1000000" - asInt: "2" attributes: - key: log.required value: stringValue: foo - timeUnixNano: "1678390948399018000" + timeUnixNano: "1000000" - asInt: "1" attributes: - key: log.required value: stringValue: notfoo - timeUnixNano: "1678390948399018000" + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector - resource: attributes: - - key: resource.required - value: - stringValue: foo - key: resource.optional value: stringValue: notbar + - key: resource.required + value: + stringValue: foo scopeMetrics: - metrics: - description: Log count by attribute if ... @@ -44,18 +46,20 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: + - asInt: "1" + timeUnixNano: "1000000" - asInt: "2" attributes: - key: log.required value: stringValue: foo - timeUnixNano: "1678390948399021000" + timeUnixNano: "1000000" - asInt: "1" attributes: - key: log.required value: stringValue: notfoo - timeUnixNano: "1678390948399021000" + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector diff --git a/connector/countconnector/testdata/logs/default_attribute_value.yaml b/connector/countconnector/testdata/logs/default_attribute_value.yaml index ba4cdd77f938..3aaad3dc5e83 100644 --- a/connector/countconnector/testdata/logs/default_attribute_value.yaml +++ b/connector/countconnector/testdata/logs/default_attribute_value.yaml @@ -1,12 +1,5 @@ resourceMetrics: - - resource: - attributes: - - key: resource.required - value: - stringValue: foo - - key: resource.optional - value: - stringValue: bar + - resource: {} scopeMetrics: - metrics: - description: Log count by attribute with default @@ -16,31 +9,37 @@ resourceMetrics: dataPoints: - asInt: "1" attributes: - - key: log.required - value: - stringValue: foo - key: log.optional value: - stringValue: bar - timeUnixNano: "1678390948398365000" + stringValue: other + timeUnixNano: "1000000" - asInt: "1" attributes: + - key: log.optional + value: + stringValue: bar - key: log.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "1" + attributes: - key: log.optional value: stringValue: notbar - timeUnixNano: "1678390948398365000" - - asInt: "1" - attributes: - key: log.required value: - stringValue: notfoo + stringValue: foo + timeUnixNano: "1000000" + - asInt: "1" + attributes: - key: log.optional value: stringValue: other - timeUnixNano: "1678390948398365000" + - key: log.required + value: + stringValue: notfoo + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector @@ -48,10 +47,7 @@ resourceMetrics: attributes: - key: resource.required value: - stringValue: foo - - key: resource.optional - value: - stringValue: notbar + stringValue: notfoo scopeMetrics: - metrics: - description: Log count by attribute with default @@ -61,39 +57,48 @@ resourceMetrics: dataPoints: - asInt: "1" attributes: - - key: log.required - value: - stringValue: foo - key: log.optional value: - stringValue: bar - timeUnixNano: "1678390948398368000" + stringValue: other + timeUnixNano: "1000000" - asInt: "1" attributes: + - key: log.optional + value: + stringValue: bar - key: log.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "1" + attributes: - key: log.optional value: stringValue: notbar - timeUnixNano: "1678390948398368000" - - asInt: "1" - attributes: - key: log.required value: - stringValue: notfoo + stringValue: foo + timeUnixNano: "1000000" + - asInt: "1" + attributes: - key: log.optional value: stringValue: other - timeUnixNano: "1678390948398368000" + - key: log.required + value: + stringValue: notfoo + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector - resource: attributes: + - key: resource.optional + value: + stringValue: bar - key: resource.required value: - stringValue: notfoo + stringValue: foo scopeMetrics: - metrics: - description: Log count by attribute with default @@ -103,34 +108,40 @@ resourceMetrics: dataPoints: - asInt: "1" attributes: - - key: log.required - value: - stringValue: foo - key: log.optional value: - stringValue: bar - timeUnixNano: "1678390948398371000" + stringValue: other + timeUnixNano: "1000000" - asInt: "1" attributes: + - key: log.optional + value: + stringValue: bar - key: log.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "1" + attributes: - key: log.optional value: stringValue: notbar - timeUnixNano: "1678390948398371000" - - asInt: "1" - attributes: - key: log.required value: - stringValue: notfoo + stringValue: foo + timeUnixNano: "1000000" + - asInt: "1" + attributes: - key: log.optional value: stringValue: other - timeUnixNano: "1678390948398371000" + - key: log.required + value: + stringValue: notfoo + timeUnixNano: "1000000" isMonotonic: true scope: - name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector + name: otelcol/countconnector - resource: {} scopeMetrics: - metrics: @@ -141,31 +152,37 @@ resourceMetrics: dataPoints: - asInt: "1" attributes: - - key: log.required - value: - stringValue: foo - key: log.optional value: - stringValue: bar - timeUnixNano: "1678390948398373000" + stringValue: other + timeUnixNano: "1000000" - asInt: "1" attributes: + - key: log.optional + value: + stringValue: bar - key: log.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "1" + attributes: - key: log.optional value: stringValue: notbar - timeUnixNano: "1678390948398373000" - - asInt: "1" - attributes: - key: log.required value: - stringValue: notfoo + stringValue: foo + timeUnixNano: "1000000" + - asInt: "1" + attributes: - key: log.optional value: stringValue: other - timeUnixNano: "1678390948398373000" + - key: log.required + value: + stringValue: notfoo + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector diff --git a/connector/countconnector/testdata/logs/multiple_attributes.yaml b/connector/countconnector/testdata/logs/multiple_attributes.yaml index 015794fc7620..3c6ce5663f0a 100644 --- a/connector/countconnector/testdata/logs/multiple_attributes.yaml +++ b/connector/countconnector/testdata/logs/multiple_attributes.yaml @@ -1,12 +1,5 @@ resourceMetrics: - - resource: - attributes: - - key: resource.required - value: - stringValue: foo - - key: resource.optional - value: - stringValue: bar + - resource: {} scopeMetrics: - metrics: - description: Log count by attributes @@ -14,23 +7,29 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: + - asInt: "1" + timeUnixNano: "1000000" - asInt: "1" attributes: - key: log.required value: - stringValue: foo + stringValue: notfoo + timeUnixNano: "1000000" + - asInt: "1" + attributes: - key: log.optional value: stringValue: bar - timeUnixNano: "1678390948397879000" - - asInt: "1" - attributes: - key: log.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "1" + attributes: - key: log.optional value: stringValue: notbar +<<<<<<< HEAD timeUnixNano: "1678390948397879000" isMonotonic: true scope: @@ -52,30 +51,69 @@ resourceMetrics: dataPoints: - asInt: "1" attributes: +======= +>>>>>>> 6ba58ec472 (update testdata with new expected results) - key: log.required value: stringValue: foo - - key: log.optional + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector + - resource: + attributes: + - key: resource.required + value: + stringValue: notfoo + scopeMetrics: + - metrics: + - description: Log count by attributes + name: log.count.by_attr + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "1" + timeUnixNano: "1000000" + - asInt: "1" + attributes: + - key: log.required value: - stringValue: bar - timeUnixNano: "1678390948397882000" + stringValue: notfoo + timeUnixNano: "1000000" - asInt: "1" attributes: + - key: log.optional + value: + stringValue: bar - key: log.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "1" + attributes: - key: log.optional value: stringValue: notbar - timeUnixNano: "1678390948397882000" + - key: log.required + value: + stringValue: foo + timeUnixNano: "1000000" isMonotonic: true scope: +<<<<<<< HEAD name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector + - resource: {} +======= + name: otelcol/countconnector - resource: attributes: + - key: resource.optional + value: + stringValue: bar - key: resource.required value: - stringValue: notfoo + stringValue: foo +>>>>>>> 6ba58ec472 (update testdata with new expected results) scopeMetrics: - metrics: - description: Log count by attributes @@ -83,28 +121,43 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: + - asInt: "1" + timeUnixNano: "1000000" - asInt: "1" attributes: - key: log.required value: - stringValue: foo + stringValue: notfoo + timeUnixNano: "1000000" + - asInt: "1" + attributes: - key: log.optional value: stringValue: bar - timeUnixNano: "1678390948397884000" - - asInt: "1" - attributes: - key: log.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "1" + attributes: - key: log.optional value: stringValue: notbar - timeUnixNano: "1678390948397884000" + - key: log.required + value: + stringValue: foo + timeUnixNano: "1000000" isMonotonic: true scope: - name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector - - resource: {} + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: notbar + - key: resource.required + value: + stringValue: foo scopeMetrics: - metrics: - description: Log count by attributes @@ -112,24 +165,32 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: + - asInt: "1" + timeUnixNano: "1000000" - asInt: "1" attributes: - key: log.required value: - stringValue: foo + stringValue: notfoo + timeUnixNano: "1000000" + - asInt: "1" + attributes: - key: log.optional value: stringValue: bar - timeUnixNano: "1678390948397886000" - - asInt: "1" - attributes: - key: log.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "1" + attributes: - key: log.optional value: stringValue: notbar - timeUnixNano: "1678390948397886000" + - key: log.required + value: + stringValue: foo + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector diff --git a/connector/countconnector/testdata/logs/multiple_conditions.yaml b/connector/countconnector/testdata/logs/multiple_conditions.yaml index 7f8128882367..91915366c667 100644 --- a/connector/countconnector/testdata/logs/multiple_conditions.yaml +++ b/connector/countconnector/testdata/logs/multiple_conditions.yaml @@ -1,12 +1,5 @@ resourceMetrics: - - resource: - attributes: - - key: resource.required - value: - stringValue: foo - - key: resource.optional - value: - stringValue: bar + - resource: {} scopeMetrics: - metrics: - description: Count if ... @@ -14,6 +7,7 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: +<<<<<<< HEAD - asInt: "4" timeUnixNano: "1678390948395853000" isMonotonic: true @@ -36,6 +30,10 @@ resourceMetrics: dataPoints: - asInt: "4" timeUnixNano: "1678390948395856000" +======= + - asInt: "2" + timeUnixNano: "1000000" +>>>>>>> 6ba58ec472 (update testdata with new expected results) isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector @@ -52,11 +50,23 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "2" - timeUnixNano: "1678390948395858000" + timeUnixNano: "1000000" isMonotonic: true scope: +<<<<<<< HEAD name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector - resource: {} +======= + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: bar + - key: resource.required + value: + stringValue: foo +>>>>>>> 6ba58ec472 (update testdata with new expected results) scopeMetrics: - metrics: - description: Count if ... @@ -64,8 +74,28 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: - - asInt: "2" - timeUnixNano: "1678390948395859000" + - asInt: "4" + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: notbar + - key: resource.required + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: Count if ... + name: count.if + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "4" + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector diff --git a/connector/countconnector/testdata/logs/multiple_metrics.yaml b/connector/countconnector/testdata/logs/multiple_metrics.yaml index 1f3f0f06643d..5c8ccd8bdfc5 100644 --- a/connector/countconnector/testdata/logs/multiple_metrics.yaml +++ b/connector/countconnector/testdata/logs/multiple_metrics.yaml @@ -1,12 +1,5 @@ resourceMetrics: - - resource: - attributes: - - key: resource.required - value: - stringValue: foo - - key: resource.optional - value: - stringValue: bar + - resource: {} scopeMetrics: - metrics: - description: All logs count @@ -15,6 +8,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "4" +<<<<<<< HEAD timeUnixNano: "1678390948396984000" isMonotonic: true - description: Count if ... @@ -52,6 +46,9 @@ resourceMetrics: dataPoints: - asInt: "4" timeUnixNano: "1678390948396988000" +======= + timeUnixNano: "1000000" +>>>>>>> 6ba58ec472 (update testdata with new expected results) isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector @@ -68,11 +65,23 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "4" - timeUnixNano: "1678390948396990000" + timeUnixNano: "1000000" isMonotonic: true scope: +<<<<<<< HEAD name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector - resource: {} +======= + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: bar + - key: resource.required + value: + stringValue: foo +>>>>>>> 6ba58ec472 (update testdata with new expected results) scopeMetrics: - metrics: - description: All logs count @@ -81,7 +90,43 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "4" - timeUnixNano: "1678390948396992000" + timeUnixNano: "1000000" + isMonotonic: true + - description: Count if ... + name: count.if + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "4" + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: notbar + - key: resource.required + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: All logs count + name: count.all + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "4" + timeUnixNano: "1000000" + isMonotonic: true + - description: Count if ... + name: count.if + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "4" + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector diff --git a/connector/countconnector/testdata/logs/one_attribute.yaml b/connector/countconnector/testdata/logs/one_attribute.yaml index 46ec178c063e..1821e66ac9dd 100644 --- a/connector/countconnector/testdata/logs/one_attribute.yaml +++ b/connector/countconnector/testdata/logs/one_attribute.yaml @@ -1,12 +1,5 @@ resourceMetrics: - - resource: - attributes: - - key: resource.required - value: - stringValue: foo - - key: resource.optional - value: - stringValue: bar + - resource: {} scopeMetrics: - metrics: - description: Log count by attribute @@ -14,17 +7,20 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: + - asInt: "1" + timeUnixNano: "1000000" - asInt: "2" attributes: - key: log.required value: stringValue: foo - timeUnixNano: "1678390948397419000" + timeUnixNano: "1000000" - asInt: "1" attributes: - key: log.required value: stringValue: notfoo +<<<<<<< HEAD timeUnixNano: "1678390948397419000" isMonotonic: true scope: @@ -56,6 +52,9 @@ resourceMetrics: value: stringValue: notfoo timeUnixNano: "1678390948397423000" +======= + timeUnixNano: "1000000" +>>>>>>> 6ba58ec472 (update testdata with new expected results) isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector @@ -71,22 +70,36 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: + - asInt: "1" + timeUnixNano: "1000000" - asInt: "2" attributes: - key: log.required value: stringValue: foo - timeUnixNano: "1678390948397425000" + timeUnixNano: "1000000" - asInt: "1" attributes: - key: log.required value: stringValue: notfoo - timeUnixNano: "1678390948397425000" + timeUnixNano: "1000000" isMonotonic: true scope: +<<<<<<< HEAD name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector - resource: {} +======= + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: bar + - key: resource.required + value: + stringValue: foo +>>>>>>> 6ba58ec472 (update testdata with new expected results) scopeMetrics: - metrics: - description: Log count by attribute @@ -94,18 +107,52 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: + - asInt: "1" + timeUnixNano: "1000000" + - asInt: "2" + attributes: + - key: log.required + value: + stringValue: foo + timeUnixNano: "1000000" + - asInt: "1" + attributes: + - key: log.required + value: + stringValue: notfoo + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: notbar + - key: resource.required + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: Log count by attribute + name: log.count.by_attr + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "1" + timeUnixNano: "1000000" - asInt: "2" attributes: - key: log.required value: stringValue: foo - timeUnixNano: "1678390948397427000" + timeUnixNano: "1000000" - asInt: "1" attributes: - key: log.required value: stringValue: notfoo - timeUnixNano: "1678390948397427000" + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector diff --git a/connector/countconnector/testdata/logs/one_condition.yaml b/connector/countconnector/testdata/logs/one_condition.yaml index a0ff1e5314a3..8baee9b89f41 100644 --- a/connector/countconnector/testdata/logs/one_condition.yaml +++ b/connector/countconnector/testdata/logs/one_condition.yaml @@ -1,12 +1,12 @@ resourceMetrics: - resource: attributes: - - key: resource.required - value: - stringValue: foo - key: resource.optional value: stringValue: bar + - key: resource.required + value: + stringValue: foo scopeMetrics: - metrics: - description: Count if ... @@ -15,18 +15,18 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "4" - timeUnixNano: "1678390948395244000" + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector - resource: attributes: - - key: resource.required - value: - stringValue: foo - key: resource.optional value: stringValue: notbar + - key: resource.required + value: + stringValue: foo scopeMetrics: - metrics: - description: Count if ... @@ -35,7 +35,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "4" - timeUnixNano: "1678390948395279000" + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector diff --git a/connector/countconnector/testdata/logs/zero_conditions.yaml b/connector/countconnector/testdata/logs/zero_conditions.yaml index 2eb91cedd03a..3896dbfcd444 100644 --- a/connector/countconnector/testdata/logs/zero_conditions.yaml +++ b/connector/countconnector/testdata/logs/zero_conditions.yaml @@ -1,12 +1,5 @@ resourceMetrics: - - resource: - attributes: - - key: resource.required - value: - stringValue: foo - - key: resource.optional - value: - stringValue: bar + - resource: {} scopeMetrics: - metrics: - description: The number of log records observed. @@ -15,6 +8,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "4" +<<<<<<< HEAD timeUnixNano: "1678390948393725000" isMonotonic: true scope: @@ -36,6 +30,9 @@ resourceMetrics: dataPoints: - asInt: "4" timeUnixNano: "1678390948393759000" +======= + timeUnixNano: "1000000" +>>>>>>> 6ba58ec472 (update testdata with new expected results) isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector @@ -52,11 +49,43 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "4" - timeUnixNano: "1678390948393760000" + timeUnixNano: "1000000" isMonotonic: true scope: +<<<<<<< HEAD name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector - resource: {} +======= + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: bar + - key: resource.required + value: + stringValue: foo +>>>>>>> 6ba58ec472 (update testdata with new expected results) + scopeMetrics: + - metrics: + - description: The number of log records observed. + name: log.record.count + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "4" + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: notbar + - key: resource.required + value: + stringValue: foo scopeMetrics: - metrics: - description: The number of log records observed. @@ -65,7 +94,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "4" - timeUnixNano: "1678390948393761000" + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector diff --git a/connector/countconnector/testdata/metrics/condition_and_attribute.yaml b/connector/countconnector/testdata/metrics/condition_and_attribute.yaml index c7b8c73d4237..00073437a642 100644 --- a/connector/countconnector/testdata/metrics/condition_and_attribute.yaml +++ b/connector/countconnector/testdata/metrics/condition_and_attribute.yaml @@ -1,12 +1,12 @@ resourceMetrics: - resource: attributes: - - key: resource.required - value: - stringValue: foo - key: resource.optional value: stringValue: bar + - key: resource.required + value: + stringValue: foo scopeMetrics: - metrics: - description: Data point count by attribute if ... @@ -14,29 +14,31 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: + - asInt: "6" + timeUnixNano: "1000000" - asInt: "12" attributes: - key: datapoint.required value: stringValue: foo - timeUnixNano: "1678391923823222000" + timeUnixNano: "1000000" - asInt: "6" attributes: - key: datapoint.required value: stringValue: notfoo - timeUnixNano: "1678391923823222000" + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector - resource: attributes: - - key: resource.required - value: - stringValue: foo - key: resource.optional value: stringValue: notbar + - key: resource.required + value: + stringValue: foo scopeMetrics: - metrics: - description: Data point count by attribute if ... @@ -45,17 +47,19 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "6" + timeUnixNano: "1000000" + - asInt: "12" attributes: - key: datapoint.required value: - stringValue: notfoo - timeUnixNano: "1678391923823233000" - - asInt: "12" + stringValue: foo + timeUnixNano: "1000000" + - asInt: "6" attributes: - key: datapoint.required value: - stringValue: foo - timeUnixNano: "1678391923823233000" + stringValue: notfoo + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector diff --git a/connector/countconnector/testdata/metrics/default_attribute_value.yaml b/connector/countconnector/testdata/metrics/default_attribute_value.yaml index 127363720801..4a51d3e16901 100644 --- a/connector/countconnector/testdata/metrics/default_attribute_value.yaml +++ b/connector/countconnector/testdata/metrics/default_attribute_value.yaml @@ -1,12 +1,5 @@ resourceMetrics: - - resource: - attributes: - - key: resource.required - value: - stringValue: foo - - key: resource.optional - value: - stringValue: bar + - resource: {} scopeMetrics: - metrics: - description: Data point count by attribute with default @@ -16,30 +9,16 @@ resourceMetrics: dataPoints: - asInt: "6" attributes: - - key: datapoint.required - value: - stringValue: foo - - key: datapoint.optional - value: - stringValue: notbar - timeUnixNano: "1678391923822404000" - - asInt: "6" - attributes: - - key: datapoint.required - value: - stringValue: notfoo - key: datapoint.optional value: stringValue: other - timeUnixNano: "1678391923822404000" + timeUnixNano: "1000000" - asInt: "6" attributes: - - key: datapoint.required - value: - stringValue: foo - key: datapoint.optional value: stringValue: bar +<<<<<<< HEAD timeUnixNano: "1678391923822404000" isMonotonic: true scope: @@ -61,31 +40,30 @@ resourceMetrics: dataPoints: - asInt: "6" attributes: +======= +>>>>>>> 6ba58ec472 (update testdata with new expected results) - key: datapoint.required value: stringValue: foo - - key: datapoint.optional - value: - stringValue: bar - timeUnixNano: "1678391923822416000" + timeUnixNano: "1000000" - asInt: "6" attributes: - - key: datapoint.required - value: - stringValue: foo - key: datapoint.optional value: stringValue: notbar - timeUnixNano: "1678391923822416000" - - asInt: "6" - attributes: - key: datapoint.required value: - stringValue: notfoo + stringValue: foo + timeUnixNano: "1000000" + - asInt: "6" + attributes: - key: datapoint.optional value: stringValue: other - timeUnixNano: "1678391923822416000" + - key: datapoint.required + value: + stringValue: notfoo + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector @@ -103,35 +81,77 @@ resourceMetrics: dataPoints: - asInt: "6" attributes: - - key: datapoint.required - value: - stringValue: foo - key: datapoint.optional value: - stringValue: bar - timeUnixNano: "1678391923822426000" + stringValue: other + timeUnixNano: "1000000" - asInt: "6" attributes: + - key: datapoint.optional + value: + stringValue: bar - key: datapoint.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "6" + attributes: - key: datapoint.optional value: stringValue: notbar - timeUnixNano: "1678391923822426000" + - key: datapoint.required + value: + stringValue: foo + timeUnixNano: "1000000" - asInt: "6" attributes: + - key: datapoint.optional + value: + stringValue: other - key: datapoint.required value: stringValue: notfoo + timeUnixNano: "1000000" + isMonotonic: true + scope: +<<<<<<< HEAD + name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector + - resource: {} +======= + name: otelcol/countconnector + - resource: + attributes: + - key: resource.int + value: + intValue: "1" + - key: resource.optional_int + value: + intValue: "2" + scopeMetrics: + - metrics: + - description: Data point count by attribute with default + name: datapoint.count.by_attr + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "24" + attributes: - key: datapoint.optional value: stringValue: other - timeUnixNano: "1678391923822426000" + timeUnixNano: "1000000" isMonotonic: true scope: - name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector - - resource: {} + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: bar + - key: resource.required + value: + stringValue: foo +>>>>>>> 6ba58ec472 (update testdata with new expected results) scopeMetrics: - metrics: - description: Data point count by attribute with default @@ -141,31 +161,88 @@ resourceMetrics: dataPoints: - asInt: "6" attributes: + - key: datapoint.optional + value: + stringValue: other + timeUnixNano: "1000000" + - asInt: "6" + attributes: + - key: datapoint.optional + value: + stringValue: bar - key: datapoint.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "6" + attributes: - key: datapoint.optional value: stringValue: notbar - timeUnixNano: "1678391923822435000" + - key: datapoint.required + value: + stringValue: foo + timeUnixNano: "1000000" - asInt: "6" attributes: + - key: datapoint.optional + value: + stringValue: other - key: datapoint.required value: stringValue: notfoo + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: notbar + - key: resource.required + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: Data point count by attribute with default + name: datapoint.count.by_attr + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "6" + attributes: - key: datapoint.optional value: stringValue: other - timeUnixNano: "1678391923822435000" + timeUnixNano: "1000000" - asInt: "6" attributes: + - key: datapoint.optional + value: + stringValue: bar - key: datapoint.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "6" + attributes: - key: datapoint.optional value: - stringValue: bar - timeUnixNano: "1678391923822435000" + stringValue: notbar + - key: datapoint.required + value: + stringValue: foo + timeUnixNano: "1000000" + - asInt: "6" + attributes: + - key: datapoint.optional + value: + stringValue: other + - key: datapoint.required + value: + stringValue: notfoo + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector diff --git a/connector/countconnector/testdata/metrics/default_int_attribute_value.yaml b/connector/countconnector/testdata/metrics/default_int_attribute_value.yaml index f96a2567b099..c39064b66aba 100644 --- a/connector/countconnector/testdata/metrics/default_int_attribute_value.yaml +++ b/connector/countconnector/testdata/metrics/default_int_attribute_value.yaml @@ -1,52 +1,147 @@ resourceMetrics: + - resource: {} + scopeMetrics: + - metrics: + - description: Data point count by default int attribute + name: datapoint.count.by_attr + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "24" + attributes: + - key: datapoint.optional_int + value: + intValue: "10" + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: otelcol/countconnector + - resource: + attributes: + - key: resource.required + value: + stringValue: notfoo + scopeMetrics: + - metrics: + - description: Data point count by default int attribute + name: datapoint.count.by_attr + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "24" + attributes: + - key: datapoint.optional_int + value: + intValue: "10" + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: otelcol/countconnector - resource: attributes: - key: resource.int value: - intValue: 1 + intValue: "1" - key: resource.optional_int value: - intValue: 2 + intValue: "2" scopeMetrics: - metrics: - description: Data point count by default int attribute name: datapoint.count.by_attr sum: aggregationTemporality: 1 - dataPoints: - - asInt: "1" + dataPoints: + - asInt: "6" + attributes: + - key: datapoint.optional_int + value: + intValue: "10" + timeUnixNano: "1000000" + - asInt: "6" attributes: - key: datapoint.int value: - intValue: 10 + intValue: "1" - key: datapoint.optional_int value: - intValue: 4 + intValue: "2" + timeUnixNano: "1000000" - asInt: "5" attributes: - key: datapoint.int value: - intValue: 1 + intValue: "1" - key: datapoint.optional_int value: - intValue: 4 + intValue: "4" + timeUnixNano: "1000000" - asInt: "6" attributes: - key: datapoint.int value: - intValue: 1 + intValue: "10" - key: datapoint.optional_int value: - intValue: 2 - - asInt: "6" + intValue: "10" + timeUnixNano: "1000000" + - asInt: "1" attributes: - key: datapoint.int value: - intValue: 10 + intValue: "10" + - key: datapoint.optional_int + value: + intValue: "4" + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: bar + - key: resource.required + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: Data point count by default int attribute + name: datapoint.count.by_attr + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "24" + attributes: + - key: datapoint.optional_int + value: + intValue: "10" + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: notbar + - key: resource.required + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: Data point count by default int attribute + name: datapoint.count.by_attr + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "24" + attributes: - key: datapoint.optional_int value: - intValue: 10 - timeUnixNano: "1678391923821179000" + intValue: "10" + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector diff --git a/connector/countconnector/testdata/metrics/int_attribute_value.yaml b/connector/countconnector/testdata/metrics/int_attribute_value.yaml index 6bec737c76ce..126694748080 100644 --- a/connector/countconnector/testdata/metrics/int_attribute_value.yaml +++ b/connector/countconnector/testdata/metrics/int_attribute_value.yaml @@ -1,12 +1,42 @@ resourceMetrics: + - resource: {} + scopeMetrics: + - metrics: + - description: Data point count by int attribute + name: datapoint.count.by_attr + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "24" + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: otelcol/countconnector + - resource: + attributes: + - key: resource.required + value: + stringValue: notfoo + scopeMetrics: + - metrics: + - description: Data point count by int attribute + name: datapoint.count.by_attr + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "24" + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: otelcol/countconnector - resource: attributes: - key: resource.int value: - intValue: 1 + intValue: "1" - key: resource.optional_int value: - intValue: 2 + intValue: "2" scopeMetrics: - metrics: - description: Data point count by int attribute @@ -14,18 +44,60 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: + - asInt: "6" + timeUnixNano: "1000000" - asInt: "11" attributes: - key: datapoint.int value: - intValue: 1 - timeUnixNano: "1678391923821179000" + intValue: "1" + timeUnixNano: "1000000" - asInt: "7" attributes: - key: datapoint.int value: - intValue: 10 - timeUnixNano: "1678391923821179000" + intValue: "10" + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: bar + - key: resource.required + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: Data point count by int attribute + name: datapoint.count.by_attr + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "24" + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: notbar + - key: resource.required + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: Data point count by int attribute + name: datapoint.count.by_attr + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "24" + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector diff --git a/connector/countconnector/testdata/metrics/multiple_attributes.yaml b/connector/countconnector/testdata/metrics/multiple_attributes.yaml index ba81d6f36041..a2216d5af8a5 100644 --- a/connector/countconnector/testdata/metrics/multiple_attributes.yaml +++ b/connector/countconnector/testdata/metrics/multiple_attributes.yaml @@ -1,12 +1,5 @@ resourceMetrics: - - resource: - attributes: - - key: resource.required - value: - stringValue: foo - - key: resource.optional - value: - stringValue: bar + - resource: {} scopeMetrics: - metrics: - description: Data point count by attributes @@ -14,23 +7,29 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: + - asInt: "6" + timeUnixNano: "1000000" - asInt: "6" attributes: - key: datapoint.required value: - stringValue: foo + stringValue: notfoo + timeUnixNano: "1000000" + - asInt: "6" + attributes: - key: datapoint.optional value: stringValue: bar - timeUnixNano: "1678391923821783000" - - asInt: "6" - attributes: - key: datapoint.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "6" + attributes: - key: datapoint.optional value: stringValue: notbar +<<<<<<< HEAD timeUnixNano: "1678391923821783000" isMonotonic: true scope: @@ -52,30 +51,89 @@ resourceMetrics: dataPoints: - asInt: "6" attributes: +======= +>>>>>>> 6ba58ec472 (update testdata with new expected results) - key: datapoint.required value: stringValue: foo - - key: datapoint.optional + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector + - resource: + attributes: + - key: resource.required + value: + stringValue: notfoo + scopeMetrics: + - metrics: + - description: Data point count by attributes + name: datapoint.count.by_attr + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "6" + timeUnixNano: "1000000" + - asInt: "6" + attributes: + - key: datapoint.required value: - stringValue: bar - timeUnixNano: "1678391923821792000" + stringValue: notfoo + timeUnixNano: "1000000" - asInt: "6" attributes: + - key: datapoint.optional + value: + stringValue: bar - key: datapoint.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "6" + attributes: - key: datapoint.optional value: stringValue: notbar - timeUnixNano: "1678391923821792000" + - key: datapoint.required + value: + stringValue: foo + timeUnixNano: "1000000" isMonotonic: true scope: +<<<<<<< HEAD name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector + - resource: {} +======= + name: otelcol/countconnector + - resource: + attributes: + - key: resource.int + value: + intValue: "1" + - key: resource.optional_int + value: + intValue: "2" + scopeMetrics: + - metrics: + - description: Data point count by attributes + name: datapoint.count.by_attr + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "24" + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: otelcol/countconnector - resource: attributes: + - key: resource.optional + value: + stringValue: bar - key: resource.required value: - stringValue: notfoo + stringValue: foo +>>>>>>> 6ba58ec472 (update testdata with new expected results) scopeMetrics: - metrics: - description: Data point count by attributes @@ -83,28 +141,43 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: + - asInt: "6" + timeUnixNano: "1000000" - asInt: "6" attributes: - key: datapoint.required value: - stringValue: foo + stringValue: notfoo + timeUnixNano: "1000000" + - asInt: "6" + attributes: - key: datapoint.optional value: stringValue: bar - timeUnixNano: "1678391923821800000" - - asInt: "6" - attributes: - key: datapoint.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "6" + attributes: - key: datapoint.optional value: stringValue: notbar - timeUnixNano: "1678391923821800000" + - key: datapoint.required + value: + stringValue: foo + timeUnixNano: "1000000" isMonotonic: true scope: - name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector - - resource: {} + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: notbar + - key: resource.required + value: + stringValue: foo scopeMetrics: - metrics: - description: Data point count by attributes @@ -112,24 +185,32 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: + - asInt: "6" + timeUnixNano: "1000000" - asInt: "6" attributes: - key: datapoint.required value: - stringValue: foo + stringValue: notfoo + timeUnixNano: "1000000" + - asInt: "6" + attributes: - key: datapoint.optional value: stringValue: bar - timeUnixNano: "1678391923821807000" - - asInt: "6" - attributes: - key: datapoint.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "6" + attributes: - key: datapoint.optional value: stringValue: notbar - timeUnixNano: "1678391923821807000" + - key: datapoint.required + value: + stringValue: foo + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector diff --git a/connector/countconnector/testdata/metrics/multiple_conditions.yaml b/connector/countconnector/testdata/metrics/multiple_conditions.yaml index e8caf81ce729..bf9a72fbfd08 100644 --- a/connector/countconnector/testdata/metrics/multiple_conditions.yaml +++ b/connector/countconnector/testdata/metrics/multiple_conditions.yaml @@ -1,12 +1,5 @@ resourceMetrics: - - resource: - attributes: - - key: resource.required - value: - stringValue: foo - - key: resource.optional - value: - stringValue: bar + - resource: {} scopeMetrics: - metrics: - description: Metric count if ... @@ -14,14 +7,15 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: - - asInt: "6" - timeUnixNano: "1678391923819487000" + - asInt: "1" + timeUnixNano: "1000000" isMonotonic: true - description: Data point count if ... name: datapoint.count.if sum: aggregationTemporality: 1 dataPoints: +<<<<<<< HEAD - asInt: "24" timeUnixNano: "1678391923819487000" isMonotonic: true @@ -52,6 +46,10 @@ resourceMetrics: dataPoints: - asInt: "24" timeUnixNano: "1678391923819499000" +======= + - asInt: "12" + timeUnixNano: "1000000" +>>>>>>> 6ba58ec472 (update testdata with new expected results) isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector @@ -68,7 +66,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "1" - timeUnixNano: "1678391923819509000" + timeUnixNano: "1000000" isMonotonic: true - description: Data point count if ... name: datapoint.count.if @@ -76,6 +74,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "12" +<<<<<<< HEAD timeUnixNano: "1678391923819510000" isMonotonic: true scope: @@ -98,6 +97,9 @@ resourceMetrics: dataPoints: - asInt: "12" timeUnixNano: "1678391923819529000" +======= + timeUnixNano: "1000000" +>>>>>>> 6ba58ec472 (update testdata with new expected results) isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector @@ -105,10 +107,10 @@ resourceMetrics: attributes: - key: resource.int value: - intValue: 1 + intValue: "1" - key: resource.optional_int value: - intValue: 2 + intValue: "2" scopeMetrics: - metrics: - description: Metric count if ... @@ -117,7 +119,63 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "1" - timeUnixNano: "1678391923819487000" + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: bar + - key: resource.required + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: Metric count if ... + name: metric.count.if + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "6" + timeUnixNano: "1000000" + isMonotonic: true + - description: Data point count if ... + name: datapoint.count.if + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "24" + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: notbar + - key: resource.required + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: Metric count if ... + name: metric.count.if + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "6" + timeUnixNano: "1000000" + isMonotonic: true + - description: Data point count if ... + name: datapoint.count.if + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "24" + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector diff --git a/connector/countconnector/testdata/metrics/multiple_metrics.yaml b/connector/countconnector/testdata/metrics/multiple_metrics.yaml index b97c011d59f6..9018650df307 100644 --- a/connector/countconnector/testdata/metrics/multiple_metrics.yaml +++ b/connector/countconnector/testdata/metrics/multiple_metrics.yaml @@ -1,29 +1,30 @@ resourceMetrics: - - resource: - attributes: - - key: resource.required - value: - stringValue: foo - - key: resource.optional - value: - stringValue: bar + - resource: {} scopeMetrics: - metrics: + - description: Metric count if ... + name: metric.count.if + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "1" + timeUnixNano: "1000000" + isMonotonic: true - description: All metrics count name: metric.count.all sum: aggregationTemporality: 1 dataPoints: - asInt: "6" - timeUnixNano: "1678391923820453000" + timeUnixNano: "1000000" isMonotonic: true - - description: Metric count if ... - name: metric.count.if + - description: Data point count if ... + name: datapoint.count.if sum: aggregationTemporality: 1 dataPoints: - - asInt: "6" - timeUnixNano: "1678391923820453000" + - asInt: "12" + timeUnixNano: "1000000" isMonotonic: true - description: All data points count name: datapoint.count.all @@ -31,6 +32,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "24" +<<<<<<< HEAD timeUnixNano: "1678391923820453000" isMonotonic: true - description: Data point count if ... @@ -84,6 +86,9 @@ resourceMetrics: dataPoints: - asInt: "24" timeUnixNano: "1678391923820468000" +======= + timeUnixNano: "1000000" +>>>>>>> 6ba58ec472 (update testdata with new expected results) isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector @@ -94,29 +99,21 @@ resourceMetrics: stringValue: notfoo scopeMetrics: - metrics: - - description: All metrics count - name: metric.count.all - sum: - aggregationTemporality: 1 - dataPoints: - - asInt: "6" - timeUnixNano: "1678391923820480000" - isMonotonic: true - description: Metric count if ... name: metric.count.if sum: aggregationTemporality: 1 dataPoints: - asInt: "1" - timeUnixNano: "1678391923820480000" + timeUnixNano: "1000000" isMonotonic: true - - description: All data points count - name: datapoint.count.all + - description: All metrics count + name: metric.count.all sum: aggregationTemporality: 1 dataPoints: - - asInt: "24" - timeUnixNano: "1678391923820480000" + - asInt: "6" + timeUnixNano: "1000000" isMonotonic: true - description: Data point count if ... name: datapoint.count.if @@ -124,6 +121,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "12" +<<<<<<< HEAD timeUnixNano: "1678391923820480000" isMonotonic: true scope: @@ -146,6 +144,9 @@ resourceMetrics: dataPoints: - asInt: "1" timeUnixNano: "1678391923820491000" +======= + timeUnixNano: "1000000" +>>>>>>> 6ba58ec472 (update testdata with new expected results) isMonotonic: true - description: All data points count name: datapoint.count.all @@ -153,43 +154,123 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "24" - timeUnixNano: "1678391923820491000" + timeUnixNano: "1000000" isMonotonic: true - - description: Data point count if ... - name: datapoint.count.if + scope: + name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector + - resource: + attributes: + - key: resource.int + value: + intValue: "1" + - key: resource.optional_int + value: + intValue: "2" + scopeMetrics: + - metrics: + - description: Metric count if ... + name: metric.count.if sum: aggregationTemporality: 1 dataPoints: - - asInt: "12" - timeUnixNano: "1678391923820491000" + - asInt: "1" + timeUnixNano: "1000000" + isMonotonic: true + - description: All metrics count + name: metric.count.all + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "6" + timeUnixNano: "1000000" + isMonotonic: true + - description: All data points count + name: datapoint.count.all + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "24" + timeUnixNano: "1000000" isMonotonic: true scope: - name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector + name: otelcol/countconnector - resource: attributes: - - key: resource.int + - key: resource.optional value: - intValue: 1 - - key: resource.optional_int + stringValue: bar + - key: resource.required value: - intValue: 2 + stringValue: foo scopeMetrics: - metrics: + - description: Metric count if ... + name: metric.count.if + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "6" + timeUnixNano: "1000000" + isMonotonic: true - description: All metrics count name: metric.count.all sum: aggregationTemporality: 1 dataPoints: - asInt: "6" - timeUnixNano: "1678391923820480000" + timeUnixNano: "1000000" + isMonotonic: true + - description: Data point count if ... + name: datapoint.count.if + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "24" + timeUnixNano: "1000000" isMonotonic: true + - description: All data points count + name: datapoint.count.all + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "24" + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: notbar + - key: resource.required + value: + stringValue: foo + scopeMetrics: + - metrics: - description: Metric count if ... name: metric.count.if sum: aggregationTemporality: 1 dataPoints: - - asInt: "1" - timeUnixNano: "1678391923820480000" + - asInt: "6" + timeUnixNano: "1000000" + isMonotonic: true + - description: All metrics count + name: metric.count.all + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "6" + timeUnixNano: "1000000" + isMonotonic: true + - description: Data point count if ... + name: datapoint.count.if + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "24" + timeUnixNano: "1000000" isMonotonic: true - description: All data points count name: datapoint.count.all @@ -197,7 +278,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "24" - timeUnixNano: "1678391923820480000" + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector diff --git a/connector/countconnector/testdata/metrics/one_attribute.yaml b/connector/countconnector/testdata/metrics/one_attribute.yaml index c19d07a3d464..8bd04e4cb65f 100644 --- a/connector/countconnector/testdata/metrics/one_attribute.yaml +++ b/connector/countconnector/testdata/metrics/one_attribute.yaml @@ -1,12 +1,5 @@ resourceMetrics: - - resource: - attributes: - - key: resource.required - value: - stringValue: foo - - key: resource.optional - value: - stringValue: bar + - resource: {} scopeMetrics: - metrics: - description: Data point count by attribute @@ -14,17 +7,20 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: + - asInt: "6" + timeUnixNano: "1000000" - asInt: "12" attributes: - key: datapoint.required value: stringValue: foo - timeUnixNano: "1678391923821179000" + timeUnixNano: "1000000" - asInt: "6" attributes: - key: datapoint.required value: stringValue: notfoo +<<<<<<< HEAD timeUnixNano: "1678391923821179000" isMonotonic: true scope: @@ -56,6 +52,9 @@ resourceMetrics: value: stringValue: notfoo timeUnixNano: "1678391923821189000" +======= + timeUnixNano: "1000000" +>>>>>>> 6ba58ec472 (update testdata with new expected results) isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector @@ -71,22 +70,56 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: + - asInt: "6" + timeUnixNano: "1000000" - asInt: "12" attributes: - key: datapoint.required value: stringValue: foo - timeUnixNano: "1678391923821196000" + timeUnixNano: "1000000" - asInt: "6" attributes: - key: datapoint.required value: stringValue: notfoo - timeUnixNano: "1678391923821196000" + timeUnixNano: "1000000" isMonotonic: true scope: +<<<<<<< HEAD name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector - resource: {} +======= + name: otelcol/countconnector + - resource: + attributes: + - key: resource.int + value: + intValue: "1" + - key: resource.optional_int + value: + intValue: "2" +>>>>>>> 6ba58ec472 (update testdata with new expected results) + scopeMetrics: + - metrics: + - description: Data point count by attribute + name: datapoint.count.by_attr + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "24" + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: bar + - key: resource.required + value: + stringValue: foo scopeMetrics: - metrics: - description: Data point count by attribute @@ -94,18 +127,52 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: + - asInt: "6" + timeUnixNano: "1000000" + - asInt: "12" + attributes: + - key: datapoint.required + value: + stringValue: foo + timeUnixNano: "1000000" + - asInt: "6" + attributes: + - key: datapoint.required + value: + stringValue: notfoo + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: notbar + - key: resource.required + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: Data point count by attribute + name: datapoint.count.by_attr + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "6" + timeUnixNano: "1000000" - asInt: "12" attributes: - key: datapoint.required value: stringValue: foo - timeUnixNano: "1678391923821203000" + timeUnixNano: "1000000" - asInt: "6" attributes: - key: datapoint.required value: stringValue: notfoo - timeUnixNano: "1678391923821203000" + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector diff --git a/connector/countconnector/testdata/metrics/one_condition.yaml b/connector/countconnector/testdata/metrics/one_condition.yaml index e2af08664333..cdbf012486aa 100644 --- a/connector/countconnector/testdata/metrics/one_condition.yaml +++ b/connector/countconnector/testdata/metrics/one_condition.yaml @@ -1,12 +1,12 @@ resourceMetrics: - resource: attributes: - - key: resource.required - value: - stringValue: foo - key: resource.optional value: stringValue: bar + - key: resource.required + value: + stringValue: foo scopeMetrics: - metrics: - description: Metric count if ... @@ -15,7 +15,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "6" - timeUnixNano: "1678391923818482000" + timeUnixNano: "1000000" isMonotonic: true - description: Data point count if ... name: datapoint.count.if @@ -23,18 +23,18 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "24" - timeUnixNano: "1678391923818482000" + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector - resource: attributes: - - key: resource.required - value: - stringValue: foo - key: resource.optional value: stringValue: notbar + - key: resource.required + value: + stringValue: foo scopeMetrics: - metrics: - description: Metric count if ... @@ -43,7 +43,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "6" - timeUnixNano: "1678391923818549000" + timeUnixNano: "1000000" isMonotonic: true - description: Data point count if ... name: datapoint.count.if @@ -51,7 +51,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "24" - timeUnixNano: "1678391923818549000" + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector diff --git a/connector/countconnector/testdata/metrics/zero_conditions.yaml b/connector/countconnector/testdata/metrics/zero_conditions.yaml index 58477be59855..d7702aed7c12 100644 --- a/connector/countconnector/testdata/metrics/zero_conditions.yaml +++ b/connector/countconnector/testdata/metrics/zero_conditions.yaml @@ -1,12 +1,5 @@ resourceMetrics: - - resource: - attributes: - - key: resource.required - value: - stringValue: foo - - key: resource.optional - value: - stringValue: bar + - resource: {} scopeMetrics: - metrics: - description: The number of metrics observed. @@ -15,7 +8,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "6" - timeUnixNano: "1678391923815881000" + timeUnixNano: "1000000" isMonotonic: true - description: The number of data points observed. name: metric.datapoint.count @@ -23,6 +16,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "24" +<<<<<<< HEAD timeUnixNano: "1678391923815881000" isMonotonic: true scope: @@ -52,6 +46,9 @@ resourceMetrics: dataPoints: - asInt: "24" timeUnixNano: "1678391923815923000" +======= + timeUnixNano: "1000000" +>>>>>>> 6ba58ec472 (update testdata with new expected results) isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector @@ -68,7 +65,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "6" - timeUnixNano: "1678391923815929000" + timeUnixNano: "1000000" isMonotonic: true - description: The number of data points observed. name: metric.datapoint.count @@ -76,6 +73,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "24" +<<<<<<< HEAD timeUnixNano: "1678391923815929000" isMonotonic: true scope: @@ -98,6 +96,9 @@ resourceMetrics: dataPoints: - asInt: "24" timeUnixNano: "1678391923815933000" +======= + timeUnixNano: "1000000" +>>>>>>> 6ba58ec472 (update testdata with new expected results) isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector @@ -105,10 +106,10 @@ resourceMetrics: attributes: - key: resource.int value: - intValue: 1 + intValue: "1" - key: resource.optional_int value: - intValue: 2 + intValue: "2" scopeMetrics: - metrics: - description: The number of metrics observed. @@ -117,7 +118,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "6" - timeUnixNano: "1678391923815929000" + timeUnixNano: "1000000" isMonotonic: true - description: The number of data points observed. name: metric.datapoint.count @@ -125,7 +126,63 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "24" - timeUnixNano: "1678391923815929000" + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: bar + - key: resource.required + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: The number of metrics observed. + name: metric.count + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "6" + timeUnixNano: "1000000" + isMonotonic: true + - description: The number of data points observed. + name: metric.datapoint.count + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "24" + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: notbar + - key: resource.required + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: The number of metrics observed. + name: metric.count + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "6" + timeUnixNano: "1000000" + isMonotonic: true + - description: The number of data points observed. + name: metric.datapoint.count + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "24" + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector diff --git a/connector/countconnector/testdata/traces/condition_and_attribute.yaml b/connector/countconnector/testdata/traces/condition_and_attribute.yaml index ae639b75daa5..e2fd3bde6bd3 100644 --- a/connector/countconnector/testdata/traces/condition_and_attribute.yaml +++ b/connector/countconnector/testdata/traces/condition_and_attribute.yaml @@ -1,12 +1,12 @@ resourceMetrics: - resource: attributes: - - key: resource.required - value: - stringValue: foo - key: resource.optional value: stringValue: bar + - key: resource.required + value: + stringValue: foo scopeMetrics: - metrics: - description: Span count if ... @@ -14,47 +14,51 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: + - asInt: "1" + timeUnixNano: "1000000" - asInt: "2" attributes: - key: span.required value: stringValue: foo - timeUnixNano: "1678392127929005000" + timeUnixNano: "1000000" - asInt: "1" attributes: - key: span.required value: stringValue: notfoo - timeUnixNano: "1678392127929005000" + timeUnixNano: "1000000" isMonotonic: true - description: Span event count by attribute if ... name: spanevent.count.if.by_attr sum: aggregationTemporality: 1 dataPoints: + - asInt: "4" + timeUnixNano: "1000000" - asInt: "8" attributes: - key: event.required value: stringValue: foo - timeUnixNano: "1678392127929006000" + timeUnixNano: "1000000" - asInt: "4" attributes: - key: event.required value: stringValue: notfoo - timeUnixNano: "1678392127929006000" + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector - resource: attributes: - - key: resource.required - value: - stringValue: foo - key: resource.optional value: stringValue: notbar + - key: resource.required + value: + stringValue: foo scopeMetrics: - metrics: - description: Span count if ... @@ -62,36 +66,40 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: + - asInt: "1" + timeUnixNano: "1000000" - asInt: "2" attributes: - key: span.required value: stringValue: foo - timeUnixNano: "1678392127929018000" + timeUnixNano: "1000000" - asInt: "1" attributes: - key: span.required value: stringValue: notfoo - timeUnixNano: "1678392127929018000" + timeUnixNano: "1000000" isMonotonic: true - description: Span event count by attribute if ... name: spanevent.count.if.by_attr sum: aggregationTemporality: 1 dataPoints: + - asInt: "4" + timeUnixNano: "1000000" - asInt: "8" attributes: - key: event.required value: stringValue: foo - timeUnixNano: "1678392127929018000" + timeUnixNano: "1000000" - asInt: "4" attributes: - key: event.required value: stringValue: notfoo - timeUnixNano: "1678392127929018000" + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector diff --git a/connector/countconnector/testdata/traces/default_attribute_value.yaml b/connector/countconnector/testdata/traces/default_attribute_value.yaml index 07207339c2ff..2a316ed0a49a 100644 --- a/connector/countconnector/testdata/traces/default_attribute_value.yaml +++ b/connector/countconnector/testdata/traces/default_attribute_value.yaml @@ -1,12 +1,5 @@ resourceMetrics: - - resource: - attributes: - - key: resource.required - value: - stringValue: foo - - key: resource.optional - value: - stringValue: bar + - resource: {} scopeMetrics: - metrics: - description: Span count by attribute with default @@ -16,31 +9,37 @@ resourceMetrics: dataPoints: - asInt: "1" attributes: - - key: span.required - value: - stringValue: notfoo - key: span.optional value: stringValue: other - timeUnixNano: "1678392127927843000" + timeUnixNano: "1000000" - asInt: "1" attributes: - - key: span.required - value: - stringValue: foo - key: span.optional value: stringValue: bar - timeUnixNano: "1678392127927843000" + - key: span.required + value: + stringValue: foo + timeUnixNano: "1000000" - asInt: "1" attributes: + - key: span.optional + value: + stringValue: notbar - key: span.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "1" + attributes: - key: span.optional value: - stringValue: notbar - timeUnixNano: "1678392127927843000" + stringValue: other + - key: span.required + value: + stringValue: notfoo + timeUnixNano: "1000000" isMonotonic: true - description: Span event count by attribute with default name: spanevent.count.by_attr @@ -49,30 +48,10 @@ resourceMetrics: dataPoints: - asInt: "4" attributes: - - key: event.required - value: - stringValue: foo - - key: event.optional - value: - stringValue: bar - timeUnixNano: "1678392127927843000" - - asInt: "4" - attributes: - - key: event.required - value: - stringValue: foo - - key: event.optional - value: - stringValue: notbar - timeUnixNano: "1678392127927843000" - - asInt: "4" - attributes: - - key: event.required - value: - stringValue: notfoo - key: event.optional value: stringValue: other +<<<<<<< HEAD timeUnixNano: "1678392127927843000" isMonotonic: true scope: @@ -125,33 +104,36 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: +======= + timeUnixNano: "1000000" +>>>>>>> 6ba58ec472 (update testdata with new expected results) - asInt: "4" attributes: - - key: event.required - value: - stringValue: foo - key: event.optional value: stringValue: bar - timeUnixNano: "1678392127927856000" - - asInt: "4" - attributes: - key: event.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "4" + attributes: - key: event.optional value: stringValue: notbar - timeUnixNano: "1678392127927856000" - - asInt: "4" - attributes: - key: event.required value: - stringValue: notfoo + stringValue: foo + timeUnixNano: "1000000" + - asInt: "4" + attributes: - key: event.optional value: stringValue: other - timeUnixNano: "1678392127927856000" + - key: event.required + value: + stringValue: notfoo + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector @@ -169,31 +151,37 @@ resourceMetrics: dataPoints: - asInt: "1" attributes: - - key: span.required - value: - stringValue: foo - key: span.optional value: - stringValue: bar - timeUnixNano: "1678392127927865000" + stringValue: other + timeUnixNano: "1000000" - asInt: "1" attributes: + - key: span.optional + value: + stringValue: bar - key: span.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "1" + attributes: - key: span.optional value: stringValue: notbar - timeUnixNano: "1678392127927865000" - - asInt: "1" - attributes: - key: span.required value: - stringValue: notfoo + stringValue: foo + timeUnixNano: "1000000" + - asInt: "1" + attributes: - key: span.optional value: stringValue: other - timeUnixNano: "1678392127927865000" + - key: span.required + value: + stringValue: notfoo + timeUnixNano: "1000000" isMonotonic: true - description: Span event count by attribute with default name: spanevent.count.by_attr @@ -202,35 +190,53 @@ resourceMetrics: dataPoints: - asInt: "4" attributes: - - key: event.required - value: - stringValue: foo - key: event.optional value: - stringValue: bar - timeUnixNano: "1678392127927865000" + stringValue: other + timeUnixNano: "1000000" - asInt: "4" attributes: + - key: event.optional + value: + stringValue: bar - key: event.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "4" + attributes: - key: event.optional value: stringValue: notbar - timeUnixNano: "1678392127927865000" - - asInt: "4" - attributes: - key: event.required value: - stringValue: notfoo + stringValue: foo + timeUnixNano: "1000000" + - asInt: "4" + attributes: - key: event.optional value: stringValue: other - timeUnixNano: "1678392127927865000" + - key: event.required + value: + stringValue: notfoo + timeUnixNano: "1000000" isMonotonic: true scope: +<<<<<<< HEAD name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector - resource: {} +======= + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: bar + - key: resource.required + value: + stringValue: foo +>>>>>>> 6ba58ec472 (update testdata with new expected results) scopeMetrics: - metrics: - description: Span count by attribute with default @@ -240,31 +246,37 @@ resourceMetrics: dataPoints: - asInt: "1" attributes: - - key: span.required - value: - stringValue: foo - key: span.optional value: - stringValue: bar - timeUnixNano: "1678392127927874000" + stringValue: other + timeUnixNano: "1000000" - asInt: "1" attributes: + - key: span.optional + value: + stringValue: bar - key: span.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "1" + attributes: - key: span.optional value: stringValue: notbar - timeUnixNano: "1678392127927874000" - - asInt: "1" - attributes: - key: span.required value: - stringValue: notfoo + stringValue: foo + timeUnixNano: "1000000" + - asInt: "1" + attributes: - key: span.optional value: stringValue: other - timeUnixNano: "1678392127927874000" + - key: span.required + value: + stringValue: notfoo + timeUnixNano: "1000000" isMonotonic: true - description: Span event count by attribute with default name: spanevent.count.by_attr @@ -273,31 +285,127 @@ resourceMetrics: dataPoints: - asInt: "4" attributes: - - key: event.required + - key: event.optional value: - stringValue: foo + stringValue: other + timeUnixNano: "1000000" + - asInt: "4" + attributes: - key: event.optional value: stringValue: bar - timeUnixNano: "1678392127927874000" + - key: event.required + value: + stringValue: foo + timeUnixNano: "1000000" - asInt: "4" attributes: + - key: event.optional + value: + stringValue: notbar - key: event.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "4" + attributes: - key: event.optional + value: + stringValue: other + - key: event.required + value: + stringValue: notfoo + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: notbar + - key: resource.required + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: Span count by attribute with default + name: span.count.by_attr + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "1" + attributes: + - key: span.optional + value: + stringValue: other + timeUnixNano: "1000000" + - asInt: "1" + attributes: + - key: span.optional + value: + stringValue: bar + - key: span.required + value: + stringValue: foo + timeUnixNano: "1000000" + - asInt: "1" + attributes: + - key: span.optional value: stringValue: notbar - timeUnixNano: "1678392127927874000" + - key: span.required + value: + stringValue: foo + timeUnixNano: "1000000" + - asInt: "1" + attributes: + - key: span.optional + value: + stringValue: other + - key: span.required + value: + stringValue: notfoo + timeUnixNano: "1000000" + isMonotonic: true + - description: Span event count by attribute with default + name: spanevent.count.by_attr + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "4" + attributes: + - key: event.optional + value: + stringValue: other + timeUnixNano: "1000000" - asInt: "4" attributes: + - key: event.optional + value: + stringValue: bar - key: event.required value: - stringValue: notfoo + stringValue: foo + timeUnixNano: "1000000" + - asInt: "4" + attributes: + - key: event.optional + value: + stringValue: notbar + - key: event.required + value: + stringValue: foo + timeUnixNano: "1000000" + - asInt: "4" + attributes: - key: event.optional value: stringValue: other - timeUnixNano: "1678392127927874000" + - key: event.required + value: + stringValue: notfoo + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector diff --git a/connector/countconnector/testdata/traces/multiple_attributes.yaml b/connector/countconnector/testdata/traces/multiple_attributes.yaml index dcfc3450f3bd..73f96ab564f9 100644 --- a/connector/countconnector/testdata/traces/multiple_attributes.yaml +++ b/connector/countconnector/testdata/traces/multiple_attributes.yaml @@ -1,12 +1,5 @@ resourceMetrics: - - resource: - attributes: - - key: resource.required - value: - stringValue: foo - - key: resource.optional - value: - stringValue: bar + - resource: {} scopeMetrics: - metrics: - description: Span count by attributes @@ -14,24 +7,32 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: + - asInt: "1" + timeUnixNano: "1000000" - asInt: "1" attributes: - key: span.required value: - stringValue: foo - - key: span.optional - value: - stringValue: notbar - timeUnixNano: "1678392127926637000" + stringValue: notfoo + timeUnixNano: "1000000" - asInt: "1" attributes: + - key: span.optional + value: + stringValue: bar - key: span.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "1" + attributes: - key: span.optional value: - stringValue: bar - timeUnixNano: "1678392127926637000" + stringValue: notbar + - key: span.required + value: + stringValue: foo + timeUnixNano: "1000000" isMonotonic: true - description: Span event count by attributes name: spanevent.count.by_attr @@ -39,18 +40,12 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "4" - attributes: - - key: event.required - value: - stringValue: foo - - key: event.optional - value: - stringValue: bar - timeUnixNano: "1678392127926637000" + timeUnixNano: "1000000" - asInt: "4" attributes: - key: event.required value: +<<<<<<< HEAD stringValue: foo - key: event.optional value: @@ -98,24 +93,28 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: +======= + stringValue: notfoo + timeUnixNano: "1000000" +>>>>>>> 6ba58ec472 (update testdata with new expected results) - asInt: "4" attributes: - - key: event.required - value: - stringValue: foo - key: event.optional value: stringValue: bar - timeUnixNano: "1678392127926647000" - - asInt: "4" - attributes: - key: event.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "4" + attributes: - key: event.optional value: stringValue: notbar - timeUnixNano: "1678392127926647000" + - key: event.required + value: + stringValue: foo + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector @@ -131,52 +130,80 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: + - asInt: "1" + timeUnixNano: "1000000" - asInt: "1" attributes: - key: span.required value: - stringValue: foo + stringValue: notfoo + timeUnixNano: "1000000" + - asInt: "1" + attributes: - key: span.optional value: stringValue: bar - timeUnixNano: "1678392127926654000" - - asInt: "1" - attributes: - key: span.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "1" + attributes: - key: span.optional value: stringValue: notbar - timeUnixNano: "1678392127926654000" + - key: span.required + value: + stringValue: foo + timeUnixNano: "1000000" isMonotonic: true - description: Span event count by attributes name: spanevent.count.by_attr sum: aggregationTemporality: 1 dataPoints: + - asInt: "4" + timeUnixNano: "1000000" - asInt: "4" attributes: - key: event.required value: - stringValue: foo + stringValue: notfoo + timeUnixNano: "1000000" + - asInt: "4" + attributes: - key: event.optional value: stringValue: bar - timeUnixNano: "1678392127926654000" - - asInt: "4" - attributes: - key: event.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "4" + attributes: - key: event.optional value: stringValue: notbar - timeUnixNano: "1678392127926654000" + - key: event.required + value: + stringValue: foo + timeUnixNano: "1000000" isMonotonic: true scope: +<<<<<<< HEAD name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector - resource: {} +======= + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: bar + - key: resource.required + value: + stringValue: foo +>>>>>>> 6ba58ec472 (update testdata with new expected results) scopeMetrics: - metrics: - description: Span count by attributes @@ -184,48 +211,140 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: + - asInt: "1" + timeUnixNano: "1000000" - asInt: "1" attributes: - key: span.required value: - stringValue: foo + stringValue: notfoo + timeUnixNano: "1000000" + - asInt: "1" + attributes: - key: span.optional value: stringValue: bar - timeUnixNano: "1678392127926661000" - - asInt: "1" - attributes: - key: span.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "1" + attributes: - key: span.optional value: stringValue: notbar - timeUnixNano: "1678392127926661000" + - key: span.required + value: + stringValue: foo + timeUnixNano: "1000000" isMonotonic: true - description: Span event count by attributes name: spanevent.count.by_attr sum: aggregationTemporality: 1 dataPoints: + - asInt: "4" + timeUnixNano: "1000000" + - asInt: "4" + attributes: + - key: event.required + value: + stringValue: notfoo + timeUnixNano: "1000000" - asInt: "4" attributes: + - key: event.optional + value: + stringValue: bar - key: event.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "4" + attributes: - key: event.optional + value: + stringValue: notbar + - key: event.required + value: + stringValue: foo + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: notbar + - key: resource.required + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: Span count by attributes + name: span.count.by_attr + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "1" + timeUnixNano: "1000000" + - asInt: "1" + attributes: + - key: span.required + value: + stringValue: notfoo + timeUnixNano: "1000000" + - asInt: "1" + attributes: + - key: span.optional value: stringValue: bar - timeUnixNano: "1678392127926661000" + - key: span.required + value: + stringValue: foo + timeUnixNano: "1000000" + - asInt: "1" + attributes: + - key: span.optional + value: + stringValue: notbar + - key: span.required + value: + stringValue: foo + timeUnixNano: "1000000" + isMonotonic: true + - description: Span event count by attributes + name: spanevent.count.by_attr + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "4" + timeUnixNano: "1000000" - asInt: "4" attributes: + - key: event.required + value: + stringValue: notfoo + timeUnixNano: "1000000" + - asInt: "4" + attributes: + - key: event.optional + value: + stringValue: bar - key: event.required value: stringValue: foo + timeUnixNano: "1000000" + - asInt: "4" + attributes: - key: event.optional value: stringValue: notbar - timeUnixNano: "1678392127926661000" + - key: event.required + value: + stringValue: foo + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector diff --git a/connector/countconnector/testdata/traces/multiple_conditions.yaml b/connector/countconnector/testdata/traces/multiple_conditions.yaml index 2ae2b7978e83..ea84be361148 100644 --- a/connector/countconnector/testdata/traces/multiple_conditions.yaml +++ b/connector/countconnector/testdata/traces/multiple_conditions.yaml @@ -1,12 +1,5 @@ resourceMetrics: - - resource: - attributes: - - key: resource.required - value: - stringValue: foo - - key: resource.optional - value: - stringValue: bar + - resource: {} scopeMetrics: - metrics: - description: Span count if ... @@ -14,14 +7,15 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: - - asInt: "4" - timeUnixNano: "1678392127923826000" + - asInt: "2" + timeUnixNano: "1000000" isMonotonic: true - description: Span event count if ... name: spanevent.count.if sum: aggregationTemporality: 1 dataPoints: +<<<<<<< HEAD - asInt: "16" timeUnixNano: "1678392127923826000" isMonotonic: true @@ -52,6 +46,10 @@ resourceMetrics: dataPoints: - asInt: "16" timeUnixNano: "1678392127923836000" +======= + - asInt: "8" + timeUnixNano: "1000000" +>>>>>>> 6ba58ec472 (update testdata with new expected results) isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector @@ -68,7 +66,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "2" - timeUnixNano: "1678392127923843000" + timeUnixNano: "1000000" isMonotonic: true - description: Span event count if ... name: spanevent.count.if @@ -76,11 +74,23 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "8" - timeUnixNano: "1678392127923843000" + timeUnixNano: "1000000" isMonotonic: true scope: +<<<<<<< HEAD name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector - resource: {} +======= + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: bar + - key: resource.required + value: + stringValue: foo +>>>>>>> 6ba58ec472 (update testdata with new expected results) scopeMetrics: - metrics: - description: Span count if ... @@ -88,16 +98,44 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: - - asInt: "2" - timeUnixNano: "1678392127923849000" + - asInt: "4" + timeUnixNano: "1000000" isMonotonic: true - description: Span event count if ... name: spanevent.count.if sum: aggregationTemporality: 1 dataPoints: - - asInt: "8" - timeUnixNano: "1678392127923849000" + - asInt: "16" + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: notbar + - key: resource.required + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: Span count if ... + name: span.count.if + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "4" + timeUnixNano: "1000000" + isMonotonic: true + - description: Span event count if ... + name: spanevent.count.if + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "16" + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector diff --git a/connector/countconnector/testdata/traces/multiple_metrics.yaml b/connector/countconnector/testdata/traces/multiple_metrics.yaml index 5cb4a710c3dd..023234404a49 100644 --- a/connector/countconnector/testdata/traces/multiple_metrics.yaml +++ b/connector/countconnector/testdata/traces/multiple_metrics.yaml @@ -1,12 +1,5 @@ resourceMetrics: - - resource: - attributes: - - key: resource.required - value: - stringValue: foo - - key: resource.optional - value: - stringValue: bar + - resource: {} scopeMetrics: - metrics: - description: All spans count @@ -15,15 +8,15 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "4" - timeUnixNano: "1678392127924753000" + timeUnixNano: "1000000" isMonotonic: true - description: Span count if ... name: span.count.if sum: aggregationTemporality: 1 dataPoints: - - asInt: "4" - timeUnixNano: "1678392127924753000" + - asInt: "2" + timeUnixNano: "1000000" isMonotonic: true - description: All span events count name: spanevent.count.all @@ -31,13 +24,14 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "16" - timeUnixNano: "1678392127924753000" + timeUnixNano: "1000000" isMonotonic: true - description: Span event count if ... name: spanevent.count.if sum: aggregationTemporality: 1 dataPoints: +<<<<<<< HEAD - asInt: "16" timeUnixNano: "1678392127924753000" isMonotonic: true @@ -84,6 +78,10 @@ resourceMetrics: dataPoints: - asInt: "16" timeUnixNano: "1678392127924764000" +======= + - asInt: "8" + timeUnixNano: "1000000" +>>>>>>> 6ba58ec472 (update testdata with new expected results) isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector @@ -100,7 +98,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "4" - timeUnixNano: "1678392127924772000" + timeUnixNano: "1000000" isMonotonic: true - description: Span count if ... name: span.count.if @@ -108,7 +106,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "2" - timeUnixNano: "1678392127924772000" + timeUnixNano: "1000000" isMonotonic: true - description: All span events count name: spanevent.count.all @@ -116,7 +114,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "16" - timeUnixNano: "1678392127924772000" + timeUnixNano: "1000000" isMonotonic: true - description: Span event count if ... name: spanevent.count.if @@ -124,11 +122,23 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "8" - timeUnixNano: "1678392127924772000" + timeUnixNano: "1000000" isMonotonic: true scope: +<<<<<<< HEAD name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector - resource: {} +======= + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: bar + - key: resource.required + value: + stringValue: foo +>>>>>>> 6ba58ec472 (update testdata with new expected results) scopeMetrics: - metrics: - description: All spans count @@ -137,15 +147,15 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "4" - timeUnixNano: "1678392127924780000" + timeUnixNano: "1000000" isMonotonic: true - description: Span count if ... name: span.count.if sum: aggregationTemporality: 1 dataPoints: - - asInt: "2" - timeUnixNano: "1678392127924780000" + - asInt: "4" + timeUnixNano: "1000000" isMonotonic: true - description: All span events count name: spanevent.count.all @@ -153,15 +163,59 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "16" - timeUnixNano: "1678392127924780000" + timeUnixNano: "1000000" isMonotonic: true - description: Span event count if ... name: spanevent.count.if sum: aggregationTemporality: 1 dataPoints: - - asInt: "8" - timeUnixNano: "1678392127924780000" + - asInt: "16" + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: notbar + - key: resource.required + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: All spans count + name: span.count.all + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "4" + timeUnixNano: "1000000" + isMonotonic: true + - description: Span count if ... + name: span.count.if + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "4" + timeUnixNano: "1000000" + isMonotonic: true + - description: All span events count + name: spanevent.count.all + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "16" + timeUnixNano: "1000000" + isMonotonic: true + - description: Span event count if ... + name: spanevent.count.if + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "16" + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector diff --git a/connector/countconnector/testdata/traces/one_attribute.yaml b/connector/countconnector/testdata/traces/one_attribute.yaml index 04dc47112dcd..02766a7ad39e 100644 --- a/connector/countconnector/testdata/traces/one_attribute.yaml +++ b/connector/countconnector/testdata/traces/one_attribute.yaml @@ -1,12 +1,5 @@ resourceMetrics: - - resource: - attributes: - - key: resource.required - value: - stringValue: foo - - key: resource.optional - value: - stringValue: bar + - resource: {} scopeMetrics: - metrics: - description: Span count by attribute @@ -14,35 +7,40 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: + - asInt: "1" + timeUnixNano: "1000000" - asInt: "2" attributes: - key: span.required value: stringValue: foo - timeUnixNano: "1678392127925459000" + timeUnixNano: "1000000" - asInt: "1" attributes: - key: span.required value: stringValue: notfoo - timeUnixNano: "1678392127925459000" + timeUnixNano: "1000000" isMonotonic: true - description: Span event count by attribute name: spanevent.count.by_attr sum: aggregationTemporality: 1 dataPoints: + - asInt: "4" + timeUnixNano: "1000000" - asInt: "8" attributes: - key: event.required value: stringValue: foo - timeUnixNano: "1678392127925459000" + timeUnixNano: "1000000" - asInt: "4" attributes: - key: event.required value: stringValue: notfoo +<<<<<<< HEAD timeUnixNano: "1678392127925459000" isMonotonic: true scope: @@ -92,6 +90,9 @@ resourceMetrics: value: stringValue: notfoo timeUnixNano: "1678392127925468000" +======= + timeUnixNano: "1000000" +>>>>>>> 6ba58ec472 (update testdata with new expected results) isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector @@ -107,40 +108,56 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: + - asInt: "1" + timeUnixNano: "1000000" - asInt: "2" attributes: - key: span.required value: stringValue: foo - timeUnixNano: "1678392127925474000" + timeUnixNano: "1000000" - asInt: "1" attributes: - key: span.required value: stringValue: notfoo - timeUnixNano: "1678392127925474000" + timeUnixNano: "1000000" isMonotonic: true - description: Span event count by attribute name: spanevent.count.by_attr sum: aggregationTemporality: 1 dataPoints: + - asInt: "4" + timeUnixNano: "1000000" - asInt: "8" attributes: - key: event.required value: stringValue: foo - timeUnixNano: "1678392127925474000" + timeUnixNano: "1000000" - asInt: "4" attributes: - key: event.required value: stringValue: notfoo - timeUnixNano: "1678392127925474000" + timeUnixNano: "1000000" isMonotonic: true scope: +<<<<<<< HEAD name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector - resource: {} +======= + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: bar + - key: resource.required + value: + stringValue: foo +>>>>>>> 6ba58ec472 (update testdata with new expected results) scopeMetrics: - metrics: - description: Span count by attribute @@ -148,36 +165,92 @@ resourceMetrics: sum: aggregationTemporality: 1 dataPoints: + - asInt: "1" + timeUnixNano: "1000000" - asInt: "2" attributes: - key: span.required value: stringValue: foo - timeUnixNano: "1678392127925497000" + timeUnixNano: "1000000" - asInt: "1" attributes: - key: span.required value: stringValue: notfoo - timeUnixNano: "1678392127925497000" + timeUnixNano: "1000000" isMonotonic: true - description: Span event count by attribute name: spanevent.count.by_attr sum: aggregationTemporality: 1 dataPoints: + - asInt: "4" + timeUnixNano: "1000000" + - asInt: "8" + attributes: + - key: event.required + value: + stringValue: foo + timeUnixNano: "1000000" + - asInt: "4" + attributes: + - key: event.required + value: + stringValue: notfoo + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: notbar + - key: resource.required + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: Span count by attribute + name: span.count.by_attr + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "1" + timeUnixNano: "1000000" + - asInt: "2" + attributes: + - key: span.required + value: + stringValue: foo + timeUnixNano: "1000000" + - asInt: "1" + attributes: + - key: span.required + value: + stringValue: notfoo + timeUnixNano: "1000000" + isMonotonic: true + - description: Span event count by attribute + name: spanevent.count.by_attr + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "4" + timeUnixNano: "1000000" - asInt: "8" attributes: - key: event.required value: stringValue: foo - timeUnixNano: "1678392127925497000" + timeUnixNano: "1000000" - asInt: "4" attributes: - key: event.required value: stringValue: notfoo - timeUnixNano: "1678392127925497000" + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector diff --git a/connector/countconnector/testdata/traces/one_condition.yaml b/connector/countconnector/testdata/traces/one_condition.yaml index 77b0343adceb..72bcb7a92479 100644 --- a/connector/countconnector/testdata/traces/one_condition.yaml +++ b/connector/countconnector/testdata/traces/one_condition.yaml @@ -1,12 +1,12 @@ resourceMetrics: - resource: attributes: - - key: resource.required - value: - stringValue: foo - key: resource.optional value: stringValue: bar + - key: resource.required + value: + stringValue: foo scopeMetrics: - metrics: - description: Span count if ... @@ -15,7 +15,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "4" - timeUnixNano: "1678392127922309000" + timeUnixNano: "1000000" isMonotonic: true - description: Span event count if ... name: spanevent.count.if @@ -23,18 +23,18 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "16" - timeUnixNano: "1678392127922310000" + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector - resource: attributes: - - key: resource.required - value: - stringValue: foo - key: resource.optional value: stringValue: notbar + - key: resource.required + value: + stringValue: foo scopeMetrics: - metrics: - description: Span count if ... @@ -43,7 +43,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "4" - timeUnixNano: "1678392127922363000" + timeUnixNano: "1000000" isMonotonic: true - description: Span event count if ... name: spanevent.count.if @@ -51,7 +51,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "16" - timeUnixNano: "1678392127922364000" + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector diff --git a/connector/countconnector/testdata/traces/zero_conditions.yaml b/connector/countconnector/testdata/traces/zero_conditions.yaml index 86485eeb0f5a..8a8346046715 100644 --- a/connector/countconnector/testdata/traces/zero_conditions.yaml +++ b/connector/countconnector/testdata/traces/zero_conditions.yaml @@ -1,12 +1,5 @@ resourceMetrics: - - resource: - attributes: - - key: resource.required - value: - stringValue: foo - - key: resource.optional - value: - stringValue: bar + - resource: {} scopeMetrics: - metrics: - description: The number of spans observed. @@ -15,7 +8,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "4" - timeUnixNano: "1678392127920605000" + timeUnixNano: "1000000" isMonotonic: true - description: The number of span events observed. name: trace.span.event.count @@ -23,6 +16,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "16" +<<<<<<< HEAD timeUnixNano: "1678392127920605000" isMonotonic: true scope: @@ -52,6 +46,9 @@ resourceMetrics: dataPoints: - asInt: "16" timeUnixNano: "1678392127920632000" +======= + timeUnixNano: "1000000" +>>>>>>> 6ba58ec472 (update testdata with new expected results) isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector @@ -68,7 +65,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "4" - timeUnixNano: "1678392127920635000" + timeUnixNano: "1000000" isMonotonic: true - description: The number of span events observed. name: trace.span.event.count @@ -76,11 +73,51 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "16" - timeUnixNano: "1678392127920635000" + timeUnixNano: "1000000" isMonotonic: true scope: +<<<<<<< HEAD name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector - resource: {} +======= + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: bar + - key: resource.required + value: + stringValue: foo +>>>>>>> 6ba58ec472 (update testdata with new expected results) + scopeMetrics: + - metrics: + - description: The number of spans observed. + name: trace.span.count + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "4" + timeUnixNano: "1000000" + isMonotonic: true + - description: The number of span events observed. + name: trace.span.event.count + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "16" + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: otelcol/countconnector + - resource: + attributes: + - key: resource.optional + value: + stringValue: notbar + - key: resource.required + value: + stringValue: foo scopeMetrics: - metrics: - description: The number of spans observed. @@ -89,7 +126,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "4" - timeUnixNano: "1678392127920638000" + timeUnixNano: "1000000" isMonotonic: true - description: The number of span events observed. name: trace.span.event.count @@ -97,7 +134,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "16" - timeUnixNano: "1678392127920638000" + timeUnixNano: "1000000" isMonotonic: true scope: name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector From 2dc96108313e3372684e98900b4541fffba242cd Mon Sep 17 00:00:00 2001 From: Bence Csati Date: Tue, 29 Oct 2024 16:42:10 +0100 Subject: [PATCH 5/5] update to opentelemetry v0.112.0 Signed-off-by: Bence Csati update to opentelemetry v0.112.0 Signed-off-by: Bence Csati update to opentelemetry v0.112.0 Signed-off-by: Bence Csati --- pkg/stanza/go.mod | 4 +- pkg/stanza/go.sum | 94 ++++++++++++---------- receiver/azureeventhubreceiver/receiver.go | 6 +- 3 files changed, 55 insertions(+), 49 deletions(-) diff --git a/pkg/stanza/go.mod b/pkg/stanza/go.mod index 5d4af48931a3..6a69b904b3c0 100644 --- a/pkg/stanza/go.mod +++ b/pkg/stanza/go.mod @@ -99,6 +99,6 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../golden -replace go.opentelemetry.io/collector/pdata => github.com/axoflow/opentelemetry-collector/pdata v0.104.0-dev1 +replace go.opentelemetry.io/collector/pdata => github.com/axoflow/opentelemetry-collector/pdata v0.112.0 -replace go.opentelemetry.io/collector/receiver => github.com/axoflow/opentelemetry-collector/receiver v0.104.0-dev1 +replace go.opentelemetry.io/collector/receiver => github.com/axoflow/opentelemetry-collector/receiver v0.112.0 diff --git a/pkg/stanza/go.sum b/pkg/stanza/go.sum index 08659e4a4a47..213eb32b3ee8 100644 --- a/pkg/stanza/go.sum +++ b/pkg/stanza/go.sum @@ -1,11 +1,9 @@ -github.com/axoflow/opentelemetry-collector/pdata v0.104.0-dev1 h1:Mc7o/oUGoCUdwOlKXcQEYlfS7JIoYfaWeJAyC3Sqn34= -github.com/axoflow/opentelemetry-collector/pdata v0.104.0-dev1/go.mod h1:IHxHsp+Jq/xfjORQMDJjSH6jvedOSTOyu3nbxqhWSYE= -github.com/axoflow/opentelemetry-collector/receiver v0.104.0-dev1 h1:KTuUFrm8Sps8HxBYkzHaPa1FCAacFMV6V7p5wnqWSMU= -github.com/axoflow/opentelemetry-collector/receiver v0.104.0-dev1/go.mod h1:NM06euqrApTpzietV7cCPAwP8k4PyKlPBfSr3tqlMz4= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I= -github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= +github.com/axoflow/opentelemetry-collector/pdata v0.112.0 h1:GogsS5bLquPH7bL4BEd4jzO/Haaq+/tJHLGmbWvlXN4= +github.com/axoflow/opentelemetry-collector/pdata v0.112.0/go.mod h1:Ox1YVLe87cZDB/TL30i4SUz1cA5s6AM6SpFMfY61ICs= +github.com/axoflow/opentelemetry-collector/receiver v0.112.0 h1:QNzkEj7FE0Qeh8P2VXmt2w+tfoEucsmZok5RXgQmnbk= +github.com/axoflow/opentelemetry-collector/receiver v0.112.0/go.mod h1:3QmfSUiyFzRTnHUqF8fyEvQpU5q/xuwS43jGt8JXEEA= +github.com/bmatcuk/doublestar/v4 v4.7.1 h1:fdDeAqgT47acgwd9bd9HxJRDmc9UAmPpc+2m0CXv75Q= +github.com/bmatcuk/doublestar/v4 v4.7.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= @@ -85,42 +83,50 @@ github.com/valyala/fastjson v1.6.4 h1:uAUNq9Z6ymTgGhcm0UynUAB6tlbakBrz6CQFax3BXV github.com/valyala/fastjson v1.6.4/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opentelemetry.io/collector v0.104.0 h1:R3zjM4O3K3+ttzsjPV75P80xalxRbwYTURlK0ys7uyo= -go.opentelemetry.io/collector v0.104.0/go.mod h1:Tm6F3na9ajnOm6I5goU9dURKxq1fSBK1yA94nvUix3k= -go.opentelemetry.io/collector/component v0.104.0 h1:jqu/X9rnv8ha0RNZ1a9+x7OU49KwSMsPbOuIEykHuQE= -go.opentelemetry.io/collector/component v0.104.0/go.mod h1:1C7C0hMVSbXyY1ycCmaMUAR9fVwpgyiNQqxXtEWhVpw= -go.opentelemetry.io/collector/config/configopaque v1.11.0 h1:Pt06PXWVmRaiSX63mzwT8Z9SV/hOc6VHNZbfZ10YY4o= -go.opentelemetry.io/collector/config/configopaque v1.11.0/go.mod h1:0xURn2sOy5j4fbaocpEYfM97HPGsiffkkVudSPyTJlM= -go.opentelemetry.io/collector/config/configtelemetry v0.104.0 h1:eHv98XIhapZA8MgTiipvi+FDOXoFhCYOwyKReOt+E4E= -go.opentelemetry.io/collector/config/configtelemetry v0.104.0/go.mod h1:WxWKNVAQJg/Io1nA3xLgn/DWLE/W1QOB2+/Js3ACi40= -go.opentelemetry.io/collector/config/configtls v0.104.0 h1:bMmLz2+r+REpO7cDOR+srOJHfitqTZfSZCffDpKfwWk= -go.opentelemetry.io/collector/config/configtls v0.104.0/go.mod h1:e33o7TWcKfe4ToLFyGISEPGMgp6ezf3yHRGY4gs9nKk= -go.opentelemetry.io/collector/confmap v0.104.0 h1:d3yuwX+CHpoyCh0iMv3rqb/vwAekjSm4ZDL6UK1nZSA= -go.opentelemetry.io/collector/confmap v0.104.0/go.mod h1:F8Lue+tPPn2oldXcfqI75PPMJoyzgUsKVtM/uHZLA4w= -go.opentelemetry.io/collector/consumer v0.104.0 h1:Z1ZjapFp5mUcbkGEL96ljpqLIUMhRgQQpYKkDRtxy+4= -go.opentelemetry.io/collector/consumer v0.104.0/go.mod h1:60zcIb0W9GW0z9uJCv6NmjpSbCfBOeRUyrtEwqK6Hzo= -go.opentelemetry.io/collector/extension v0.104.0 h1:bftkgFMKya/QIwK+bOxEAPVs/TvTez+s1mlaiUznJkA= -go.opentelemetry.io/collector/extension v0.104.0/go.mod h1:x7K0KyM1JGrtLbafEbRoVp0VpGBHpyx9hu87bsja6S4= -go.opentelemetry.io/collector/featuregate v1.11.0 h1:Z7puIymKoQRm3oNM/NH8reWc2zRPz2PNaJvuokh0lQY= -go.opentelemetry.io/collector/featuregate v1.11.0/go.mod h1:PsOINaGgTiFc+Tzu2K/X2jP+Ngmlp7YKGV1XrnBkH7U= -go.opentelemetry.io/collector/pdata/pprofile v0.104.0 h1:MYOIHvPlKEJbWLiBKFQWGD0xd2u22xGVLt4jPbdxP4Y= -go.opentelemetry.io/collector/pdata/pprofile v0.104.0/go.mod h1:7WpyHk2wJZRx70CGkBio8klrYTTXASbyIhf+rH4FKnA= -go.opentelemetry.io/collector/pdata/testdata v0.104.0 h1:BKTZ7hIyAX5DMPecrXkVB2e86HwWtJyOlXn/5vSVXNw= -go.opentelemetry.io/collector/pdata/testdata v0.104.0/go.mod h1:3SnYKu8gLfxURJMWS/cFEUFs+jEKS6jvfqKXnOZsdkQ= -go.opentelemetry.io/collector/semconv v0.104.0 h1:dUvajnh+AYJLEW/XOPk0T0BlwltSdi3vrjO7nSOos3k= -go.opentelemetry.io/collector/semconv v0.104.0/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw= -go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= -go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= -go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= -go.opentelemetry.io/otel/exporters/prometheus v0.49.0/go.mod h1:KfQ1wpjf3zsHjzP149P4LyAwWRupc6c7t1ZJ9eXpKQM= -go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= -go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= -go.opentelemetry.io/otel/sdk v1.27.0 h1:mlk+/Y1gLPLn84U4tI8d3GNJmGT/eXe3ZuOXN9kTWmI= -go.opentelemetry.io/otel/sdk v1.27.0/go.mod h1:Ha9vbLwJE6W86YstIywK2xFfPjbWlCuwPtMkKdz/Y4A= -go.opentelemetry.io/otel/sdk/metric v1.27.0 h1:5uGNOlpXi+Hbo/DRoI31BSb1v+OGcpv2NemcCrOL8gI= -go.opentelemetry.io/otel/sdk/metric v1.27.0/go.mod h1:we7jJVrYN2kh3mVBlswtPU22K0SA+769l93J6bsyvqw= -go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= -go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= +go.opentelemetry.io/collector/component v0.112.0 h1:Hw125Tdb427yKkzFx3U/OsfPATYXsbURkc27dn19he8= +go.opentelemetry.io/collector/component v0.112.0/go.mod h1:hV9PEgkNlVAySX+Oo/g7+NcLe234L04kRXw6uGj3VEw= +go.opentelemetry.io/collector/config/configopaque v1.18.0 h1:aoEecgd5m8iZCX+S+iH6SK/lG6ULqCqtrtz7PeHw7vE= +go.opentelemetry.io/collector/config/configopaque v1.18.0/go.mod h1:6zlLIyOoRpJJ+0bEKrlZOZon3rOp5Jrz9fMdR4twOS4= +go.opentelemetry.io/collector/config/configtelemetry v0.112.0 h1:MVBrWJUoqfKrORI38dY8OV0i5d1RRHR/ACIBu9TOcZ8= +go.opentelemetry.io/collector/config/configtelemetry v0.112.0/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= +go.opentelemetry.io/collector/config/configtls v1.18.0 h1:IQemIIuryeHgrpBJMbLl+LgTxvFBbv7Hhi+0WwlxpCU= +go.opentelemetry.io/collector/config/configtls v1.18.0/go.mod h1:lD2dlDqeTKq7OecFwIZMufDaa8erSlEoHMJrFPHrZNw= +go.opentelemetry.io/collector/confmap v1.18.0 h1:UEOeJY8RW8lZ1O4lzHSGqolS7uzkpXQi5fa8SidKqQg= +go.opentelemetry.io/collector/confmap v1.18.0/go.mod h1:GgNu1ElPGmLn9govqIfjaopvdspw4PJ9KeDtWC4E2Q4= +go.opentelemetry.io/collector/consumer v0.112.0 h1:tfO4FpuQ8MsD7AxgslC3tRNVYjd9Xkus34BOExsG4fM= +go.opentelemetry.io/collector/consumer v0.112.0/go.mod h1:ZKSeGvXvaofIlvPrWlARKQpONOmuw6R/yifgYCWHKRw= +go.opentelemetry.io/collector/consumer/consumererror v0.112.0 h1:dCqWEi3Yws5V5oGhCSOwxCHK6tYya5UzfzXmSLMHZ8E= +go.opentelemetry.io/collector/consumer/consumererror v0.112.0/go.mod h1:X9RJt5caDnwxoG++GhQHvlmDi2TMWEr6S/XRhZTSmOI= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.112.0 h1:ym+QxemlbWwfMSUto1hRTfcZeYbj2q8FpMzjk8O+X60= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.112.0/go.mod h1:4PjDUpURFh85R6NLEHrEf/uZjpk4LAYmmOrqu+iZsyE= +go.opentelemetry.io/collector/consumer/consumertest v0.112.0 h1:pGvNH+H4rMygUOql6ynVQim6UFdimTiJ0HRfQL6v0GE= +go.opentelemetry.io/collector/consumer/consumertest v0.112.0/go.mod h1:rfVo0tYt/BaLWw3IaQKVQafjUlMsA5qTkvsSOfFrr9c= +go.opentelemetry.io/collector/extension v0.112.0 h1:NsCDMMbuZp8dSBLoAqHn/AtbcspbAqcubc4qogXo+zc= +go.opentelemetry.io/collector/extension v0.112.0/go.mod h1:CZrWN4sRQ2cLpEP+zb7DAG+RFSSGcmswEjTt8UvcycM= +go.opentelemetry.io/collector/extension/experimental/storage v0.112.0 h1:IBRQcwEo7RKytjTEFnEsOcd52ffvNeEmSl6FeYPZzpk= +go.opentelemetry.io/collector/extension/experimental/storage v0.112.0/go.mod h1:+3j0GK3WRNb2noOOGdcx7b5FQUBP1AzLl+y3y+Qns1c= +go.opentelemetry.io/collector/featuregate v1.18.0 h1:1CvP1K3XmVs7WZCs/A1j8rsC7JQWu+y+vF8vxKjLaOU= +go.opentelemetry.io/collector/featuregate v1.18.0/go.mod h1:47xrISO71vJ83LSMm8+yIDsUbKktUp48Ovt7RR6VbRs= +go.opentelemetry.io/collector/pdata/pprofile v0.112.0 h1:t+LYorcMqZ3sDz5/jp3xU2l5lIhIXuIOOGO4Ef9CG2c= +go.opentelemetry.io/collector/pdata/pprofile v0.112.0/go.mod h1:F2aTCoDzIaxEUK1g92LZvMwradySFMo3ZsAnBIpOdUg= +go.opentelemetry.io/collector/pdata/testdata v0.112.0 h1:7jJzNvRE+CpYrwHbAYwPiN9a/hqmVRlRADJNeDJTvYI= +go.opentelemetry.io/collector/pdata/testdata v0.112.0/go.mod h1:9kO148Qp12B93SSUE52s0QGGV8Nf9RFN2G/PnZx3l+w= +go.opentelemetry.io/collector/pipeline v0.112.0 h1:jqKDdb8k53OLPibvxzX6fmMec0ZHAtqe4p2+cuHclEI= +go.opentelemetry.io/collector/pipeline v0.112.0/go.mod h1:4vOvjVsoYTHVGTbfFwqfnQOSV2K3RKUHofh3jNRc2Mg= +go.opentelemetry.io/collector/receiver/receiverprofiles v0.112.0 h1:SShkZsWRsFss3iWZa9JwMC7h4gD5RbWDhUcz1/9dXSs= +go.opentelemetry.io/collector/receiver/receiverprofiles v0.112.0/go.mod h1:615smszDXiz4YWwXslxlAjX7FzOVDU7Bk6xARFk+zpk= +go.opentelemetry.io/collector/semconv v0.112.0 h1:JPQyvZhlNLVSuVI+FScONaiFygB7h7NTZceUEKIQUEc= +go.opentelemetry.io/collector/semconv v0.112.0/go.mod h1:zCJ5njhWpejR+A40kiEoeFm1xq1uzyZwMnRNX6/D82A= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= diff --git a/receiver/azureeventhubreceiver/receiver.go b/receiver/azureeventhubreceiver/receiver.go index 09320b2ba2ba..8e369ffd8056 100644 --- a/receiver/azureeventhubreceiver/receiver.go +++ b/receiver/azureeventhubreceiver/receiver.go @@ -106,7 +106,7 @@ func (receiver *eventhubReceiver) consumeLogs(ctx context.Context, event *eventh receiver.logger.Debug("Log Records", zap.Any("logs", logs)) err = receiver.nextLogsConsumer.ConsumeLogs(logsContext, logs) - receiver.obsrecv.EndLogsOp(logsContext, metadata.Type.String(), 1, err) + receiver.obsrecv.EndLogsOp(logsContext, metadata.Type.String(), 1, 0, err) return err } @@ -131,7 +131,7 @@ func (receiver *eventhubReceiver) consumeMetrics(ctx context.Context, event *eve receiver.logger.Debug("Metric Records", zap.Any("metrics", metrics)) err = receiver.nextMetricsConsumer.ConsumeMetrics(metricsContext, metrics) - receiver.obsrecv.EndMetricsOp(metricsContext, metadata.Type.String(), 1, err) + receiver.obsrecv.EndMetricsOp(metricsContext, metadata.Type.String(), 1, 0, err) return err } @@ -156,7 +156,7 @@ func (receiver *eventhubReceiver) consumeTraces(ctx context.Context, event *even receiver.logger.Debug("traces Records", zap.Any("traces", traces)) err = receiver.nextTracesConsumer.ConsumeTraces(tracesContext, traces) - receiver.obsrecv.EndTracesOp(tracesContext, metadata.Type.String(), 1, err) + receiver.obsrecv.EndTracesOp(tracesContext, metadata.Type.String(), 1, 0, err) return err }