Skip to content

Commit

Permalink
Merge branch 'main' into remove-deprecated-flags
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdandrutu authored Aug 5, 2022
2 parents 9b543aa + 5f3b0d8 commit 8736945
Show file tree
Hide file tree
Showing 43 changed files with 1,510 additions and 3,358 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,14 @@
- `component.ReceiverFactory.TracesReceiverStability`
- `component.ReceiverFactory.MetricsReceiverStability`
- `component.ReceiverFactory.LogsReceiverStability`
- Deprecate `obsreport.ProcessorSettings.Level` and `obsreport.ExporterSettings.Level`, use MetricsLevel from CreateSettings (#5824)

### 💡 Enhancements 💡

- Enable persistent queue in the build by default (#5828)
- Bump to opentelemetry-proto v0.19.0. (#5823)
- Expose `Scope.Attributes` in pdata (#5826)

### 🧰 Bug fixes 🧰

## v0.57.2 Beta
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ gomoddownload:

.PHONY: gotest
gotest:
@$(MAKE) for-all-target TARGET="test test-unstable"
@$(MAKE) for-all-target TARGET="test"

.PHONY: gobenchmark
gobenchmark:
Expand All @@ -75,7 +75,7 @@ goporto:

.PHONY: golint
golint:
@$(MAKE) for-all-target TARGET="lint lint-unstable"
@$(MAKE) for-all-target TARGET="lint"

.PHONY: goimpi
goimpi:
Expand Down Expand Up @@ -236,7 +236,7 @@ gendependabot: $(eval SHELL:=/bin/bash)
OPENTELEMETRY_PROTO_SRC_DIR=pdata/internal/opentelemetry-proto

# The SHA matching the current version of the proto to use
OPENTELEMETRY_PROTO_VERSION=v0.18.0
OPENTELEMETRY_PROTO_VERSION=v0.19.0

# Find all .proto files.
OPENTELEMETRY_PROTO_FILES := $(subst $(OPENTELEMETRY_PROTO_SRC_DIR)/,,$(wildcard $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/*/v1/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/collector/*/v1/*.proto))
Expand Down
8 changes: 0 additions & 8 deletions Makefile.Common
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ GH := $(shell which gh)
test:
$(GOTEST) $(GOTEST_OPT) ./...

.PHONY: test-unstable
test-unstable:
$(GOTEST) $(GOTEST_OPT) -tags enable_unstable ./...

.PHONY: test-with-cover
test-with-cover:
$(GO_ACC) --output=coverage.out ./...
Expand All @@ -44,10 +40,6 @@ tidy:
lint:
$(LINT) run

.PHONY: lint-unstable
lint-unstable:
$(LINT) run --build-tags enable_unstable

.PHONY: generate
generate:
$(GOCMD) generate ./...
Expand Down
9 changes: 4 additions & 5 deletions exporter/exporterhelper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,14 @@ The following configuration options can be modified:

### Persistent Queue

**Status: under development**
**Status: [alpha]**

> :warning: The capability is under development and currently can be enabled only in OpenTelemetry
> Collector Contrib with `enable_unstable` build tag set.
> :warning: The capability is under development. To use it, a storage extension needs to be set up.
With this build tag set, additional configuration option can be enabled:
To use the persistent queue, the following setting needs to be set:

- `sending_queue`
- `storage` (default = none): When set, enables persistence and uses the component specified as a storage extension for the persistent queue
(note, `enable_unstable` build tag needs to be enabled first, see below for more details)

The maximum number of batches stored to disk can be controlled using `sending_queue.queue_size` parameter (which,
similarly as for in-memory buffering, defaults to 5000 batches).
Expand Down Expand Up @@ -111,3 +109,4 @@ service:
```

[filestorage]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/storage/filestorage
[alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha
6 changes: 1 addition & 5 deletions exporter/exporterhelper/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,7 @@ type baseExporter struct {
func newBaseExporter(cfg config.Exporter, set component.ExporterCreateSettings, bs *baseSettings, signal config.DataType, reqUnmarshaler internal.RequestUnmarshaler) *baseExporter {
be := &baseExporter{}

be.obsrep = newObsExporter(obsreport.ExporterSettings{
Level: set.MetricsLevel,
ExporterID: cfg.ID(),
ExporterCreateSettings: set,
}, globalInstruments)
be.obsrep = newObsExporter(obsreport.ExporterSettings{ExporterID: cfg.ID(), ExporterCreateSettings: set}, globalInstruments)
be.qrSender = newQueuedRetrySender(cfg.ID(), signal, bs.QueueSettings, bs.RetrySettings, reqUnmarshaler, &timeoutSender{cfg: bs.TimeoutSettings}, set.Logger)
be.sender = be.qrSender
be.StartFunc = func(ctx context.Context, host component.Host) error {
Expand Down
3 changes: 0 additions & 3 deletions exporter/exporterhelper/internal/persistent_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build enable_unstable
// +build enable_unstable

package internal // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal"

import (
Expand Down
3 changes: 0 additions & 3 deletions exporter/exporterhelper/internal/persistent_queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build enable_unstable
// +build enable_unstable

package internal

import (
Expand Down
3 changes: 0 additions & 3 deletions exporter/exporterhelper/internal/persistent_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build enable_unstable
// +build enable_unstable

package internal // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal"

import (
Expand Down
3 changes: 0 additions & 3 deletions exporter/exporterhelper/internal/persistent_storage_batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build enable_unstable
// +build enable_unstable

package internal // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal"

import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build enable_unstable
// +build enable_unstable

package internal

import (
Expand Down
3 changes: 0 additions & 3 deletions exporter/exporterhelper/internal/persistent_storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build enable_unstable
// +build enable_unstable

package internal

import (
Expand Down
9 changes: 7 additions & 2 deletions exporter/exporterhelper/logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/config"
"go.opentelemetry.io/collector/config/configtelemetry"
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/consumer/consumererror"
"go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics"
Expand Down Expand Up @@ -107,7 +108,9 @@ func TestLogsExporter_Default_ReturnError(t *testing.T) {
}

func TestLogsExporter_WithRecordLogs(t *testing.T) {
le, err := NewLogsExporter(&fakeLogsExporterConfig, componenttest.NewNopExporterCreateSettings(), newPushLogsData(nil))
set := componenttest.NewNopExporterCreateSettings()
set.TelemetrySettings.MetricsLevel = configtelemetry.LevelNormal
le, err := NewLogsExporter(&fakeLogsExporterConfig, set, newPushLogsData(nil))
require.NoError(t, err)
require.NotNil(t, le)

Expand All @@ -116,7 +119,9 @@ func TestLogsExporter_WithRecordLogs(t *testing.T) {

func TestLogsExporter_WithRecordLogs_ReturnError(t *testing.T) {
want := errors.New("my_error")
le, err := NewLogsExporter(&fakeLogsExporterConfig, componenttest.NewNopExporterCreateSettings(), newPushLogsData(want))
set := componenttest.NewNopExporterCreateSettings()
set.TelemetrySettings.MetricsLevel = configtelemetry.LevelNormal
le, err := NewLogsExporter(&fakeLogsExporterConfig, set, newPushLogsData(want))
require.Nil(t, err)
require.NotNil(t, le)

Expand Down
9 changes: 7 additions & 2 deletions exporter/exporterhelper/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/config"
"go.opentelemetry.io/collector/config/configtelemetry"
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/consumer/consumererror"
"go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics"
Expand Down Expand Up @@ -106,7 +107,9 @@ func TestMetricsExporter_Default_ReturnError(t *testing.T) {
}

func TestMetricsExporter_WithRecordMetrics(t *testing.T) {
me, err := NewMetricsExporter(&fakeMetricsExporterConfig, componenttest.NewNopExporterCreateSettings(), newPushMetricsData(nil))
set := componenttest.NewNopExporterCreateSettings()
set.TelemetrySettings.MetricsLevel = configtelemetry.LevelNormal
me, err := NewMetricsExporter(&fakeMetricsExporterConfig, set, newPushMetricsData(nil))
require.NoError(t, err)
require.NotNil(t, me)

Expand All @@ -115,7 +118,9 @@ func TestMetricsExporter_WithRecordMetrics(t *testing.T) {

func TestMetricsExporter_WithRecordMetrics_ReturnError(t *testing.T) {
want := errors.New("my_error")
me, err := NewMetricsExporter(&fakeMetricsExporterConfig, componenttest.NewNopExporterCreateSettings(), newPushMetricsData(want))
set := componenttest.NewNopExporterCreateSettings()
set.TelemetrySettings.MetricsLevel = configtelemetry.LevelNormal
me, err := NewMetricsExporter(&fakeMetricsExporterConfig, set, newPushMetricsData(want))
require.NoError(t, err)
require.NotNil(t, me)

Expand Down
2 changes: 0 additions & 2 deletions exporter/exporterhelper/obsreport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"go.opencensus.io/tag"

"go.opentelemetry.io/collector/config"
"go.opentelemetry.io/collector/config/configtelemetry"
"go.opentelemetry.io/collector/obsreport"
"go.opentelemetry.io/collector/obsreport/obsreporttest"
)
Expand All @@ -37,7 +36,6 @@ func TestExportEnqueueFailure(t *testing.T) {

insts := newInstruments(metric.NewRegistry())
obsrep := newObsExporter(obsreport.ExporterSettings{
Level: configtelemetry.LevelNormal,
ExporterID: exporter,
ExporterCreateSettings: tt.ToExporterCreateSettings(),
}, insts)
Expand Down
Loading

0 comments on commit 8736945

Please sign in to comment.