Skip to content

Commit

Permalink
Break storage extensions into dedicated modules (open-telemetry#31040)
Browse files Browse the repository at this point in the history
This creates dedicated modules for `filestorage` and `dbstorage`
extensions. It leaves the `storage` module in place to contain the
`storage/storagetest` package.
  • Loading branch information
djaglowski authored Feb 9, 2024
1 parent fe92f80 commit 2047ee9
Show file tree
Hide file tree
Showing 21 changed files with 626 additions and 219 deletions.
31 changes: 31 additions & 0 deletions .chloggen/storage-modules.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: extension/storage

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: The `filestorage` and `dbstorage` extensions are now standalone modules.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [31040]

# (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 using the OpenTelemetry Collector Builder, you will need to update your import paths to use the new module(s).
- `github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/filestorage`
- `github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/dbstorage`
# 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: [api, user]
11 changes: 8 additions & 3 deletions cmd/configschema/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,8 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/hostobserver v0.94.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.94.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/extension/sigv4authextension v0.94.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.94.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/dbstorage v0.94.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/filestorage v0.94.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/cwlogs v0.94.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/metrics v0.94.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/proxy v0.94.0 // indirect
Expand Down Expand Up @@ -861,8 +862,6 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/ppro

replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/sigv4authextension => ../../extension/sigv4authextension

replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage

replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchperresourceattr => ../../pkg/batchperresourceattr

replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/winperfcounters => ../../pkg/winperfcounters
Expand Down Expand Up @@ -1148,3 +1147,9 @@ replace (
)

replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/sqlquery => ../../internal/sqlquery

replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/filestorage => ../../extension/storage/filestorage

replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/dbstorage => ../../extension/storage/dbstorage

replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage
8 changes: 4 additions & 4 deletions cmd/otelcontribcol/builder-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ extensions:
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/remotetapextension v0.94.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/sigv4authextension v0.94.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/solarwindsapmsettingsextension v0.94.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.94.0
import: github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/filestorage
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.94.0
import: github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/dbstorage
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/dbstorage v0.94.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/filestorage v0.94.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension v0.94.0
import: github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension v0.94.0
Expand Down Expand Up @@ -218,6 +216,8 @@ connectors:

replaces:
- github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage
- github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/dbstorage => ../../extension/storage/dbstorage
- github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/filestorage => ../../extension/storage/filestorage
- github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal => ../../pkg/batchpersignal
- github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/cwlogs => ../../internal/aws/cwlogs
- github.com/open-telemetry/opentelemetry-collector-contrib/exporter/f5cloudexporter => ../../exporter/f5cloudexporter
Expand Down
2 changes: 1 addition & 1 deletion cmd/otelcontribcol/components.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion cmd/otelcontribcol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib/extension/remotetapextension v0.94.0
github.com/open-telemetry/opentelemetry-collector-contrib/extension/sigv4authextension v0.94.0
github.com/open-telemetry/opentelemetry-collector-contrib/extension/solarwindsapmsettingsextension v0.94.0
github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.94.0
github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/dbstorage v0.94.0
github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/filestorage v0.94.0
github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.94.0
github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.94.0
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.94.0
Expand Down Expand Up @@ -729,6 +730,10 @@ require (

replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage

replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/dbstorage => ../../extension/storage/dbstorage

replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/filestorage => ../../extension/storage/filestorage

replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal => ../../pkg/batchpersignal

replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/cwlogs => ../../internal/aws/cwlogs
Expand Down
4 changes: 2 additions & 2 deletions cmd/oteltestbedcol/builder-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ extensions:
- gomod: go.opentelemetry.io/collector/extension/ballastextension v0.94.1
- gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.94.1
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.94.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.94.0
import: github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/filestorage
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/filestorage v0.94.0

exporters:
- gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.94.1
Expand Down Expand Up @@ -50,6 +49,7 @@ receivers:

replaces:
- github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage
- github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/filestorage => ../../extension/storage/filestorage
- github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common
- github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver => ../../receiver/opencensusreceiver
- github.com/open-telemetry/opentelemetry-collector-contrib/receiver/splunkhecreceiver => ../../receiver/splunkhecreceiver
Expand Down
4 changes: 3 additions & 1 deletion cmd/oteltestbedcol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/syslogexporter v0.94.0
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/zipkinexporter v0.94.0
github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.94.0
github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.94.0
github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/filestorage v0.94.0
github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.94.0
github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.94.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver v0.94.0
Expand Down Expand Up @@ -289,6 +289,8 @@ require (

replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage

replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/filestorage => ../../extension/storage/filestorage

replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common

replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver => ../../receiver/opencensusreceiver
Expand Down
4 changes: 2 additions & 2 deletions connector/datadogconnector/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,6 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prome

replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver => ../../receiver/hostmetricsreceiver

replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage

replace github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusremotewriteexporter => ../../exporter/prometheusremotewriteexporter

replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver => ../../receiver/filelogreceiver
Expand Down Expand Up @@ -260,3 +258,5 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/commo
replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil => ../../internal/aws/ecsutil

replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor => ../../processor/k8sattributesprocessor

replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage
4 changes: 2 additions & 2 deletions exporter/datadogexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,6 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filel

replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza => ../../pkg/stanza

replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage

replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil

replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter => ../../internal/filter
Expand Down Expand Up @@ -356,3 +354,5 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/datad
replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite => ../../pkg/translator/prometheusremotewrite

replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor => ../../processor/tailsamplingprocessor

replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage
1 change: 1 addition & 0 deletions extension/storage/dbstorage/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../../Makefile.Common
5 changes: 5 additions & 0 deletions extension/storage/dbstorage/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

//go:generate mdatagen metadata.yaml
package dbstorage // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/dbstorage"
61 changes: 61 additions & 0 deletions extension/storage/dbstorage/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
module github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/dbstorage

go 1.20

require (
github.com/jackc/pgx/v4 v4.18.1
github.com/mattn/go-sqlite3 v1.14.22
github.com/stretchr/testify v1.8.4
go.opentelemetry.io/collector/component v0.94.1
go.opentelemetry.io/collector/extension v0.94.1
go.opentelemetry.io/otel/metric v1.23.0
go.opentelemetry.io/otel/trace v1.23.0
go.uber.org/goleak v1.3.0
go.uber.org/zap v1.26.0
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgconn v1.14.0 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgproto3/v2 v2.3.2 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/pgtype v1.14.0 // indirect
github.com/knadh/koanf/maps v0.1.1 // indirect
github.com/knadh/koanf/providers/confmap v0.1.0 // indirect
github.com/knadh/koanf/v2 v2.0.2 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.18.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.46.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.94.1 // indirect
go.opentelemetry.io/collector/confmap v0.94.1 // indirect
go.opentelemetry.io/collector/pdata v1.1.0 // indirect
go.opentelemetry.io/otel v1.23.0 // indirect
go.opentelemetry.io/otel/exporters/prometheus v0.45.1 // indirect
go.opentelemetry.io/otel/sdk v1.23.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.23.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/grpc v1.61.0 // indirect
google.golang.org/protobuf v1.32.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 2047ee9

Please sign in to comment.