diff --git a/.chloggen/bug_fix-pulsarexporter-change_configuration_option.yaml b/.chloggen/bug_fix-pulsarexporter-change_configuration_option.yaml new file mode 100644 index 000000000000..c61678b51d59 --- /dev/null +++ b/.chloggen/bug_fix-pulsarexporter-change_configuration_option.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: bug_fix + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: exporter/pulsarexporter + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Change configuration option `map_connections_per_broker`, rename to `max_connections_per_broker`. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [36579] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [user] diff --git a/.chloggen/bump_minimal_pg_version.yaml b/.chloggen/bump_minimal_pg_version.yaml new file mode 100644 index 000000000000..ffbaeb5408f1 --- /dev/null +++ b/.chloggen/bump_minimal_pg_version.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: deprecation + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: postgresqlreceiver + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Minimal supported PostgreSQL version updated from 9.6 to 13.0 + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [30923] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: Aligning on the supported versions as can be seen [in the PostgreSQL releases section](https://www.postgresql.org/support/versioning) + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [user] diff --git a/cmd/githubgen/codeowners.go b/cmd/githubgen/codeowners.go index 9fea2c3bba1b..70f1b2f9450f 100644 --- a/cmd/githubgen/codeowners.go +++ b/cmd/githubgen/codeowners.go @@ -10,7 +10,7 @@ import ( "sort" "strings" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" ) const allowlistHeader = `# Code generated by githubgen. DO NOT EDIT. diff --git a/cmd/githubgen/go.mod b/cmd/githubgen/go.mod index 52ea1bdddfb1..0be27dfe08bc 100644 --- a/cmd/githubgen/go.mod +++ b/cmd/githubgen/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/cmd/githubgen go 1.22.0 require ( - github.com/google/go-github/v66 v66.0.0 + github.com/google/go-github/v67 v67.0.0 go.opentelemetry.io/collector/confmap v1.20.1-0.20241202231142-b9ff1bc54c99 go.opentelemetry.io/collector/confmap/provider/fileprovider v1.20.1-0.20241202231142-b9ff1bc54c99 gopkg.in/yaml.v3 v3.0.1 diff --git a/cmd/githubgen/go.sum b/cmd/githubgen/go.sum index 3ae9a323a04d..2e0ad0871f4e 100644 --- a/cmd/githubgen/go.sum +++ b/cmd/githubgen/go.sum @@ -5,8 +5,8 @@ github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlnd github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v66 v66.0.0 h1:ADJsaXj9UotwdgK8/iFZtv7MLc8E8WBl62WLd/D/9+M= -github.com/google/go-github/v66 v66.0.0/go.mod h1:+4SO9Zkuyf8ytMj0csN1NR/5OTR+MfqPp8P8dVlcvY4= +github.com/google/go-github/v67 v67.0.0 h1:g11NDAmfaBaCO8qYdI9fsmbaRipHNWRIU/2YGvlh4rg= +github.com/google/go-github/v67 v67.0.0/go.mod h1:zH3K7BxjFndr9QSeFibx4lTKkYS3K9nDanoI1NjaOtY= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= diff --git a/examples/couchbase/docker-compose.yaml b/examples/couchbase/docker-compose.yaml index e213726644a6..1038a328c0b7 100644 --- a/examples/couchbase/docker-compose.yaml +++ b/examples/couchbase/docker-compose.yaml @@ -17,7 +17,7 @@ services: depends_on: - couchbase prometheus: - image: prom/prometheus:v3.0.0 + image: prom/prometheus:v3.0.1 volumes: - ./prometheus-config.yaml:/etc/prometheus/prometheus.yml ports: diff --git a/exporter/loadbalancingexporter/go.mod b/exporter/loadbalancingexporter/go.mod index e7feec4f2fff..a3a44e2ef36d 100644 --- a/exporter/loadbalancingexporter/go.mod +++ b/exporter/loadbalancingexporter/go.mod @@ -37,7 +37,7 @@ require ( k8s.io/apimachinery v0.31.3 k8s.io/client-go v0.31.3 k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 - sigs.k8s.io/controller-runtime v0.19.2 + sigs.k8s.io/controller-runtime v0.19.3 ) require ( diff --git a/exporter/loadbalancingexporter/go.sum b/exporter/loadbalancingexporter/go.sum index 2c3d7fe97e7b..8b85758fe3f6 100644 --- a/exporter/loadbalancingexporter/go.sum +++ b/exporter/loadbalancingexporter/go.sum @@ -438,8 +438,8 @@ k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7F k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -sigs.k8s.io/controller-runtime v0.19.2 h1:3sPrF58XQEPzbE8T81TN6selQIMGbtYwuaJ6eDssDF8= -sigs.k8s.io/controller-runtime v0.19.2/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= +sigs.k8s.io/controller-runtime v0.19.3 h1:XO2GvC9OPftRst6xWCpTgBZO04S2cbp0Qqkj8bX1sPw= +sigs.k8s.io/controller-runtime v0.19.3/go.mod h1:j4j87DqtsThvwTv5/Tc5NFRyyF/RF0ip4+62tbTSIUM= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= diff --git a/exporter/pulsarexporter/README.md b/exporter/pulsarexporter/README.md index 6217e788f6a1..87a090977918 100644 --- a/exporter/pulsarexporter/README.md +++ b/exporter/pulsarexporter/README.md @@ -63,7 +63,7 @@ The following settings can be optionally configured: - `timeout`: send pulsar message timeout (default: 5s) - `operation_timeout`: sets producer-create, subscribe and unsubscribe operations timeout (default: 30 seconds) - `connection_timeout`: timeout for the establishment of a TCP connection (default: 5 seconds) -- `map_connections_per_broker`: max number of connections to a single broker that will kept in the pool. (default: 1 connection) +- `max_connections_per_broker`: max number of connections to a single broker that will kept in the pool. (default: 1 connection) - `retry_on_failure` - `enabled` (default = true) - `initial_interval` (default = 5s): Time to wait after the first failure before retrying; ignored if `enabled` is `false` diff --git a/exporter/pulsarexporter/config.go b/exporter/pulsarexporter/config.go index a78dcb7071b0..ea1a45faab1d 100644 --- a/exporter/pulsarexporter/config.go +++ b/exporter/pulsarexporter/config.go @@ -35,7 +35,7 @@ type Config struct { Authentication Authentication `mapstructure:"auth"` OperationTimeout time.Duration `mapstructure:"operation_timeout"` ConnectionTimeout time.Duration `mapstructure:"connection_timeout"` - MaxConnectionsPerBroker int `mapstructure:"map_connections_per_broker"` + MaxConnectionsPerBroker int `mapstructure:"max_connections_per_broker"` } type Authentication struct { diff --git a/exporter/sentryexporter/go.mod b/exporter/sentryexporter/go.mod index bd377d17d93f..36000e268aad 100644 --- a/exporter/sentryexporter/go.mod +++ b/exporter/sentryexporter/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sentry go 1.22.0 require ( - github.com/getsentry/sentry-go v0.29.1 + github.com/getsentry/sentry-go v0.30.0 github.com/google/go-cmp v0.6.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.114.0 github.com/stretchr/testify v1.10.0 diff --git a/exporter/sentryexporter/go.sum b/exporter/sentryexporter/go.sum index 0c94a450c07e..792d7fd9a5b8 100644 --- a/exporter/sentryexporter/go.sum +++ b/exporter/sentryexporter/go.sum @@ -3,8 +3,8 @@ github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyY github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/getsentry/sentry-go v0.29.1 h1:DyZuChN8Hz3ARxGVV8ePaNXh1dQ7d76AiB117xcREwA= -github.com/getsentry/sentry-go v0.29.1/go.mod h1:x3AtIzN01d6SiWkderzaH28Tm0lgkafpJ5Bm3li39O0= +github.com/getsentry/sentry-go v0.30.0 h1:lWUwDnY7sKHaVIoZ9wYqRHJ5iEmoc0pqcRqFkosKzBo= +github.com/getsentry/sentry-go v0.30.0/go.mod h1:WU9B9/1/sHDqeV8T+3VwwbjeR5MSXs/6aqG3mqZrezA= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/exporter/tencentcloudlogserviceexporter/go.mod b/exporter/tencentcloudlogserviceexporter/go.mod index 022919ce2490..9b67b25417ec 100644 --- a/exporter/tencentcloudlogserviceexporter/go.mod +++ b/exporter/tencentcloudlogserviceexporter/go.mod @@ -6,7 +6,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.114.0 github.com/pierrec/lz4 v2.6.1+incompatible github.com/stretchr/testify v1.10.0 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1048 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1053 go.opentelemetry.io/collector/component v0.114.1-0.20241202231142-b9ff1bc54c99 go.opentelemetry.io/collector/component/componenttest v0.114.1-0.20241202231142-b9ff1bc54c99 go.opentelemetry.io/collector/config/configopaque v1.20.1-0.20241202231142-b9ff1bc54c99 diff --git a/exporter/tencentcloudlogserviceexporter/go.sum b/exporter/tencentcloudlogserviceexporter/go.sum index b5a5b4268204..6d5580dcdb40 100644 --- a/exporter/tencentcloudlogserviceexporter/go.sum +++ b/exporter/tencentcloudlogserviceexporter/go.sum @@ -58,8 +58,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1048 h1:WvooPEWRp/0KDvmRVyTSW8jObgWAH2hDYiRCcHsDmPw= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1048/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1053 h1:Qrwvu384xBXaAl8Vv5qvOKwBNOL73x0iyjQ0MocSidI= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1053/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= 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.114.1-0.20241202231142-b9ff1bc54c99 h1:4Qgv+nQcKMtU1EiJJ1AI6ZjvtBKDqMny7vgNmez+PIM= diff --git a/pkg/stanza/fileconsumer/matcher/matcher_test.go b/pkg/stanza/fileconsumer/matcher/matcher_test.go index e192536550ce..7ae3eac47762 100644 --- a/pkg/stanza/fileconsumer/matcher/matcher_test.go +++ b/pkg/stanza/fileconsumer/matcher/matcher_test.go @@ -853,7 +853,7 @@ func TestMatcher(t *testing.T) { } else { assert.NoError(t, err) } - assert.Equal(t, tc.expected, files) + assert.ElementsMatch(t, tc.expected, files) }) } } diff --git a/receiver/githubreceiver/go.mod b/receiver/githubreceiver/go.mod index 391daa81a413..f84a84e6c14a 100644 --- a/receiver/githubreceiver/go.mod +++ b/receiver/githubreceiver/go.mod @@ -5,7 +5,7 @@ go 1.22.0 require ( github.com/Khan/genqlient v0.7.0 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v66 v66.0.0 + github.com/google/go-github/v67 v67.0.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.114.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.114.0 github.com/stretchr/testify v1.10.0 diff --git a/receiver/githubreceiver/go.sum b/receiver/githubreceiver/go.sum index 4dac32af18a3..6b74619141f9 100644 --- a/receiver/githubreceiver/go.sum +++ b/receiver/githubreceiver/go.sum @@ -35,8 +35,8 @@ github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v66 v66.0.0 h1:ADJsaXj9UotwdgK8/iFZtv7MLc8E8WBl62WLd/D/9+M= -github.com/google/go-github/v66 v66.0.0/go.mod h1:+4SO9Zkuyf8ytMj0csN1NR/5OTR+MfqPp8P8dVlcvY4= +github.com/google/go-github/v67 v67.0.0 h1:g11NDAmfaBaCO8qYdI9fsmbaRipHNWRIU/2YGvlh4rg= +github.com/google/go-github/v67 v67.0.0/go.mod h1:zH3K7BxjFndr9QSeFibx4lTKkYS3K9nDanoI1NjaOtY= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= diff --git a/receiver/githubreceiver/internal/scraper/githubscraper/github_scraper_test.go b/receiver/githubreceiver/internal/scraper/githubscraper/github_scraper_test.go index 99c67df68079..85e8cec8de4c 100644 --- a/receiver/githubreceiver/internal/scraper/githubscraper/github_scraper_test.go +++ b/receiver/githubreceiver/internal/scraper/githubscraper/github_scraper_test.go @@ -11,7 +11,7 @@ import ( "testing" "time" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component/componenttest" diff --git a/receiver/githubreceiver/internal/scraper/githubscraper/helpers.go b/receiver/githubreceiver/internal/scraper/githubscraper/helpers.go index a2f4d0a0d9a4..4630ec1acb10 100644 --- a/receiver/githubreceiver/internal/scraper/githubscraper/helpers.go +++ b/receiver/githubreceiver/internal/scraper/githubscraper/helpers.go @@ -12,7 +12,7 @@ import ( "time" "github.com/Khan/genqlient/graphql" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" ) const ( diff --git a/receiver/githubreceiver/internal/scraper/githubscraper/helpers_test.go b/receiver/githubreceiver/internal/scraper/githubscraper/helpers_test.go index 9815eea949e3..6872146c1faa 100644 --- a/receiver/githubreceiver/internal/scraper/githubscraper/helpers_test.go +++ b/receiver/githubreceiver/internal/scraper/githubscraper/helpers_test.go @@ -15,7 +15,7 @@ import ( "time" "github.com/Khan/genqlient/graphql" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v67/github" "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/receiver/receivertest" ) diff --git a/receiver/postgresqlreceiver/README.md b/receiver/postgresqlreceiver/README.md index 7d64be584122..c10dcf3b367f 100644 --- a/receiver/postgresqlreceiver/README.md +++ b/receiver/postgresqlreceiver/README.md @@ -12,13 +12,13 @@ [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib -This receiver queries the PostgreSQL [statistics collector](https://www.postgresql.org/docs/9.6/monitoring-stats.html). +This receiver queries the PostgreSQL [statistics collector](https://www.postgresql.org/docs/13/monitoring-stats.html). > :construction: This receiver is in **BETA**. Configuration fields and metric data model are subject to change. ## Prerequisites -This receiver supports PostgreSQL versions 9.6+ +See PostgreSQL documentation for [supported versions](https://www.postgresql.org/support/versioning). The monitoring user must be granted `SELECT` on `pg_stat_database`. diff --git a/receiver/postgresqlreceiver/integration_test.go b/receiver/postgresqlreceiver/integration_test.go index d73627615d46..fb290be1095c 100644 --- a/receiver/postgresqlreceiver/integration_test.go +++ b/receiver/postgresqlreceiver/integration_test.go @@ -52,7 +52,7 @@ func integrationTest(name string, databases []string) func(*testing.T) { NewFactory(), scraperinttest.WithContainerRequest( testcontainers.ContainerRequest{ - Image: "postgres:9.6.24", + Image: "postgres:13.18", Env: map[string]string{ "POSTGRES_USER": "root", "POSTGRES_PASSWORD": "otel", diff --git a/receiver/pulsarreceiver/pulsar_receiver.go b/receiver/pulsarreceiver/pulsar_receiver.go index fe779c06c4e6..4130a10b3a4b 100644 --- a/receiver/pulsarreceiver/pulsar_receiver.go +++ b/receiver/pulsarreceiver/pulsar_receiver.go @@ -13,6 +13,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/receiverhelper" "go.uber.org/zap" ) @@ -20,6 +21,8 @@ var errUnrecognizedEncoding = errors.New("unrecognized encoding") const alreadyClosedError = "AlreadyClosedError" +const transport = "pulsar" + type pulsarTracesConsumer struct { tracesConsumer consumer.Traces topic string @@ -29,9 +32,18 @@ type pulsarTracesConsumer struct { unmarshaler TracesUnmarshaler settings receiver.Settings consumerOptions pulsar.ConsumerOptions + obsrecv *receiverhelper.ObsReport } func newTracesReceiver(config Config, set receiver.Settings, unmarshalers map[string]TracesUnmarshaler, nextConsumer consumer.Traces) (*pulsarTracesConsumer, error) { + obsrecv, err := receiverhelper.NewObsReport(receiverhelper.ObsReportSettings{ + ReceiverID: set.ID, + Transport: transport, + ReceiverCreateSettings: set, + }) + if err != nil { + return nil, err + } unmarshaler := unmarshalers[config.Encoding] if nil == unmarshaler { return nil, errUnrecognizedEncoding @@ -49,6 +61,7 @@ func newTracesReceiver(config Config, set receiver.Settings, unmarshalers map[st } return &pulsarTracesConsumer{ + obsrecv: obsrecv, tracesConsumer: nextConsumer, topic: config.Topic, unmarshaler: unmarshaler, @@ -81,8 +94,10 @@ func consumerTracesLoop(ctx context.Context, c *pulsarTracesConsumer) error { // TODO: Ensure returned errors are handled for { + obsCtx := c.obsrecv.StartTracesOp(ctx) message, err := c.consumer.Receive(ctx) if err != nil { + c.obsrecv.EndTracesOp(obsCtx, unmarshaler.Encoding(), 0, err) if strings.Contains(err.Error(), alreadyClosedError) { return err } @@ -98,13 +113,15 @@ func consumerTracesLoop(ctx context.Context, c *pulsarTracesConsumer) error { traces, err := unmarshaler.Unmarshal(message.Payload()) if err != nil { c.settings.Logger.Error("failed to unmarshaler traces message", zap.Error(err)) + c.obsrecv.EndTracesOp(obsCtx, unmarshaler.Encoding(), 0, err) _ = c.consumer.Ack(message) return err } - - if err := traceConsumer.ConsumeTraces(context.Background(), traces); err != nil { + err = traceConsumer.ConsumeTraces(context.Background(), traces) + if err != nil { c.settings.Logger.Error("consume traces failed", zap.Error(err)) } + c.obsrecv.EndTracesOp(obsCtx, unmarshaler.Encoding(), traces.SpanCount(), err) _ = c.consumer.Ack(message) } } @@ -128,9 +145,18 @@ type pulsarMetricsConsumer struct { cancel context.CancelFunc settings receiver.Settings consumerOptions pulsar.ConsumerOptions + obsrecv *receiverhelper.ObsReport } func newMetricsReceiver(config Config, set receiver.Settings, unmarshalers map[string]MetricsUnmarshaler, nextConsumer consumer.Metrics) (*pulsarMetricsConsumer, error) { + obsrecv, err := receiverhelper.NewObsReport(receiverhelper.ObsReportSettings{ + ReceiverID: set.ID, + Transport: transport, + ReceiverCreateSettings: set, + }) + if err != nil { + return nil, err + } unmarshaler := unmarshalers[config.Encoding] if nil == unmarshaler { return nil, errUnrecognizedEncoding @@ -148,6 +174,7 @@ func newMetricsReceiver(config Config, set receiver.Settings, unmarshalers map[s } return &pulsarMetricsConsumer{ + obsrecv: obsrecv, metricsConsumer: nextConsumer, topic: config.Topic, unmarshaler: unmarshaler, @@ -181,8 +208,10 @@ func consumeMetricsLoop(ctx context.Context, c *pulsarMetricsConsumer) error { // TODO: Ensure returned errors are handled for { + obsCtx := c.obsrecv.StartMetricsOp(ctx) message, err := c.consumer.Receive(ctx) if err != nil { + c.obsrecv.EndMetricsOp(obsCtx, unmarshaler.Encoding(), 0, err) if strings.Contains(err.Error(), alreadyClosedError) { return err } @@ -199,13 +228,15 @@ func consumeMetricsLoop(ctx context.Context, c *pulsarMetricsConsumer) error { metrics, err := unmarshaler.Unmarshal(message.Payload()) if err != nil { c.settings.Logger.Error("failed to unmarshaler metrics message", zap.Error(err)) + c.obsrecv.EndMetricsOp(obsCtx, unmarshaler.Encoding(), 0, err) _ = c.consumer.Ack(message) return err } - - if err := metricsConsumer.ConsumeMetrics(context.Background(), metrics); err != nil { + err = metricsConsumer.ConsumeMetrics(context.Background(), metrics) + if err != nil { c.settings.Logger.Error("consume traces failed", zap.Error(err)) } + c.obsrecv.EndMetricsOp(obsCtx, unmarshaler.Encoding(), metrics.DataPointCount(), err) _ = c.consumer.Ack(message) } @@ -230,9 +261,18 @@ type pulsarLogsConsumer struct { cancel context.CancelFunc settings receiver.Settings consumerOptions pulsar.ConsumerOptions + obsrecv *receiverhelper.ObsReport } func newLogsReceiver(config Config, set receiver.Settings, unmarshalers map[string]LogsUnmarshaler, nextConsumer consumer.Logs) (*pulsarLogsConsumer, error) { + obsrecv, err := receiverhelper.NewObsReport(receiverhelper.ObsReportSettings{ + ReceiverID: set.ID, + Transport: transport, + ReceiverCreateSettings: set, + }) + if err != nil { + return nil, err + } unmarshaler := unmarshalers[config.Encoding] if nil == unmarshaler { return nil, errUnrecognizedEncoding @@ -250,6 +290,7 @@ func newLogsReceiver(config Config, set receiver.Settings, unmarshalers map[stri } return &pulsarLogsConsumer{ + obsrecv: obsrecv, logsConsumer: nextConsumer, topic: config.Topic, cancel: nil, @@ -282,8 +323,10 @@ func consumeLogsLoop(ctx context.Context, c *pulsarLogsConsumer) error { logsConsumer := c.logsConsumer for { + obsCtx := c.obsrecv.StartLogsOp(ctx) message, err := c.consumer.Receive(ctx) if err != nil { + c.obsrecv.EndLogsOp(obsCtx, unmarshaler.Encoding(), 0, err) if strings.Contains(err.Error(), alreadyClosedError) { return err } @@ -299,14 +342,15 @@ func consumeLogsLoop(ctx context.Context, c *pulsarLogsConsumer) error { logs, err := unmarshaler.Unmarshal(message.Payload()) if err != nil { c.settings.Logger.Error("failed to unmarshaler logs message", zap.Error(err)) + c.obsrecv.EndLogsOp(obsCtx, unmarshaler.Encoding(), 0, err) _ = c.consumer.Ack(message) return err } - - if err := logsConsumer.ConsumeLogs(context.Background(), logs); err != nil { + err = logsConsumer.ConsumeLogs(context.Background(), logs) + if err != nil { c.settings.Logger.Error("consume traces failed", zap.Error(err)) } - + c.obsrecv.EndLogsOp(obsCtx, unmarshaler.Encoding(), logs.LogRecordCount(), err) _ = c.consumer.Ack(message) } } diff --git a/receiver/solacereceiver/go.mod b/receiver/solacereceiver/go.mod index 2ea11ea6f151..476aeef2c7de 100644 --- a/receiver/solacereceiver/go.mod +++ b/receiver/solacereceiver/go.mod @@ -6,7 +6,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/solace go 1.22.0 require ( - github.com/Azure/go-amqp v1.2.0 + github.com/Azure/go-amqp v1.3.0 github.com/stretchr/testify v1.10.0 go.opentelemetry.io/collector/component v0.114.1-0.20241202231142-b9ff1bc54c99 go.opentelemetry.io/collector/component/componenttest v0.114.1-0.20241202231142-b9ff1bc54c99 diff --git a/receiver/solacereceiver/go.sum b/receiver/solacereceiver/go.sum index f6fea791b851..3186b0d7afc4 100644 --- a/receiver/solacereceiver/go.sum +++ b/receiver/solacereceiver/go.sum @@ -1,5 +1,5 @@ -github.com/Azure/go-amqp v1.2.0 h1:NNyfN3/cRszWzMvjmm64yaPZDHX/2DJkowv8Ub9y01I= -github.com/Azure/go-amqp v1.2.0/go.mod h1:vZAogwdrkbyK3Mla8m/CxSc/aKdnTZ4IbPxl51Y5WZE= +github.com/Azure/go-amqp v1.3.0 h1://1rikYhoIQNXJFXyoO/Rlb4+4EkHYfJceNtLlys2/4= +github.com/Azure/go-amqp v1.3.0/go.mod h1:vZAogwdrkbyK3Mla8m/CxSc/aKdnTZ4IbPxl51Y5WZE= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/receiver/vcenterreceiver/go.mod b/receiver/vcenterreceiver/go.mod index 324e6cabf430..317b3359690a 100644 --- a/receiver/vcenterreceiver/go.mod +++ b/receiver/vcenterreceiver/go.mod @@ -9,7 +9,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.114.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.114.0 github.com/stretchr/testify v1.10.0 - github.com/vmware/govmomi v0.46.1 + github.com/vmware/govmomi v0.46.2 go.opentelemetry.io/collector/component v0.114.1-0.20241202231142-b9ff1bc54c99 go.opentelemetry.io/collector/component/componenttest v0.114.1-0.20241202231142-b9ff1bc54c99 go.opentelemetry.io/collector/config/configopaque v1.20.1-0.20241202231142-b9ff1bc54c99 diff --git a/receiver/vcenterreceiver/go.sum b/receiver/vcenterreceiver/go.sum index aa19f7ce7f60..716ad6f6244a 100644 --- a/receiver/vcenterreceiver/go.sum +++ b/receiver/vcenterreceiver/go.sum @@ -136,8 +136,8 @@ github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFA github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= -github.com/vmware/govmomi v0.46.1 h1:RBoIR/vlGBYn+t7I1LFLLbDQSoBn+xN6gPYYMbFZ+80= -github.com/vmware/govmomi v0.46.1/go.mod h1:uoLVU9zlXC4p4GmLVG+ZJmBC0Gn3Q7mytOJvi39OhxA= +github.com/vmware/govmomi v0.46.2 h1:gZTIcKSr4sVcDB803FUv0r4lhOgE5Y5WQCNW75dPlls= +github.com/vmware/govmomi v0.46.2/go.mod h1:uoLVU9zlXC4p4GmLVG+ZJmBC0Gn3Q7mytOJvi39OhxA= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=