diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f5db4c520b..cdffa23ebba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,15 +4,27 @@ ### πŸ›‘ Breaking changes πŸ›‘ +- Remove service/defaultcomponents deprecated package (#5019) + +## v0.47.0 Beta + +### πŸ›‘ Breaking changes πŸ›‘ + - Remove `Type` funcs in pdata (#4933) -- Rename `pdata.AttributeMap.Delete` to `pdata.AttributeMap.Remove` (#4914) - pdata: deprecate funcs working with InternalRep (#4957) +- Remove all deprecated funcs/structs from v0.46.0 (#4995) - AsString for pdata.AttributeValue now returns the JSON-encoded string of floats. (#4934) +### 🚩 Deprecations 🚩 + +- Deprecate `pdata.AttributeMap.Delete` in favor of `pdata.AttributeMap.Remove` (#4914) +- Deprecate consumerhelper, move helpers to consumer (#5006) + ### πŸ’‘ Enhancements πŸ’‘ - Add `pdata.AttributeMap.RemoveIf`, which is a more performant way to remove multiple keys (#4914) - Add `pipeline` key with pipeline identifier to processor loggers (#4968) +- Add a new yaml provider, allows providing yaml bytes (#4998) ### 🧰 Bug fixes 🧰 @@ -24,6 +36,14 @@ ### πŸ›‘ Breaking changes πŸ›‘ +- Change otel collector to enable open telemetry metrics through feature gate instead of a constant (#4912) +- Remove support for legacy otlp/http port. (#4916) +- Remove deprecated funcs in pdata (#4809) +- Remove deprecated Retrieve funcs/calls (#4922) +- Remove deprecated NewConfigProvider funcs (#4937) + +### 🚩 Deprecations 🚩 + - Deprecated funcs `config.DefaultConfig`, `confighttp.DefaultHTTPSettings`, `exporterhelper.DefaultTimeoutSettings`, `exporthelper.DefaultQueueSettings`, `exporterhelper.DefaultRetrySettings`, `testcomponents.DefaultFactories`, and `scraperhelper.DefaultScraperControllerSettings` in favour for their `NewDefault` method to adhere to contribution guidelines (#4865) @@ -50,11 +70,6 @@ - Deprecated `receiverhelper.WithMetrics` in favour of `component.WithMetricsReceiver` - Deprecated `receiverhelper.WithLogs` in favour of `component.WithLogsReceiver` - Deprecated `receiverhelper.NewFactory` in favour of `component.NewReceiverFactory` -- Change otel collector to enable open telemetry metrics through feature gate instead of a constant -- Remove support for legacy otlp/http port. (#4916) -- Remove deprecated funcs in pdata (#4809) -- Remove deprecated Retrieve funcs/calls (#4922) -- Remove deprecated NewConfigProvider funcs (#4937) ### πŸ’‘ Enhancements πŸ’‘ @@ -76,9 +91,14 @@ ### πŸ›‘ Breaking changes πŸ›‘ - Remove deprecated funcs in configtelemetry (#4808) -- Deprecate `service/defaultcomponents` go package (#4622) - `otlphttp` and `otlp` exporters enable gzip compression by default (#4632) +### 🚩 Deprecations 🚩 + +- Deprecate `service/defaultcomponents` go package (#4622) +- Deprecate `pdata.NumberDataPoint.Type()` and `pdata.Exemplar.Type()` in favor of `NumberDataPoint.ValueType()` and + `Exemplar.ValueType()` (#4850) + ### πŸ’‘ Enhancements πŸ’‘ - Reject invalid queue size exporterhelper (#4799) @@ -90,21 +110,19 @@ - `confighttp`: Allow CORS requests with configured auth (#4869) -### 🚩 Deprecations 🚩 - -- Deprecate `pdata.NumberDataPoint.Type()` and `pdata.Exemplar.Type()` in favor of `NumberDataPoint.ValueType()` and - `Exemplar.ValueType()` (#4850) - ## v0.44.0 Beta ### πŸ›‘ Breaking changes πŸ›‘ -- Deprecate `service.NewConfigProvider`, and a new version `service.MustNewConfigProvider` (#4734). - Updated to OTLP 0.12.0. Deprecated traces and metrics messages that existed in 0.11.0 are no longer converted to the messages and fields that replaced the deprecated ones. Received deprecated messages and fields will be now ignored. In OTLP/JSON in the instrumentationLibraryLogs object the "logs" field is now named "logRecords" (#4724) +### 🚩 Deprecations 🚩 + +- Deprecate `service.NewConfigProvider`, and a new version `service.MustNewConfigProvider` (#4734). + ### πŸ’‘ Enhancements πŸ’‘ - Invalid requests now return an appropriate unsupported (`405`) or method not allowed (`415`) response (#4735) @@ -132,11 +150,14 @@ - Usages of `--metrics-level={VALUE}` can be replaced by `--set=service.telemetry.metrics.level={VALUE}`; - Usages of `--metrics-addr={VALUE}` can be replaced by `--set=service.telemetry.metrics.address={VALUE}`; - Updated confighttp `ToClient` to support passing telemetry settings for instrumenting otlphttp exporter(#4449) -- Deprecate `configtelemetry.Level.Set()` (#4700) - Remove support to some arches and platforms from `ocb` (opentelemetry-collector-builder) (#4710) - Remove deprecated legacy path ("v1/trace") support for otlp http receiver (#4720) - Change the `service.NewDefaultConfigProvider` to accept a slice of location strings (#4727). +### 🚩 Deprecations 🚩 + +- Deprecate `configtelemetry.Level.Set()` (#4700) + ### 🧰 Bug fixes 🧰 - Ensure Windows path (e.g: C:) is recognized as a file path (#4726) @@ -369,8 +390,6 @@ - Artifacts are no longer published in this repository, check [here](https://github.com/open-telemetry/opentelemetry-collector-releases) (#3941) - Remove deprecated `tracetranslator.AttributeValueToString` and `tracetranslator.AttributeMapToMap` (#3873) - Change semantic conventions for status (code, msg) as per specifications (#3872) -- Add `pdata.NewTimestampFromTime`, deprecate `pdata.TimestampFromTime` (#3868) -- Add `pdata.NewAttributeMapFromMap`, deprecate `pdata.AttributeMap.InitFromMap` (#3936) - Move `fileexporter` to contrib (#3474) - Move `jaegerexporter` to contrib (#3474) - Move `kafkaexporter` to contrib (#3474) @@ -401,6 +420,11 @@ - Move `processor/processorhelper/attraction` to contrib (#3474) - Move `translator/conventions` to `model/semconv` (#3901) +### 🚩 Deprecations 🚩 + +- Add `pdata.NewTimestampFromTime`, deprecate `pdata.TimestampFromTime` (#3868) +- Add `pdata.NewAttributeMapFromMap`, deprecate `pdata.AttributeMap.InitFromMap` (#3936) + ## v0.33.0 Beta ### πŸ›‘ Breaking changes πŸ›‘ @@ -507,9 +531,12 @@ This release is marked as "bad" since the metrics pipelines will produce bad dat - zipkinv1 implement directly Unmarshaler interface (#3504) - zipkinv2 implement directly Marshaler/Unmarshaler interface (#3505) - Change exporterhelper to accept ExporterCreateSettings instead of just logger (#3569) -- Deprecate Resize() from pdata slice APIs (#3573) - Use Func pattern in processorhelper, consistent with others (#3570) +### 🚩 Deprecations 🚩 + +- Deprecate Resize() from pdata slice APIs (#3573) + ### πŸ’‘ Enhancements πŸ’‘ - Update OTLP to v0.8.0 (#3572) @@ -677,10 +704,13 @@ This release is marked as "bad" since the metrics pipelines will produce bad dat - Rename `ApplicationStartInfo.ExeName` to `BuildInfo.Command` - Rename `ApplicationStartInfo.LongName` to `BuildInfo.Description` +### 🚩 Deprecations 🚩 + +- Add AppendEmpty and deprecate Append for slices (#2970) + ### πŸ’‘ Enhancements πŸ’‘ - `kafka` exporter: Add logs support (#2943) -- Add AppendEmpty and deprecate Append for slices (#2970) - Update mdatagen to create factories of init instead of new (#2978) - `zipkin` receiver: Reduce the judgment of zipkin v1 version (#2990) - Custom authenticator logic to accept a `component.Host` which will extract the authenticator to use based on a new authenticator name property (#2767) @@ -772,13 +802,16 @@ This release is marked as "bad" since the metrics pipelines will produce bad dat - Move `configmodels` to `config` (#2808) - Move `fluentforward` receiver to contrib (#2723) +### 🚩 Deprecations 🚩 + +- Deprecate `consumetest.New[${SIGNAL}]Nop` in favor of `consumetest.NewNop` (#2878) +- Deprecate `consumetest.New[${SIGNAL}]Err` in favor of `consumetest.NewErr` (#2878) + ### πŸ’‘ Enhancements πŸ’‘ - `batch` processor: - Support max batch size for logs (#2736) - Use `Endpoint` for health check extension (#2782) - Use `confignet.TCPAddr` for `pprof` and `zpages` extensions (#2829) -- Deprecate `consumetest.New[${SIGNAL}]Nop` in favor of `consumetest.NewNop` (#2878) -- Deprecate `consumetest.New[${SIGNAL}]Err` in favor of `consumetest.NewErr` (#2878) - Add watcher to values retrieved via config sources (#2803) - Updates for cloud semantic conventions (#2809) - `cloud.infrastructure_service` -> `cloud.platform` @@ -1012,14 +1045,17 @@ This release is marked as "bad" since the metrics pipelines will produce bad dat - Rename component.TraceReceiver to component.TracesReceiver #1975 - Rename component.TraceProcessor to component.TracesProcessor #1976 - Rename component.TraceExporter to component.TracesExporter #1975 -- Deprecate NopExporter, add NopConsumer (#1972) -- Deprecate SinkExporter, add SinkConsumer (#1973) - Move `tailsampling` processor to contrib (#2012) - Remove NewAttributeValueSlice (#2028) and mark NewAttributeValue as deprecated (#2022) - Remove pdata.StringValue (#2021) - Remove pdata.InitFromAttributeMap, use CopyTo if needed (#2042) - Remove SetMapVal and SetArrayVal for pdata.AttributeValue (#2039) +### 🚩 Deprecations 🚩 + +- Deprecate NopExporter, add NopConsumer (#1972) +- Deprecate SinkExporter, add SinkConsumer (#1973) + ### πŸ’‘ Enhancements πŸ’‘ - `zipkin` exporter: Add queue retry to zipkin (#1971) @@ -1093,13 +1129,16 @@ This release is marked as "bad" since the metrics pipelines will produce bad dat - Add filters for mount point and filesystem type (#1866) - Add cloud.provider semantic conventions (#1865) - `attribute` processor: Add log support (#1783) -- Deprecate OpenCensus-based internal data structures (#1843) - Introduce SpanID data type, not yet used in Protobuf messages ($1854, #1855) - Enable `otlp` trace by default in the released docker image (#1883) - `tailsampling` processor: Combine batches of spans into a single batch (#1864) - `filter` processor: Update to use pdata (#1885) - Allow MSI upgrades (#1914) +### 🚩 Deprecations 🚩 + +- Deprecate OpenCensus-based internal data structures (#1843) + ### 🧰 Bug fixes 🧰 - `prometheus` receiver: Print a more informative message about 'up' metric value (#1826) diff --git a/Makefile b/Makefile index 19bc35672f8..e97076a7623 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ BUILD_INFO=-ldflags "-X $(BUILD_INFO_IMPORT_PATH).Version=$(VERSION)" RUN_CONFIG?=examples/local/otel-config.yaml CONTRIB_PATH=$(CURDIR)/../opentelemetry-collector-contrib -COMP_REL_PATH=service/defaultcomponents/defaults.go +COMP_REL_PATH=cmd/otelcorecol/components.go MOD_NAME=go.opentelemetry.io/collector ADDLICENSE=addlicense @@ -230,7 +230,7 @@ gendependabot: $(eval SHELL:=/bin/bash) OPENTELEMETRY_PROTO_SRC_DIR=model/internal/opentelemetry-proto # The SHA matching the current version of the proto to use -OPENTELEMETRY_PROTO_VERSION=v0.12.0 +OPENTELEMETRY_PROTO_VERSION=v0.14.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)) @@ -244,7 +244,7 @@ PROTO_PACKAGE=go.opentelemetry.io/collector/$(PROTO_TARGET_GEN_DIR) # Intermediate directory used during generation. PROTO_INTERMEDIATE_DIR=model/internal/.patched-otlp-proto -DOCKER_PROTOBUF ?= otel/build-protobuf:0.4.1 +DOCKER_PROTOBUF ?= otel/build-protobuf:0.9.0 PROTOC := docker run --rm -u ${shell id -u} -v${PWD}:${PWD} -w${PWD}/$(PROTO_INTERMEDIATE_DIR) ${DOCKER_PROTOBUF} --proto_path=${PWD} PROTO_INCLUDES := -I/usr/include/github.com/gogo/protobuf -I./ diff --git a/README.md b/README.md index 12a395d26e0..af45ab625db 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@   •   Getting Involved   •   - Getting In Touch + Getting In Touch

@@ -48,7 +48,7 @@ The OpenTelemetry Collector offers a vendor-agnostic implementation on how to receive, process and export telemetry data. In addition, it removes the need to run, operate and maintain multiple agents/collectors in order to support -open-source telemetry data formats (e.g. Jaeger, Prometheus, etc.) sending to +open-source telemetry data formats (e.g. Jaeger, Prometheus, etc.) to multiple open-source or commercial back-ends. Objectives: @@ -81,13 +81,13 @@ functionality and configuration: || OTLP receiver configuration | Beta | || OTLP exporter functionality | Beta | || OTLP exporter configuration | Beta | -|Common| Logging exporter | unstable | +|Common| Logging exporter | Unstable | || Batch processor functionality | Beta | || Batch processor configuration | Beta | || MemoryLimiter processor functionality | Beta | || MemoryLimiter processor configuration | Beta | -We follow the production maturity level defined [here](https://github.com/open-telemetry/community/blob/47813530864b9fe5a5146f466a58bd2bb94edc72/maturity-matrix.yaml#L31) +We follow the production maturity level defined [here](https://github.com/open-telemetry/community/blob/47813530864b9fe5a5146f466a58bd2bb94edc72/maturity-matrix.yaml#L31). ### Compatibility @@ -103,46 +103,47 @@ Official OpenTelemetry Collector distro binaries may be built with any supported ## Contributing -See [CONTRIBUTING.md](CONTRIBUTING.md). +See the [Contributing Guide](CONTRIBUTING.md) for details. -Triagers ([@open-telemetry/collector-triagers](https://github.com/orgs/open-telemetry/teams/collector-triagers)): +Here is a list of community roles with current and previous members: -- [Alolita Sharma](https://github.com/alolita), AWS -- [Punya Biswal](https://github.com/punya), Google -- [Steve Flanders](https://github.com/flands), Splunk +- Triagers ([@open-telemetry/collector-triagers](https://github.com/orgs/open-telemetry/teams/collector-triagers)): + - [Alolita Sharma](https://github.com/alolita), AWS + - [Punya Biswal](https://github.com/punya), Google + - [Steve Flanders](https://github.com/flands), Splunk -Emeritus Triagers: +- Emeritus Triagers: -- [Andrew Hsu](https://github.com/andrewhsu), Lightstep + - [Andrew Hsu](https://github.com/andrewhsu), Lightstep -Approvers ([@open-telemetry/collector-approvers](https://github.com/orgs/open-telemetry/teams/collector-approvers)): +- Approvers ([@open-telemetry/collector-approvers](https://github.com/orgs/open-telemetry/teams/collector-approvers)): -- [Anthony Mirabella](https://github.com/Aneurysm9), AWS -- [Dmitrii Anoshin](https://github.com/dmitryax), Splunk -- [Juraci PaixΓ£o KrΓΆhling](https://github.com/jpkrohling), Grafana Labs -- [Pablo Baeyens](https://github.com/mx-psi), DataDog + - [Anthony Mirabella](https://github.com/Aneurysm9), AWS + - [Dmitrii Anoshin](https://github.com/dmitryax), Splunk + - [Juraci PaixΓ£o KrΓΆhling](https://github.com/jpkrohling), Grafana Labs + - [Pablo Baeyens](https://github.com/mx-psi), DataDog -Emeritus Approvers: +- Emeritus Approvers: -- [James Bebbington](https://github.com/james-bebbington), Google -- [Jay Camp](https://github.com/jrcamp), Splunk -- [Nail Islamov](https://github.com/nilebox), Google -- [Owais Lone](https://github.com/owais), Splunk -- [Rahul Patel](https://github.com/rghetia), Google -- [Steven Karis](https://github.com/sjkaris), Splunk -- [Yang Song](https://github.com/songy23), Google + - [James Bebbington](https://github.com/james-bebbington), Google + - [Jay Camp](https://github.com/jrcamp), Splunk + - [Nail Islamov](https://github.com/nilebox), Google + - [Owais Lone](https://github.com/owais), Splunk + - [Rahul Patel](https://github.com/rghetia), Google + - [Steven Karis](https://github.com/sjkaris), Splunk + - [Yang Song](https://github.com/songy23), Google -Maintainers ([@open-telemetry/collector-maintainers](https://github.com/orgs/open-telemetry/teams/collector-maintainers)): +- Maintainers ([@open-telemetry/collector-maintainers](https://github.com/orgs/open-telemetry/teams/collector-maintainers)): -- [Alex Boten](https://github.com/codeboten), Lightstep -- [Bogdan Drutu](https://github.com/BogdanDrutu), Splunk -- [Tigran Najaryan](https://github.com/tigrannajaryan), Splunk + - [Alex Boten](https://github.com/codeboten), Lightstep + - [Bogdan Drutu](https://github.com/BogdanDrutu), Splunk + - [Tigran Najaryan](https://github.com/tigrannajaryan), Splunk -Emeritus Maintainers: +- Emeritus Maintainers: -- [Paulo Janotti](https://github.com/pjanotti), Splunk + - [Paulo Janotti](https://github.com/pjanotti), Splunk -Learn more about roles in the [community repository](https://github.com/open-telemetry/community/blob/main/community-membership.md). +Learn more about roles in [Community membership](https://github.com/open-telemetry/community/blob/main/community-membership.md). Thanks to all the people who already contributed! diff --git a/cmd/builder/internal/builder/config.go b/cmd/builder/internal/builder/config.go index 43ce82feb48..fa36220924b 100644 --- a/cmd/builder/internal/builder/config.go +++ b/cmd/builder/internal/builder/config.go @@ -25,7 +25,7 @@ import ( "go.uber.org/zap" ) -const defaultOtelColVersion = "0.46.0" +const defaultOtelColVersion = "0.47.0" // ErrInvalidGoMod indicates an invalid gomod var ErrInvalidGoMod = errors.New("invalid gomod specification for module") @@ -63,9 +63,6 @@ type Module struct { Path string `mapstructure:"path"` // an optional path to the local version of this module } -// Deprecated: [v0.46.0] Use NewDefaultConfig instead -var DefaultConfig = NewDefaultConfig - // NewDefaultConfig creates a new config, with default values func NewDefaultConfig() Config { log, err := zap.NewDevelopment() diff --git a/cmd/builder/internal/builder/config_test.go b/cmd/builder/internal/builder/config_test.go index 709001a17b3..a33a72de824 100644 --- a/cmd/builder/internal/builder/config_test.go +++ b/cmd/builder/internal/builder/config_test.go @@ -131,8 +131,8 @@ func TestInvalidModule(t *testing.T) { } } -func TestDefaultConfig(t *testing.T) { - cfg := DefaultConfig() +func TestNewDefaultConfig(t *testing.T) { + cfg := NewDefaultConfig() require.NoError(t, cfg.ParseModules()) require.NoError(t, cfg.Validate()) } diff --git a/cmd/builder/internal/builder/main_test.go b/cmd/builder/internal/builder/main_test.go index 5cee3de3f6f..c637438d763 100644 --- a/cmd/builder/internal/builder/main_test.go +++ b/cmd/builder/internal/builder/main_test.go @@ -25,18 +25,18 @@ import ( ) func TestGenerateDefault(t *testing.T) { - require.NoError(t, Generate(DefaultConfig())) + require.NoError(t, Generate(NewDefaultConfig())) } func TestGenerateInvalidCollectorVersion(t *testing.T) { - cfg := DefaultConfig() + cfg := NewDefaultConfig() cfg.Distribution.OtelColVersion = "invalid" err := Generate(cfg) require.NoError(t, err) } func TestGenerateInvalidOutputPath(t *testing.T) { - cfg := DefaultConfig() + cfg := NewDefaultConfig() cfg.Distribution.OutputPath = "/invalid" err := Generate(cfg) require.Error(t, err) @@ -49,7 +49,7 @@ func TestGenerateAndCompileDefault(t *testing.T) { log.Fatal(err) } defer os.RemoveAll(dir) - cfg := DefaultConfig() + cfg := NewDefaultConfig() cfg.Distribution.OutputPath = dir // we override this version, otherwise this would break during releases diff --git a/cmd/otelcorecol/builder-config.yaml b/cmd/otelcorecol/builder-config.yaml index 7f0a472c629..e7993cd6810 100644 --- a/cmd/otelcorecol/builder-config.yaml +++ b/cmd/otelcorecol/builder-config.yaml @@ -2,29 +2,29 @@ dist: module: go.opentelemetry.io/collector/cmd/otelcorecol name: otelcorecol description: Local OpenTelemetry Collector binary, testing only. - version: 0.46.1-dev - otelcol_version: 0.46.0 + version: 0.47.1-dev + otelcol_version: 0.47.0 receivers: - import: go.opentelemetry.io/collector/receiver/otlpreceiver - gomod: go.opentelemetry.io/collector v0.46.0 + gomod: go.opentelemetry.io/collector v0.47.0 exporters: - import: go.opentelemetry.io/collector/exporter/loggingexporter - gomod: go.opentelemetry.io/collector v0.46.0 + gomod: go.opentelemetry.io/collector v0.47.0 - import: go.opentelemetry.io/collector/exporter/otlpexporter - gomod: go.opentelemetry.io/collector v0.46.0 + gomod: go.opentelemetry.io/collector v0.47.0 - import: go.opentelemetry.io/collector/exporter/otlphttpexporter - gomod: go.opentelemetry.io/collector v0.46.0 + gomod: go.opentelemetry.io/collector v0.47.0 extensions: - import: go.opentelemetry.io/collector/extension/ballastextension - gomod: go.opentelemetry.io/collector v0.46.0 + gomod: go.opentelemetry.io/collector v0.47.0 - import: go.opentelemetry.io/collector/extension/zpagesextension - gomod: go.opentelemetry.io/collector v0.46.0 + gomod: go.opentelemetry.io/collector v0.47.0 processors: - import: go.opentelemetry.io/collector/processor/batchprocessor - gomod: go.opentelemetry.io/collector v0.46.0 + gomod: go.opentelemetry.io/collector v0.47.0 - import: go.opentelemetry.io/collector/processor/memorylimiterprocessor - gomod: go.opentelemetry.io/collector v0.46.0 + gomod: go.opentelemetry.io/collector v0.47.0 replaces: - go.opentelemetry.io/collector => ../../ diff --git a/cmd/otelcorecol/go.mod b/cmd/otelcorecol/go.mod index d6551d3a6a1..eab2277c1ff 100644 --- a/cmd/otelcorecol/go.mod +++ b/cmd/otelcorecol/go.mod @@ -6,7 +6,7 @@ go 1.17 require ( github.com/stretchr/testify v1.7.0 - go.opentelemetry.io/collector v0.46.0 + go.opentelemetry.io/collector v0.47.0 golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 ) @@ -54,7 +54,7 @@ require ( github.com/tklauser/numcpus v0.3.0 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect go.opencensus.io v0.23.0 // indirect - go.opentelemetry.io/collector/model v0.46.0 // indirect + go.opentelemetry.io/collector/model v0.47.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.29.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.29.0 // indirect go.opentelemetry.io/contrib/zpages v0.29.0 // indirect diff --git a/cmd/otelcorecol/main.go b/cmd/otelcorecol/main.go index ad2a86a9aaf..0629b9faef8 100644 --- a/cmd/otelcorecol/main.go +++ b/cmd/otelcorecol/main.go @@ -21,7 +21,7 @@ func main() { info := component.BuildInfo{ Command: "otelcorecol", Description: "Local OpenTelemetry Collector binary, testing only.", - Version: "0.46.1-dev", + Version: "0.47.1-dev", } if err := run(service.CollectorSettings{BuildInfo: info, Factories: factories}); err != nil { diff --git a/component/componenthelper/component.go b/component/componenthelper/component.go index 9dedfe0c288..35e8633bcd6 100644 --- a/component/componenthelper/component.go +++ b/component/componenthelper/component.go @@ -18,12 +18,6 @@ import ( "go.opentelemetry.io/collector/component" ) -// Deprecated: [v0.46.0] use component.StartFunc. -type StartFunc = component.StartFunc - -// Deprecated: [v0.46.0] use component.ShutdownFunc. -type ShutdownFunc = component.ShutdownFunc - // Option represents the possible options for New. type Option func(*baseComponent) diff --git a/config/confighttp/confighttp.go b/config/confighttp/confighttp.go index de7ebb41693..8a062efdada 100644 --- a/config/confighttp/confighttp.go +++ b/config/confighttp/confighttp.go @@ -82,9 +82,6 @@ type HTTPClientSettings struct { IdleConnTimeout *time.Duration `mapstructure:"idle_conn_timeout"` } -// Deprecated: [v0.46.0] Use NewDefaultHTTPClientSettings instead. -var DefaultHTTPClientSettings = NewDefaultHTTPClientSettings - // NewDefaultHTTPClientSettings returns HTTPClientSettings type object with // the default values of 'MaxIdleConns' and 'IdleConnTimeout'. // Other config options are not added as they are initialized with 'zero value' by GoLang as default. diff --git a/config/configmapprovider/yaml.go b/config/configmapprovider/yaml.go new file mode 100644 index 00000000000..15e4f0dccb7 --- /dev/null +++ b/config/configmapprovider/yaml.go @@ -0,0 +1,58 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package configmapprovider // import "go.opentelemetry.io/collector/config/configmapprovider" + +import ( + "context" + "fmt" + "strings" + + "gopkg.in/yaml.v2" + + "go.opentelemetry.io/collector/config" +) + +const bytesSchemeName = "yaml" + +type yamlMapProvider struct{} + +// NewYAML returns a new Provider that allows to provide yaml bytes. +// +// This Provider supports "yaml" scheme, and can be called with a "location" that follows: +// bytes-location = "yaml:" yaml-bytes +// +// Examples: +// `yaml:processors::batch::timeout: 2s` +// `yaml:processors::batch/foo::timeout: 3s` +func NewYAML() Provider { + return &yamlMapProvider{} +} + +func (s *yamlMapProvider) Retrieve(_ context.Context, location string, _ WatcherFunc) (Retrieved, error) { + if !strings.HasPrefix(location, bytesSchemeName+":") { + return Retrieved{}, fmt.Errorf("%v location is not supported by %v provider", location, bytesSchemeName) + } + + var data map[string]interface{} + if err := yaml.Unmarshal([]byte(location[len(bytesSchemeName)+1:]), &data); err != nil { + return Retrieved{}, fmt.Errorf("unable to parse yaml: %w", err) + } + + return Retrieved{Map: config.NewMapFromStringMap(data)}, nil +} + +func (s *yamlMapProvider) Shutdown(context.Context) error { + return nil +} diff --git a/config/configmapprovider/yaml_test.go b/config/configmapprovider/yaml_test.go new file mode 100644 index 00000000000..af9571c99b2 --- /dev/null +++ b/config/configmapprovider/yaml_test.go @@ -0,0 +1,106 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package configmapprovider + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestYamlProvider_Empty(t *testing.T) { + sp := NewYAML() + _, err := sp.Retrieve(context.Background(), "", nil) + assert.Error(t, err) + assert.NoError(t, sp.Shutdown(context.Background())) +} + +func TestYamlProvider_InvalidValue(t *testing.T) { + sp := NewYAML() + _, err := sp.Retrieve(context.Background(), "yaml::2s", nil) + assert.Error(t, err) + assert.NoError(t, sp.Shutdown(context.Background())) +} + +func TestYamlProvider(t *testing.T) { + sp := NewYAML() + ret, err := sp.Retrieve(context.Background(), "yaml:processors::batch::timeout: 2s", nil) + assert.NoError(t, err) + assert.Equal(t, map[string]interface{}{ + "processors": map[string]interface{}{ + "batch": map[string]interface{}{ + "timeout": "2s", + }, + }, + }, ret.Map.ToStringMap()) + assert.NoError(t, sp.Shutdown(context.Background())) +} + +func TestYamlProvider_NamedComponent(t *testing.T) { + sp := NewYAML() + ret, err := sp.Retrieve(context.Background(), "yaml:processors::batch/foo::timeout: 3s", nil) + assert.NoError(t, err) + assert.Equal(t, map[string]interface{}{ + "processors": map[string]interface{}{ + "batch/foo": map[string]interface{}{ + "timeout": "3s", + }, + }, + }, ret.Map.ToStringMap()) + assert.NoError(t, sp.Shutdown(context.Background())) +} + +func TestYamlProvider_MapEntry(t *testing.T) { + sp := NewYAML() + ret, err := sp.Retrieve(context.Background(), "yaml:processors: {batch/foo::timeout: 3s, batch::timeout: 2s}", nil) + assert.NoError(t, err) + assert.Equal(t, map[string]interface{}{ + "processors": map[string]interface{}{ + "batch/foo": map[string]interface{}{ + "timeout": "3s", + }, + "batch": map[string]interface{}{ + "timeout": "2s", + }, + }, + }, ret.Map.ToStringMap()) + assert.NoError(t, sp.Shutdown(context.Background())) +} + +func TestYamlProvider_NewLine(t *testing.T) { + sp := NewYAML() + ret, err := sp.Retrieve(context.Background(), "yaml:processors::batch/foo::timeout: 3s\nprocessors::batch::timeout: 2s", nil) + assert.NoError(t, err) + assert.Equal(t, map[string]interface{}{ + "processors": map[string]interface{}{ + "batch/foo": map[string]interface{}{ + "timeout": "3s", + }, + "batch": map[string]interface{}{ + "timeout": "2s", + }, + }, + }, ret.Map.ToStringMap()) + assert.NoError(t, sp.Shutdown(context.Background())) +} + +func TestYamlProvider_DotSeparator(t *testing.T) { + sp := NewYAML() + ret, err := sp.Retrieve(context.Background(), "yaml:processors.batch.timeout: 4s", nil) + assert.NoError(t, err) + assert.Equal(t, map[string]interface{}{"processors.batch.timeout": "4s"}, ret.Map.ToStringMap()) + assert.NoError(t, sp.Shutdown(context.Background())) +} diff --git a/consumer/consumer.go b/consumer/consumer.go index 9d446f65aa6..ddfce62cdda 100644 --- a/consumer/consumer.go +++ b/consumer/consumer.go @@ -15,9 +15,7 @@ package consumer // import "go.opentelemetry.io/collector/consumer" import ( - "context" - - "go.opentelemetry.io/collector/model/pdata" + "errors" ) // Capabilities describes the capabilities of a Processor. @@ -34,26 +32,36 @@ type baseConsumer interface { Capabilities() Capabilities } -// Metrics is the new metrics consumer interface that receives pdata.Metrics, processes it -// as needed, and sends it to the next processing node if any or to the destination. -type Metrics interface { - baseConsumer - // ConsumeMetrics receives pdata.Metrics for consumption. - ConsumeMetrics(ctx context.Context, md pdata.Metrics) error +var errNilFunc = errors.New("nil consumer func") + +type baseImpl struct { + capabilities Capabilities } -// Traces is an interface that receives pdata.Traces, processes it -// as needed, and sends it to the next processing node if any or to the destination. -type Traces interface { - baseConsumer - // ConsumeTraces receives pdata.Traces for consumption. - ConsumeTraces(ctx context.Context, td pdata.Traces) error +// Option to construct new consumers. +type Option func(*baseImpl) + +// WithCapabilities overrides the default GetCapabilities function for a processor. +// The default GetCapabilities function returns mutable capabilities. +func WithCapabilities(capabilities Capabilities) Option { + return func(o *baseImpl) { + o.capabilities = capabilities + } } -// Logs is an interface that receives pdata.Logs, processes it -// as needed, and sends it to the next processing node if any or to the destination. -type Logs interface { - baseConsumer - // ConsumeLogs receives pdata.Logs for consumption. - ConsumeLogs(ctx context.Context, ld pdata.Logs) error +// Capabilities implementation of the base +func (bs baseImpl) Capabilities() Capabilities { + return bs.capabilities +} + +func newBaseImpl(options ...Option) *baseImpl { + bs := &baseImpl{ + capabilities: Capabilities{MutatesData: false}, + } + + for _, op := range options { + op(bs) + } + + return bs } diff --git a/consumer/consumerhelper/common.go b/consumer/consumerhelper/common.go index 8081e4826fe..0081fc50bde 100644 --- a/consumer/consumerhelper/common.go +++ b/consumer/consumerhelper/common.go @@ -15,41 +15,11 @@ package consumerhelper // import "go.opentelemetry.io/collector/consumer/consumerhelper" import ( - "errors" - "go.opentelemetry.io/collector/consumer" ) -var errNilFunc = errors.New("nil consumer func") - -type baseConsumer struct { - capabilities consumer.Capabilities -} - -// Option applies changes to internalOptions. -type Option func(*baseConsumer) - -// WithCapabilities overrides the default GetCapabilities function for a processor. -// The default GetCapabilities function returns mutable capabilities. -func WithCapabilities(capabilities consumer.Capabilities) Option { - return func(o *baseConsumer) { - o.capabilities = capabilities - } -} - -// Capabilities implementation of the base Consumer. -func (bs baseConsumer) Capabilities() consumer.Capabilities { - return bs.capabilities -} - -func newBaseConsumer(options ...Option) *baseConsumer { - bs := &baseConsumer{ - capabilities: consumer.Capabilities{MutatesData: false}, - } - - for _, op := range options { - op(bs) - } +// Deprecated: [v0.47.0] use consumer.Option +type Option = consumer.Option - return bs -} +// Deprecated: [v0.47.0] use consumer.WithCapabilities +var WithCapabilities = consumer.WithCapabilities diff --git a/consumer/consumerhelper/common_test.go b/consumer/consumerhelper/common_test.go deleted file mode 100644 index 924531a9b81..00000000000 --- a/consumer/consumerhelper/common_test.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package consumerhelper - -import ( - "testing" - - "github.com/stretchr/testify/assert" - - "go.opentelemetry.io/collector/consumer" -) - -func TestDefaultOptions(t *testing.T) { - bp := newBaseConsumer() - assert.Equal(t, consumer.Capabilities{MutatesData: false}, bp.Capabilities()) -} - -func TestWithCapabilities(t *testing.T) { - bpMutate := newBaseConsumer(WithCapabilities(consumer.Capabilities{MutatesData: true})) - assert.Equal(t, consumer.Capabilities{MutatesData: true}, bpMutate.Capabilities()) - - bpNotMutate := newBaseConsumer(WithCapabilities(consumer.Capabilities{MutatesData: false})) - assert.Equal(t, consumer.Capabilities{MutatesData: false}, bpNotMutate.Capabilities()) -} diff --git a/consumer/consumerhelper/doc.go b/consumer/consumerhelper/doc.go deleted file mode 100644 index 977dc8faea5..00000000000 --- a/consumer/consumerhelper/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package consumerhelper defines types and functions used to create consumer -// Logs, Metrics, and Traces. -package consumerhelper // import "go.opentelemetry.io/collector/consumer/consumerhelper" diff --git a/consumer/consumerhelper/logs.go b/consumer/consumerhelper/logs.go index 898fa7e99cf..7ac046fe639 100644 --- a/consumer/consumerhelper/logs.go +++ b/consumer/consumerhelper/logs.go @@ -15,32 +15,11 @@ package consumerhelper // import "go.opentelemetry.io/collector/consumer/consumerhelper" import ( - "context" - "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/model/pdata" ) -// ConsumeLogsFunc is a helper function that is similar to ConsumeLogs. -type ConsumeLogsFunc func(ctx context.Context, ld pdata.Logs) error - -// ConsumeLogs calls f(ctx, ld). -func (f ConsumeLogsFunc) ConsumeLogs(ctx context.Context, ld pdata.Logs) error { - return f(ctx, ld) -} - -type baseLogs struct { - *baseConsumer - ConsumeLogsFunc -} +// Deprecated: [v0.47.0] use consumer.ConsumeLogsFunc +type ConsumeLogsFunc = consumer.ConsumeLogsFunc -// NewLogs returns a consumer.Logs configured with the provided options. -func NewLogs(consume ConsumeLogsFunc, options ...Option) (consumer.Logs, error) { - if consume == nil { - return nil, errNilFunc - } - return &baseLogs{ - baseConsumer: newBaseConsumer(options...), - ConsumeLogsFunc: consume, - }, nil -} +// Deprecated: [v0.47.0] use consumer.NewLogs +var NewLogs = consumer.NewLogs diff --git a/consumer/consumerhelper/metrics.go b/consumer/consumerhelper/metrics.go index 4bbd35607d8..61dfe5eba52 100644 --- a/consumer/consumerhelper/metrics.go +++ b/consumer/consumerhelper/metrics.go @@ -15,32 +15,11 @@ package consumerhelper // import "go.opentelemetry.io/collector/consumer/consumerhelper" import ( - "context" - "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/model/pdata" ) -// ConsumeMetricsFunc is a helper function that is similar to ConsumeMetrics. -type ConsumeMetricsFunc func(ctx context.Context, ld pdata.Metrics) error - -// ConsumeMetrics calls f(ctx, ld). -func (f ConsumeMetricsFunc) ConsumeMetrics(ctx context.Context, ld pdata.Metrics) error { - return f(ctx, ld) -} - -type baseMetrics struct { - *baseConsumer - ConsumeMetricsFunc -} +// Deprecated: [v0.47.0] use consumer.ConsumeMetricsFunc +type ConsumeMetricsFunc = consumer.ConsumeMetricsFunc -// NewMetrics returns a consumer.Metrics configured with the provided options. -func NewMetrics(consume ConsumeMetricsFunc, options ...Option) (consumer.Metrics, error) { - if consume == nil { - return nil, errNilFunc - } - return &baseMetrics{ - baseConsumer: newBaseConsumer(options...), - ConsumeMetricsFunc: consume, - }, nil -} +// Deprecated: [v0.47.0] use consumer.NewMetrics +var NewMetrics = consumer.NewMetrics diff --git a/consumer/consumerhelper/traces.go b/consumer/consumerhelper/traces.go index d71f5a5606d..b232f01433e 100644 --- a/consumer/consumerhelper/traces.go +++ b/consumer/consumerhelper/traces.go @@ -15,32 +15,11 @@ package consumerhelper // import "go.opentelemetry.io/collector/consumer/consumerhelper" import ( - "context" - "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/model/pdata" ) -// ConsumeTracesFunc is a helper function that is similar to ConsumeTraces. -type ConsumeTracesFunc func(ctx context.Context, ld pdata.Traces) error - -// ConsumeTraces calls f(ctx, ld). -func (f ConsumeTracesFunc) ConsumeTraces(ctx context.Context, ld pdata.Traces) error { - return f(ctx, ld) -} - -type baseTraces struct { - *baseConsumer - ConsumeTracesFunc -} +// Deprecated: [v0.47.0] use consumer.ConsumeTracesFunc +type ConsumeTracesFunc = consumer.ConsumeTracesFunc -// NewTraces returns a consumer.Traces configured with the provided options. -func NewTraces(consume ConsumeTracesFunc, options ...Option) (consumer.Traces, error) { - if consume == nil { - return nil, errNilFunc - } - return &baseTraces{ - baseConsumer: newBaseConsumer(options...), - ConsumeTracesFunc: consume, - }, nil -} +// Deprecated: [v0.47.0] use consumer.NewTraces +var NewTraces = consumer.NewTraces diff --git a/consumer/logs.go b/consumer/logs.go new file mode 100644 index 00000000000..2876c14978e --- /dev/null +++ b/consumer/logs.go @@ -0,0 +1,53 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package consumer // import "go.opentelemetry.io/collector/consumer" + +import ( + "context" + + "go.opentelemetry.io/collector/model/pdata" +) + +// Logs is an interface that receives pdata.Logs, processes it +// as needed, and sends it to the next processing node if any or to the destination. +type Logs interface { + baseConsumer + // ConsumeLogs receives pdata.Logs for consumption. + ConsumeLogs(ctx context.Context, ld pdata.Logs) error +} + +// ConsumeLogsFunc is a helper function that is similar to ConsumeLogs. +type ConsumeLogsFunc func(ctx context.Context, ld pdata.Logs) error + +// ConsumeLogs calls f(ctx, ld). +func (f ConsumeLogsFunc) ConsumeLogs(ctx context.Context, ld pdata.Logs) error { + return f(ctx, ld) +} + +type baseLogs struct { + *baseImpl + ConsumeLogsFunc +} + +// NewLogs returns a Logs configured with the provided options. +func NewLogs(consume ConsumeLogsFunc, options ...Option) (Logs, error) { + if consume == nil { + return nil, errNilFunc + } + return &baseLogs{ + baseImpl: newBaseImpl(options...), + ConsumeLogsFunc: consume, + }, nil +} diff --git a/consumer/consumerhelper/logs_test.go b/consumer/logs_test.go similarity index 86% rename from consumer/consumerhelper/logs_test.go rename to consumer/logs_test.go index 695a398b7ec..d3815937d96 100644 --- a/consumer/consumerhelper/logs_test.go +++ b/consumer/logs_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package consumerhelper +package consumer import ( "context" @@ -21,7 +21,6 @@ import ( "github.com/stretchr/testify/assert" - "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/model/pdata" ) @@ -29,7 +28,7 @@ func TestDefaultLogs(t *testing.T) { cp, err := NewLogs(func(context.Context, pdata.Logs) error { return nil }) assert.NoError(t, err) assert.NoError(t, cp.ConsumeLogs(context.Background(), pdata.NewLogs())) - assert.Equal(t, consumer.Capabilities{MutatesData: false}, cp.Capabilities()) + assert.Equal(t, Capabilities{MutatesData: false}, cp.Capabilities()) } func TestNilFuncLogs(t *testing.T) { @@ -40,10 +39,10 @@ func TestNilFuncLogs(t *testing.T) { func TestWithCapabilitiesLogs(t *testing.T) { cp, err := NewLogs( func(context.Context, pdata.Logs) error { return nil }, - WithCapabilities(consumer.Capabilities{MutatesData: true})) + WithCapabilities(Capabilities{MutatesData: true})) assert.NoError(t, err) assert.NoError(t, cp.ConsumeLogs(context.Background(), pdata.NewLogs())) - assert.Equal(t, consumer.Capabilities{MutatesData: true}, cp.Capabilities()) + assert.Equal(t, Capabilities{MutatesData: true}, cp.Capabilities()) } func TestConsumeLogs(t *testing.T) { diff --git a/consumer/metrics.go b/consumer/metrics.go new file mode 100644 index 00000000000..43102cee7f1 --- /dev/null +++ b/consumer/metrics.go @@ -0,0 +1,53 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package consumer // import "go.opentelemetry.io/collector/consumer" + +import ( + "context" + + "go.opentelemetry.io/collector/model/pdata" +) + +// Metrics is the new metrics consumer interface that receives pdata.Metrics, processes it +// as needed, and sends it to the next processing node if any or to the destination. +type Metrics interface { + baseConsumer + // ConsumeMetrics receives pdata.Metrics for consumption. + ConsumeMetrics(ctx context.Context, md pdata.Metrics) error +} + +// ConsumeMetricsFunc is a helper function that is similar to ConsumeMetrics. +type ConsumeMetricsFunc func(ctx context.Context, ld pdata.Metrics) error + +// ConsumeMetrics calls f(ctx, ld). +func (f ConsumeMetricsFunc) ConsumeMetrics(ctx context.Context, ld pdata.Metrics) error { + return f(ctx, ld) +} + +type baseMetrics struct { + *baseImpl + ConsumeMetricsFunc +} + +// NewMetrics returns a Metrics configured with the provided options. +func NewMetrics(consume ConsumeMetricsFunc, options ...Option) (Metrics, error) { + if consume == nil { + return nil, errNilFunc + } + return &baseMetrics{ + baseImpl: newBaseImpl(options...), + ConsumeMetricsFunc: consume, + }, nil +} diff --git a/consumer/consumerhelper/metrics_test.go b/consumer/metrics_test.go similarity index 86% rename from consumer/consumerhelper/metrics_test.go rename to consumer/metrics_test.go index c74544f7efc..f6b88568869 100644 --- a/consumer/consumerhelper/metrics_test.go +++ b/consumer/metrics_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package consumerhelper +package consumer import ( "context" @@ -21,7 +21,6 @@ import ( "github.com/stretchr/testify/assert" - "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/model/pdata" ) @@ -29,7 +28,7 @@ func TestDefaultMetrics(t *testing.T) { cp, err := NewMetrics(func(context.Context, pdata.Metrics) error { return nil }) assert.NoError(t, err) assert.NoError(t, cp.ConsumeMetrics(context.Background(), pdata.NewMetrics())) - assert.Equal(t, consumer.Capabilities{MutatesData: false}, cp.Capabilities()) + assert.Equal(t, Capabilities{MutatesData: false}, cp.Capabilities()) } func TestNilFuncMetrics(t *testing.T) { @@ -40,10 +39,10 @@ func TestNilFuncMetrics(t *testing.T) { func TestWithCapabilitiesMetrics(t *testing.T) { cp, err := NewMetrics( func(context.Context, pdata.Metrics) error { return nil }, - WithCapabilities(consumer.Capabilities{MutatesData: true})) + WithCapabilities(Capabilities{MutatesData: true})) assert.NoError(t, err) assert.NoError(t, cp.ConsumeMetrics(context.Background(), pdata.NewMetrics())) - assert.Equal(t, consumer.Capabilities{MutatesData: true}, cp.Capabilities()) + assert.Equal(t, Capabilities{MutatesData: true}, cp.Capabilities()) } func TestConsumeMetrics(t *testing.T) { diff --git a/consumer/traces.go b/consumer/traces.go new file mode 100644 index 00000000000..3852d7d253b --- /dev/null +++ b/consumer/traces.go @@ -0,0 +1,53 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package consumer // import "go.opentelemetry.io/collector/consumer" + +import ( + "context" + + "go.opentelemetry.io/collector/model/pdata" +) + +// Traces is an interface that receives pdata.Traces, processes it +// as needed, and sends it to the next processing node if any or to the destination. +type Traces interface { + baseConsumer + // ConsumeTraces receives pdata.Traces for consumption. + ConsumeTraces(ctx context.Context, td pdata.Traces) error +} + +// ConsumeTracesFunc is a helper function that is similar to ConsumeTraces. +type ConsumeTracesFunc func(ctx context.Context, ld pdata.Traces) error + +// ConsumeTraces calls f(ctx, ld). +func (f ConsumeTracesFunc) ConsumeTraces(ctx context.Context, ld pdata.Traces) error { + return f(ctx, ld) +} + +type baseTraces struct { + *baseImpl + ConsumeTracesFunc +} + +// NewTraces returns a Traces configured with the provided options. +func NewTraces(consume ConsumeTracesFunc, options ...Option) (Traces, error) { + if consume == nil { + return nil, errNilFunc + } + return &baseTraces{ + baseImpl: newBaseImpl(options...), + ConsumeTracesFunc: consume, + }, nil +} diff --git a/consumer/consumerhelper/traces_test.go b/consumer/traces_test.go similarity index 86% rename from consumer/consumerhelper/traces_test.go rename to consumer/traces_test.go index af3114b1c50..41cd269cfe0 100644 --- a/consumer/consumerhelper/traces_test.go +++ b/consumer/traces_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package consumerhelper +package consumer import ( "context" @@ -21,7 +21,6 @@ import ( "github.com/stretchr/testify/assert" - "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/model/pdata" ) @@ -29,7 +28,7 @@ func TestDefaultTraces(t *testing.T) { cp, err := NewTraces(func(context.Context, pdata.Traces) error { return nil }) assert.NoError(t, err) assert.NoError(t, cp.ConsumeTraces(context.Background(), pdata.NewTraces())) - assert.Equal(t, consumer.Capabilities{MutatesData: false}, cp.Capabilities()) + assert.Equal(t, Capabilities{MutatesData: false}, cp.Capabilities()) } func TestNilFuncTraces(t *testing.T) { @@ -40,10 +39,10 @@ func TestNilFuncTraces(t *testing.T) { func TestWithCapabilitiesTraces(t *testing.T) { cp, err := NewTraces( func(context.Context, pdata.Traces) error { return nil }, - WithCapabilities(consumer.Capabilities{MutatesData: true})) + WithCapabilities(Capabilities{MutatesData: true})) assert.NoError(t, err) assert.NoError(t, cp.ConsumeTraces(context.Background(), pdata.NewTraces())) - assert.Equal(t, consumer.Capabilities{MutatesData: true}, cp.Capabilities()) + assert.Equal(t, Capabilities{MutatesData: true}, cp.Capabilities()) } func TestConsumeTraces(t *testing.T) { diff --git a/docs/ga-roadmap.md b/docs/ga-roadmap.md index 5d2b3644125..2f204ac9f74 100644 --- a/docs/ga-roadmap.md +++ b/docs/ga-roadmap.md @@ -45,8 +45,6 @@ When that work finishes, we can add them to the Phase 3, or later. ### Phase 1 -**Tentative Date:** 2021-03-31 - **Key Results:** At the end of this phase the Collector’s core API will be marked as Stable. At the end of this phase we want to achieve core APIs stability. This will allow developers @@ -94,8 +92,6 @@ that we mark as stable. ### Phase 2 -**Tentative Date:** 2021-04-31 - **Key Results:** At the end of this phase the Collector’s end-to-end support for OTLP traces only be marked as GA. @@ -136,7 +132,6 @@ that passes them is good to be shipped. ### Phase 3 -Tentative Date: 2021-05-31 **Key Results:** At the end of this phase all Collector’s core components (receivers, processors, exporters, extensions) for traces only will be marked as GA. diff --git a/docs/release.md b/docs/release.md index 8f13c13bbd6..4ee275b677e 100644 --- a/docs/release.md +++ b/docs/release.md @@ -21,7 +21,7 @@ We release both core and contrib collectors with the same versions where the con 1. Determine the version number that will be assigned to the release. During the beta phase, we increment the minor version number and set the patch number to 0. In this document, we are using `v0.45.0` as the version to be released, following `v0.44.0`. -1. To keep track of the progress, it might be helpful to create a tracking issue similar to [#4870](https://github.com/open-telemetry/opentelemetry-collector/issues/4870). You are responsible for all of them, except the operator one. A template for the tracking issue can be found at the [Appendix A](#appendix-a), and once the issue is created, you can create the individual ones by hovering them and clicking the "Convert to issue" button on the right hand side. +1. To keep track of the progress, it might be helpful to create a [tracking issue](https://github.com/open-telemetry/opentelemetry-collector/issues/new?assignees=&labels=release&template=release.md&title=Release+vX.X.X) similar to [#4870](https://github.com/open-telemetry/opentelemetry-collector/issues/4870). You are responsible for all of them, except the operator one. Once the issue is created, you can create the individual ones by hovering them and clicking the "Convert to issue" button on the right hand side. 1. Update Contrib to use the latest in development version of Core. Run `make update-otel` in Contrib root directory and if it results in any changes, submit a PR. Open this PR as draft. This is to ensure that the latest core does not break contrib in any way. We’ll update it once more to the final release number later. @@ -95,21 +95,7 @@ The last step of the release process creates artifacts for the new version of th 1. `unknown revision internal/coreinternal/v0.45.0` -- This is typically an indication that there's a dependency on a new module. You can fix it by adding a new `replaces` entry to the `go.mod` for the affected module. -## Appendix A - -``` -Like #4522, but for v0.45.0 - -- [ ] Prepare core release v0.45.0 -- [ ] Tag and release core v0.45.0 -- [ ] Prepare contrib release v0.45.0 -- [ ] Tag and release contrib v0.45.0 -- [ ] Prepare otelcol-releases v0.45.0 -- [ ] Release binaries and container images v0.45.0 -- [ ] Release the operator v0.45.0 -``` - -## Release history and schedule +## Release schedule | Date | Version | Release manager | |------------|---------|-----------------| diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index a52e0e881d7..b4e5f746eca 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -30,17 +30,30 @@ service: ### Metrics -Prometheus metrics are exposed locally on port `8888` and path `/metrics`. +Prometheus metrics are exposed locally on port `8888` and path `/metrics`. For +containerized environments it may be desirable to expose this port on a +public interface instead of just locally. -For containerized environments it may be desirable to expose this port on a -public interface instead of just locally. The metrics address can be configured -by passing the `--metrics-addr` flag to the `otelcol` process. See `--help` for +#### Version 0.42.0 and below: + +Pass `--metrics-addr ` flag to the `otelcol` process. See `--help` for more details. ```bash $ otelcol --metrics-addr 0.0.0.0:8888 ``` +#### Version 0.43.0 and above: +Set the address in the config `service::telemetry::metrics` + +```yaml +service: + telemetry: + metrics: + address: ":8888" +``` + + A grafana dashboard for these metrics can be found [here](https://grafana.com/grafana/dashboards/11575). diff --git a/exporter/exporterhelper/common.go b/exporter/exporterhelper/common.go index 2096bc09090..c48af91c96b 100644 --- a/exporter/exporterhelper/common.go +++ b/exporter/exporterhelper/common.go @@ -21,7 +21,6 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/consumer/consumerhelper" "go.opentelemetry.io/collector/exporter/exporterhelper/internal" "go.opentelemetry.io/collector/obsreport" ) @@ -32,9 +31,6 @@ type TimeoutSettings struct { Timeout time.Duration `mapstructure:"timeout"` } -// Deprecated: [v0.46.0] use NewDefaultTimeoutSettings instead. -var DefaultTimeoutSettings = NewDefaultTimeoutSettings - // NewDefaultTimeoutSettings returns the default settings for TimeoutSettings. func NewDefaultTimeoutSettings() TimeoutSettings { return TimeoutSettings{ @@ -92,7 +88,7 @@ func (req *baseRequest) OnProcessingFinished() { type baseSettings struct { component.StartFunc component.ShutdownFunc - consumerOptions []consumerhelper.Option + consumerOptions []consumer.Option TimeoutSettings QueueSettings RetrySettings @@ -164,7 +160,7 @@ func WithQueue(queueSettings QueueSettings) Option { // TODO: Verify if we can change the default to be mutable as we do for processors. func WithCapabilities(capabilities consumer.Capabilities) Option { return func(o *baseSettings) { - o.consumerOptions = append(o.consumerOptions, consumerhelper.WithCapabilities(capabilities)) + o.consumerOptions = append(o.consumerOptions, consumer.WithCapabilities(capabilities)) } } diff --git a/exporter/exporterhelper/common_test.go b/exporter/exporterhelper/common_test.go index 3dc7ed3ae1e..42559e212a2 100644 --- a/exporter/exporterhelper/common_test.go +++ b/exporter/exporterhelper/common_test.go @@ -26,7 +26,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/config" - "go.opentelemetry.io/collector/consumer/consumerhelper" + "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/exporter/exporterhelper/internal" "go.opentelemetry.io/collector/model/pdata" ) @@ -70,7 +70,7 @@ func checkStatus(t *testing.T, sd sdktrace.ReadOnlySpan, err error) { } } -func nopTracePusher() consumerhelper.ConsumeTracesFunc { +func nopTracePusher() consumer.ConsumeTracesFunc { return func(ctx context.Context, ld pdata.Traces) error { return nil } diff --git a/exporter/exporterhelper/factory.go b/exporter/exporterhelper/factory.go deleted file mode 100644 index d5ec3a2c5a8..00000000000 --- a/exporter/exporterhelper/factory.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package exporterhelper // import "go.opentelemetry.io/collector/exporter/exporterhelper" - -import ( - "go.opentelemetry.io/collector/component" -) - -// Deprecated: [v0.46.0] use component.ExporterFactoryOption. -type FactoryOption = component.ExporterFactoryOption - -// Deprecated: [v0.46.0] use component.ExporterCreateDefaultConfigFunc. -type CreateDefaultConfig = component.ExporterCreateDefaultConfigFunc - -// Deprecated: [v0.46.0] use component.CreateTracesExporterFunc. -type CreateTracesExporter = component.CreateTracesExporterFunc - -// Deprecated: [v0.46.0] use component.CreateMetricsExporterFunc. -type CreateMetricsExporter = component.CreateMetricsExporterFunc - -// Deprecated: [v0.46.0] use component.CreateLogsExporterFunc. -type CreateLogsExporter = component.CreateLogsExporterFunc - -// Deprecated: [v0.46.0] use component.WithTracesExporter. -var WithTraces = component.WithTracesExporter - -// Deprecated: [v0.46.0] use component.WithMetricsExporter. -var WithMetrics = component.WithMetricsExporter - -// Deprecated: [v0.46.0] use component.WithLogsExporter. -var WithLogs = component.WithLogsExporter - -// Deprecated: [v0.46.0] use component.NewExporterFactory. -var NewFactory = component.NewExporterFactory diff --git a/exporter/exporterhelper/logs.go b/exporter/exporterhelper/logs.go index c89514f13bb..3837d9a901c 100644 --- a/exporter/exporterhelper/logs.go +++ b/exporter/exporterhelper/logs.go @@ -22,7 +22,6 @@ import ( "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/consumererror" - "go.opentelemetry.io/collector/consumer/consumerhelper" "go.opentelemetry.io/collector/exporter/exporterhelper/internal" "go.opentelemetry.io/collector/model/otlp" "go.opentelemetry.io/collector/model/pdata" @@ -34,10 +33,10 @@ var logsUnmarshaler = otlp.NewProtobufLogsUnmarshaler() type logsRequest struct { baseRequest ld pdata.Logs - pusher consumerhelper.ConsumeLogsFunc + pusher consumer.ConsumeLogsFunc } -func newLogsRequest(ctx context.Context, ld pdata.Logs, pusher consumerhelper.ConsumeLogsFunc) request { +func newLogsRequest(ctx context.Context, ld pdata.Logs, pusher consumer.ConsumeLogsFunc) request { return &logsRequest{ baseRequest: baseRequest{ctx: ctx}, ld: ld, @@ -45,7 +44,7 @@ func newLogsRequest(ctx context.Context, ld pdata.Logs, pusher consumerhelper.Co } } -func newLogsRequestUnmarshalerFunc(pusher consumerhelper.ConsumeLogsFunc) internal.RequestUnmarshaler { +func newLogsRequestUnmarshalerFunc(pusher consumer.ConsumeLogsFunc) internal.RequestUnmarshaler { return func(bytes []byte) (internal.PersistentRequest, error) { logs, err := logsUnmarshaler.UnmarshalLogs(bytes) if err != nil { @@ -84,7 +83,7 @@ type logsExporter struct { func NewLogsExporter( cfg config.Exporter, set component.ExporterCreateSettings, - pusher consumerhelper.ConsumeLogsFunc, + pusher consumer.ConsumeLogsFunc, options ...Option, ) (component.LogsExporter, error) { if cfg == nil { @@ -108,7 +107,7 @@ func NewLogsExporter( } }) - lc, err := consumerhelper.NewLogs(func(ctx context.Context, ld pdata.Logs) error { + lc, err := consumer.NewLogs(func(ctx context.Context, ld pdata.Logs) error { req := newLogsRequest(ctx, ld, pusher) err := be.sender.send(req) if errors.Is(err, errSendingQueueIsFull) { diff --git a/exporter/exporterhelper/logs_test.go b/exporter/exporterhelper/logs_test.go index 79a0fe940ee..3bd0dcc9b3f 100644 --- a/exporter/exporterhelper/logs_test.go +++ b/exporter/exporterhelper/logs_test.go @@ -31,7 +31,6 @@ import ( "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/consumererror" - "go.opentelemetry.io/collector/consumer/consumerhelper" "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" "go.opentelemetry.io/collector/internal/testdata" "go.opentelemetry.io/collector/model/pdata" @@ -199,7 +198,7 @@ func TestLogsExporter_WithShutdown_ReturnError(t *testing.T) { assert.Equal(t, le.Shutdown(context.Background()), want) } -func newPushLogsData(retError error) consumerhelper.ConsumeLogsFunc { +func newPushLogsData(retError error) consumer.ConsumeLogsFunc { return func(ctx context.Context, td pdata.Logs) error { return retError } diff --git a/exporter/exporterhelper/metrics.go b/exporter/exporterhelper/metrics.go index 9cc46c438db..f17eefee955 100644 --- a/exporter/exporterhelper/metrics.go +++ b/exporter/exporterhelper/metrics.go @@ -22,7 +22,6 @@ import ( "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/consumererror" - "go.opentelemetry.io/collector/consumer/consumerhelper" "go.opentelemetry.io/collector/exporter/exporterhelper/internal" "go.opentelemetry.io/collector/model/otlp" "go.opentelemetry.io/collector/model/pdata" @@ -34,10 +33,10 @@ var metricsUnmarshaler = otlp.NewProtobufMetricsUnmarshaler() type metricsRequest struct { baseRequest md pdata.Metrics - pusher consumerhelper.ConsumeMetricsFunc + pusher consumer.ConsumeMetricsFunc } -func newMetricsRequest(ctx context.Context, md pdata.Metrics, pusher consumerhelper.ConsumeMetricsFunc) request { +func newMetricsRequest(ctx context.Context, md pdata.Metrics, pusher consumer.ConsumeMetricsFunc) request { return &metricsRequest{ baseRequest: baseRequest{ctx: ctx}, md: md, @@ -45,7 +44,7 @@ func newMetricsRequest(ctx context.Context, md pdata.Metrics, pusher consumerhel } } -func newMetricsRequestUnmarshalerFunc(pusher consumerhelper.ConsumeMetricsFunc) internal.RequestUnmarshaler { +func newMetricsRequestUnmarshalerFunc(pusher consumer.ConsumeMetricsFunc) internal.RequestUnmarshaler { return func(bytes []byte) (internal.PersistentRequest, error) { metrics, err := metricsUnmarshaler.UnmarshalMetrics(bytes) if err != nil { @@ -85,7 +84,7 @@ type metricsExporter struct { func NewMetricsExporter( cfg config.Exporter, set component.ExporterCreateSettings, - pusher consumerhelper.ConsumeMetricsFunc, + pusher consumer.ConsumeMetricsFunc, options ...Option, ) (component.MetricsExporter, error) { if cfg == nil { @@ -109,7 +108,7 @@ func NewMetricsExporter( } }) - mc, err := consumerhelper.NewMetrics(func(ctx context.Context, md pdata.Metrics) error { + mc, err := consumer.NewMetrics(func(ctx context.Context, md pdata.Metrics) error { req := newMetricsRequest(ctx, md, pusher) err := be.sender.send(req) if errors.Is(err, errSendingQueueIsFull) { diff --git a/exporter/exporterhelper/metrics_test.go b/exporter/exporterhelper/metrics_test.go index 9a725a0f097..0dfc62db76a 100644 --- a/exporter/exporterhelper/metrics_test.go +++ b/exporter/exporterhelper/metrics_test.go @@ -31,7 +31,6 @@ import ( "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/consumererror" - "go.opentelemetry.io/collector/consumer/consumerhelper" "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" "go.opentelemetry.io/collector/internal/testdata" "go.opentelemetry.io/collector/model/pdata" @@ -200,7 +199,7 @@ func TestMetricsExporter_WithShutdown_ReturnError(t *testing.T) { assert.Equal(t, want, me.Shutdown(context.Background())) } -func newPushMetricsData(retError error) consumerhelper.ConsumeMetricsFunc { +func newPushMetricsData(retError error) consumer.ConsumeMetricsFunc { return func(ctx context.Context, td pdata.Metrics) error { return retError } diff --git a/exporter/exporterhelper/queued_retry.go b/exporter/exporterhelper/queued_retry.go index 3375770d568..85b64bb85b8 100644 --- a/exporter/exporterhelper/queued_retry.go +++ b/exporter/exporterhelper/queued_retry.go @@ -48,9 +48,6 @@ type RetrySettings struct { MaxElapsedTime time.Duration `mapstructure:"max_elapsed_time"` } -// Deprecated: [v0.46.0] use NewDefaultRetrySettings instead. -var DefaultRetrySettings = NewDefaultRetrySettings - // NewDefaultRetrySettings returns the default settings for RetrySettings. func NewDefaultRetrySettings() RetrySettings { return RetrySettings{ diff --git a/exporter/exporterhelper/queued_retry_experimental.go b/exporter/exporterhelper/queued_retry_experimental.go index 4c03410e6df..4153edacdad 100644 --- a/exporter/exporterhelper/queued_retry_experimental.go +++ b/exporter/exporterhelper/queued_retry_experimental.go @@ -48,9 +48,6 @@ type QueueSettings struct { PersistentStorageEnabled bool `mapstructure:"persistent_storage_enabled"` } -// Deprecated: [v0.46.0] use NewDefaultQueueSettings instead. -var DefaultQueueSettings = NewDefaultQueueSettings - // NewDefaultQueueSettings returns the default settings for QueueSettings. func NewDefaultQueueSettings() QueueSettings { return QueueSettings{ diff --git a/exporter/exporterhelper/queued_retry_inmemory.go b/exporter/exporterhelper/queued_retry_inmemory.go index 7dc3a23b83e..ca9a46d448b 100644 --- a/exporter/exporterhelper/queued_retry_inmemory.go +++ b/exporter/exporterhelper/queued_retry_inmemory.go @@ -44,9 +44,6 @@ type QueueSettings struct { QueueSize int `mapstructure:"queue_size"` } -// Deprecated: [v0.46.0] use NewDefaultQueueSettings instead. -var DefaultQueueSettings = NewDefaultQueueSettings - // NewDefaultQueueSettings returns the default settings for QueueSettings. func NewDefaultQueueSettings() QueueSettings { return QueueSettings{ diff --git a/exporter/exporterhelper/traces.go b/exporter/exporterhelper/traces.go index 5b6618496a1..1a10fb4c9c9 100644 --- a/exporter/exporterhelper/traces.go +++ b/exporter/exporterhelper/traces.go @@ -22,7 +22,6 @@ import ( "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/consumererror" - "go.opentelemetry.io/collector/consumer/consumerhelper" "go.opentelemetry.io/collector/exporter/exporterhelper/internal" "go.opentelemetry.io/collector/model/otlp" "go.opentelemetry.io/collector/model/pdata" @@ -34,10 +33,10 @@ var tracesUnmarshaler = otlp.NewProtobufTracesUnmarshaler() type tracesRequest struct { baseRequest td pdata.Traces - pusher consumerhelper.ConsumeTracesFunc + pusher consumer.ConsumeTracesFunc } -func newTracesRequest(ctx context.Context, td pdata.Traces, pusher consumerhelper.ConsumeTracesFunc) request { +func newTracesRequest(ctx context.Context, td pdata.Traces, pusher consumer.ConsumeTracesFunc) request { return &tracesRequest{ baseRequest: baseRequest{ctx: ctx}, td: td, @@ -45,7 +44,7 @@ func newTracesRequest(ctx context.Context, td pdata.Traces, pusher consumerhelpe } } -func newTraceRequestUnmarshalerFunc(pusher consumerhelper.ConsumeTracesFunc) internal.RequestUnmarshaler { +func newTraceRequestUnmarshalerFunc(pusher consumer.ConsumeTracesFunc) internal.RequestUnmarshaler { return func(bytes []byte) (internal.PersistentRequest, error) { traces, err := tracesUnmarshaler.UnmarshalTraces(bytes) if err != nil { @@ -85,7 +84,7 @@ type traceExporter struct { func NewTracesExporter( cfg config.Exporter, set component.ExporterCreateSettings, - pusher consumerhelper.ConsumeTracesFunc, + pusher consumer.ConsumeTracesFunc, options ...Option, ) (component.TracesExporter, error) { @@ -110,7 +109,7 @@ func NewTracesExporter( } }) - tc, err := consumerhelper.NewTraces(func(ctx context.Context, td pdata.Traces) error { + tc, err := consumer.NewTraces(func(ctx context.Context, td pdata.Traces) error { req := newTracesRequest(ctx, td, pusher) err := be.sender.send(req) if errors.Is(err, errSendingQueueIsFull) { diff --git a/exporter/exporterhelper/traces_test.go b/exporter/exporterhelper/traces_test.go index 93a9db81d86..f27c6026d38 100644 --- a/exporter/exporterhelper/traces_test.go +++ b/exporter/exporterhelper/traces_test.go @@ -31,7 +31,6 @@ import ( "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/consumererror" - "go.opentelemetry.io/collector/consumer/consumerhelper" "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" "go.opentelemetry.io/collector/internal/testdata" "go.opentelemetry.io/collector/model/pdata" @@ -200,7 +199,7 @@ func TestTracesExporter_WithShutdown_ReturnError(t *testing.T) { assert.Equal(t, te.Shutdown(context.Background()), want) } -func newTraceDataPusher(retError error) consumerhelper.ConsumeTracesFunc { +func newTraceDataPusher(retError error) consumer.ConsumeTracesFunc { return func(ctx context.Context, td pdata.Traces) error { return retError } diff --git a/extension/extensionhelper/factory.go b/extension/extensionhelper/factory.go deleted file mode 100644 index fbe55f3bdf4..00000000000 --- a/extension/extensionhelper/factory.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package extensionhelper // import "go.opentelemetry.io/collector/extension/extensionhelper" - -import ( - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/config" -) - -// Deprecated: [v0.46.0] not needed, will be removed soon. -type FactoryOption struct{} - -// Deprecated: [v0.46.0] use component.ExtensionDefaultConfigFunc. -type CreateDefaultConfig = component.ExtensionDefaultConfigFunc - -// Deprecated: [v0.46.0] use component.CreateExtensionFunc. -type CreateServiceExtension = component.CreateExtensionFunc - -// Deprecated: [v0.46.0] use component.NewExtensionFactory. -func NewFactory( - cfgType config.Type, - createDefaultConfig component.ExtensionDefaultConfigFunc, - createServiceExtension component.CreateExtensionFunc, - options ...FactoryOption) component.ExtensionFactory { - return component.NewExtensionFactory(cfgType, createDefaultConfig, createServiceExtension) -} diff --git a/go.mod b/go.mod index 55a62e042a0..fb2b0dadd92 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/spf13/cobra v1.4.0 github.com/stretchr/testify v1.7.0 go.opencensus.io v0.23.0 - go.opentelemetry.io/collector/model v0.46.0 + go.opentelemetry.io/collector/model v0.47.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.29.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.29.0 go.opentelemetry.io/contrib/zpages v0.29.0 diff --git a/go.sum b/go.sum index ca6cf360d7e..cad50552f87 100644 --- a/go.sum +++ b/go.sum @@ -67,6 +67,7 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB github.com/cenkalti/backoff/v4 v4.1.2 h1:6Yo7N8UP2K6LWZnW94DLVSSrbobcWdVzAYOisuDPIFo= github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= diff --git a/internal/testcomponents/example_factories.go b/internal/testcomponents/example_factories.go index c071bb158c5..0973b125167 100644 --- a/internal/testcomponents/example_factories.go +++ b/internal/testcomponents/example_factories.go @@ -46,9 +46,6 @@ func ExampleComponents() ( return } -// Deprecated: [v0.46.0] use NewDefaultFactories instead. -var DefaultFactories = NewDefaultFactories - // NewDefaultFactories returns the set of components in "testdata/otelcol-config.yaml". This is only used by tests. func NewDefaultFactories() (component.Factories, error) { var errs error diff --git a/model/internal/data/protogen/common/v1/common.pb.go b/model/internal/data/protogen/common/v1/common.pb.go index ea7556accb7..b7bf8f2830a 100644 --- a/model/internal/data/protogen/common/v1/common.pb.go +++ b/model/internal/data/protogen/common/v1/common.pb.go @@ -236,6 +236,8 @@ func (m *ArrayValue) GetValues() []AnyValue { type KeyValueList struct { // A collection of key/value pairs of key-value pairs. The list may be empty (may // contain 0 elements). + // The keys MUST be unique (it is not allowed to have more than one + // value with the same key). Values []KeyValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values"` } @@ -333,62 +335,6 @@ func (m *KeyValue) GetValue() AnyValue { return AnyValue{} } -// StringKeyValue is a pair of key/value strings. This is the simpler (and faster) version -// of KeyValue that only supports string values. -// -// Deprecated: Do not use. -type StringKeyValue struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *StringKeyValue) Reset() { *m = StringKeyValue{} } -func (m *StringKeyValue) String() string { return proto.CompactTextString(m) } -func (*StringKeyValue) ProtoMessage() {} -func (*StringKeyValue) Descriptor() ([]byte, []int) { - return fileDescriptor_62ba46dcb97aa817, []int{4} -} -func (m *StringKeyValue) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StringKeyValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StringKeyValue.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *StringKeyValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_StringKeyValue.Merge(m, src) -} -func (m *StringKeyValue) XXX_Size() int { - return m.Size() -} -func (m *StringKeyValue) XXX_DiscardUnknown() { - xxx_messageInfo_StringKeyValue.DiscardUnknown(m) -} - -var xxx_messageInfo_StringKeyValue proto.InternalMessageInfo - -func (m *StringKeyValue) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *StringKeyValue) GetValue() string { - if m != nil { - return m.Value - } - return "" -} - // InstrumentationLibrary is a message representing the instrumentation library information // such as the fully qualified name and version. type InstrumentationLibrary struct { @@ -401,7 +347,7 @@ func (m *InstrumentationLibrary) Reset() { *m = InstrumentationLibrary{} func (m *InstrumentationLibrary) String() string { return proto.CompactTextString(m) } func (*InstrumentationLibrary) ProtoMessage() {} func (*InstrumentationLibrary) Descriptor() ([]byte, []int) { - return fileDescriptor_62ba46dcb97aa817, []int{5} + return fileDescriptor_62ba46dcb97aa817, []int{4} } func (m *InstrumentationLibrary) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -449,7 +395,6 @@ func init() { proto.RegisterType((*ArrayValue)(nil), "opentelemetry.proto.common.v1.ArrayValue") proto.RegisterType((*KeyValueList)(nil), "opentelemetry.proto.common.v1.KeyValueList") proto.RegisterType((*KeyValue)(nil), "opentelemetry.proto.common.v1.KeyValue") - proto.RegisterType((*StringKeyValue)(nil), "opentelemetry.proto.common.v1.StringKeyValue") proto.RegisterType((*InstrumentationLibrary)(nil), "opentelemetry.proto.common.v1.InstrumentationLibrary") } @@ -458,38 +403,37 @@ func init() { } var fileDescriptor_62ba46dcb97aa817 = []byte{ - // 488 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0x4d, 0x6f, 0xd3, 0x40, - 0x10, 0xf5, 0x36, 0x69, 0x3e, 0xc6, 0x11, 0x42, 0xab, 0x0a, 0x45, 0x48, 0x75, 0x4d, 0x38, 0x60, - 0x40, 0x8a, 0xd5, 0x72, 0x43, 0x5c, 0x9a, 0x02, 0x0a, 0x22, 0x87, 0xc8, 0x15, 0x1c, 0xb8, 0xa0, - 0x75, 0xb3, 0xb2, 0x56, 0x5d, 0xef, 0x56, 0xeb, 0x8d, 0x25, 0xff, 0x0a, 0xf8, 0x59, 0x3d, 0xf6, - 0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 0x49, 0x78, - 0x62, 0xc3, 0xb9, 0x81, 0xe7, 0xe8, 0xc7, 0xc7, 0xe2, 0xbe, 0x80, 0x99, 0x23, 0xe5, 0x9c, 0x9e, - 0x69, 0xa9, 0xd2, 0x52, 0x2e, 0x28, 0x4f, 0x99, 0xd0, 0x54, 0x09, 0xc2, 0xd3, 0x05, 0xd1, 0xc4, - 0x1d, 0x72, 0x41, 0xc5, 0xed, 0x2d, 0xe7, 0x1d, 0x8b, 0xbd, 0xfb, 0x17, 0x00, 0x00, 0xff, 0xff, - 0x2c, 0x29, 0x86, 0xfe, 0xf3, 0x03, 0x00, 0x00, + // 470 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0xcb, 0x6e, 0x13, 0x31, + 0x14, 0x1d, 0x37, 0x69, 0x1e, 0x77, 0xb2, 0x40, 0x16, 0x42, 0x11, 0x52, 0xa7, 0x43, 0x58, 0x30, + 0x80, 0x94, 0x51, 0xcb, 0x17, 0x34, 0x05, 0x14, 0x44, 0x16, 0x91, 0x11, 0x2c, 0xd8, 0x20, 0x4f, + 0x63, 0x8d, 0xac, 0x7a, 0xec, 0xca, 0xe3, 0x8c, 0x34, 0x5f, 0x01, 0x9f, 0xd5, 0x65, 0x97, 0xac, + 0x50, 0x95, 0xfc, 0x08, 0xf2, 0x23, 0x2d, 0x74, 0xd1, 0xaa, 0xbb, 0xeb, 0x73, 0xcf, 0x39, 0xf7, + 0x78, 0xc6, 0x17, 0xde, 0xa8, 0x0b, 0x26, 0x0d, 0x13, 0xac, 0x62, 0x46, 0xb7, 0xf9, 0x85, 0x56, + 0x46, 0xe5, 0x67, 0xaa, 0xaa, 0x94, 0xcc, 0x9b, 0xa3, 0x50, 0x4d, 0x1d, 0x8c, 0x0f, 0xfe, 0xe3, + 0x7a, 0x70, 0x1a, 0x18, 0xcd, 0xd1, 0xf3, 0xa7, 0xa5, 0x2a, 0x95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0x39, 0x8c, 0x48, 0x10, 0x4f, 0xbe, 0xc2, 0xe8, 0xdf, 0x7c, 0x8f, 0xb6, 0xdd, 0x89, 0xef, 0xd8, + 0x52, 0x18, 0xec, 0x3a, 0xf8, 0x09, 0x74, 0xce, 0x59, 0xeb, 0x1f, 0x01, 0xb1, 0x25, 0x3e, 0x0d, + 0x57, 0x72, 0x7f, 0xfd, 0xd1, 0xd1, 0xc3, 0xe7, 0xf8, 0x08, 0xcf, 0x3e, 0xc9, 0xda, 0xe8, 0x75, + 0xc5, 0xa4, 0xa1, 0x86, 0x2b, 0xb9, 0xe0, 0x85, 0xa6, 0xba, 0xc5, 0x18, 0xba, 0x92, 0x56, 0xe1, + 0xd9, 0x11, 0x57, 0xe3, 0x31, 0xf4, 0x1b, 0xa6, 0x6b, 0xae, 0xa4, 0x1b, 0x3a, 0x24, 0xbb, 0xe3, + 0xec, 0x27, 0xba, 0xdc, 0x24, 0xe8, 0x6a, 0x93, 0xa0, 0xeb, 0x4d, 0x82, 0x7e, 0x6d, 0x93, 0xe8, + 0x6a, 0x9b, 0x44, 0xbf, 0xb7, 0x49, 0x04, 0x29, 0x57, 0xf7, 0x47, 0x9b, 0xc5, 0xa7, 0xae, 0x5c, + 0x5a, 0x78, 0x89, 0xbe, 0xbf, 0x2f, 0xef, 0x0a, 0xb8, 0x5d, 0x33, 0x21, 0xd8, 0x99, 0x51, 0x3a, + 0xaf, 0xd4, 0x8a, 0x89, 0x9c, 0x4b, 0xc3, 0xb4, 0xa4, 0x22, 0x5f, 0x51, 0x43, 0xfd, 0x2a, 0x96, + 0x4c, 0xde, 0x6e, 0x63, 0xd1, 0x73, 0xd8, 0xbb, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x37, 0xfb, + 0x95, 0x07, 0xb5, 0x03, 0x00, 0x00, } func (m *AnyValue) Marshal() (dAtA []byte, err error) { @@ -752,43 +696,6 @@ func (m *KeyValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *StringKeyValue) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *StringKeyValue) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StringKeyValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintCommon(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintCommon(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *InstrumentationLibrary) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -967,23 +874,6 @@ func (m *KeyValue) Size() (n int) { return n } -func (m *StringKeyValue) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovCommon(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovCommon(uint64(l)) - } - return n -} - func (m *InstrumentationLibrary) Size() (n int) { if m == nil { return 0 @@ -1527,120 +1417,6 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { } return nil } -func (m *StringKeyValue) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StringKeyValue: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StringKeyValue: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCommon - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCommon - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCommon - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCommon - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCommon(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCommon - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *InstrumentationLibrary) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/model/internal/data/protogen/logs/v1/logs.pb.go b/model/internal/data/protogen/logs/v1/logs.pb.go index e19856bd408..8cb50409508 100644 --- a/model/internal/data/protogen/logs/v1/logs.pb.go +++ b/model/internal/data/protogen/logs/v1/logs.pb.go @@ -350,6 +350,22 @@ type LogRecord struct { // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. // Value of 0 indicates unknown or missing timestamp. TimeUnixNano uint64 `protobuf:"fixed64,1,opt,name=time_unix_nano,json=timeUnixNano,proto3" json:"time_unix_nano,omitempty"` + // Time when the event was observed by the collection system. + // For events that originate in OpenTelemetry (e.g. using OpenTelemetry Logging SDK) + // this timestamp is typically set at the generation time and is equal to Timestamp. + // For events originating externally and collected by OpenTelemetry (e.g. using + // Collector) this is the time when OpenTelemetry's code observed the event measured + // by the clock of the OpenTelemetry code. This field MUST be set once the event is + // observed by OpenTelemetry. + // + // For converting OpenTelemetry log data to formats that support only one timestamp or + // when receiving OpenTelemetry log data by recipients that support only one timestamp + // internally the following logic is recommended: + // - Use time_unix_nano if it is present, otherwise use observed_time_unix_nano. + // + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + // Value of 0 indicates unknown or missing timestamp. + ObservedTimeUnixNano uint64 `protobuf:"fixed64,11,opt,name=observed_time_unix_nano,json=observedTimeUnixNano,proto3" json:"observed_time_unix_nano,omitempty"` // Numerical value of the severity, normalized to values described in Log Data Model. // [Optional]. SeverityNumber SeverityNumber `protobuf:"varint,2,opt,name=severity_number,json=severityNumber,proto3,enum=opentelemetry.proto.logs.v1.SeverityNumber" json:"severity_number,omitempty"` @@ -359,12 +375,16 @@ type LogRecord struct { // Short event identifier that does not contain varying parts. Name describes // what happened (e.g. "ProcessStarted"). Recommended to be no longer than 50 // characters. Not guaranteed to be unique in any way. [Optional]. - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + // This deprecated field is planned to be removed March 15, 2022. Receivers can + // ignore this field. + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` // Deprecated: Do not use. // A value containing the body of the log record. Can be for example a human-readable // string message (including multi-line) describing the event in a free form or it can // be a structured data composed of arrays and maps of other values. [Optional]. Body v11.AnyValue `protobuf:"bytes,5,opt,name=body,proto3" json:"body"` // Additional attributes that describe the specific event occurrence. [Optional]. + // Attribute keys MUST be unique (it is not allowed to have more than one + // attribute with the same key). Attributes []v11.KeyValue `protobuf:"bytes,6,rep,name=attributes,proto3" json:"attributes"` DroppedAttributesCount uint32 `protobuf:"varint,7,opt,name=dropped_attributes_count,json=droppedAttributesCount,proto3" json:"dropped_attributes_count,omitempty"` // Flags, a bit field. 8 least significant bits are the trace flags as @@ -425,6 +445,13 @@ func (m *LogRecord) GetTimeUnixNano() uint64 { return 0 } +func (m *LogRecord) GetObservedTimeUnixNano() uint64 { + if m != nil { + return m.ObservedTimeUnixNano + } + return 0 +} + func (m *LogRecord) GetSeverityNumber() SeverityNumber { if m != nil { return m.SeverityNumber @@ -439,6 +466,7 @@ func (m *LogRecord) GetSeverityText() string { return "" } +// Deprecated: Do not use. func (m *LogRecord) GetName() string { if m != nil { return m.Name @@ -488,64 +516,65 @@ func init() { } var fileDescriptor_d1c030a3ec7e961e = []byte{ - // 899 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x96, 0xcf, 0x6f, 0xe2, 0x46, - 0x14, 0xc7, 0x71, 0x42, 0xf8, 0x31, 0x21, 0xec, 0x74, 0x9a, 0xcd, 0xba, 0xa4, 0x25, 0x28, 0x6d, - 0xb7, 0x34, 0x95, 0x40, 0x0b, 0x54, 0xdd, 0xde, 0x6a, 0x02, 0x44, 0x28, 0x84, 0x44, 0x03, 0x6c, - 0xbb, 0xab, 0x4a, 0x96, 0xc1, 0x53, 0xd7, 0x92, 0x3d, 0x83, 0xc6, 0x43, 0x14, 0xfe, 0x84, 0xde, - 0xfa, 0x3f, 0xf5, 0xb2, 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x71, - 0xfb, 0xf4, 0x12, 0xb7, 0xf4, 0x4e, 0x4f, 0x3b, 0x5b, 0x3b, 0xc4, 0x9f, 0x83, 0xd2, 0x7a, 0x81, - 0x3c, 0x71, 0x32, 0x1c, 0xe8, 0x17, 0xda, 0xe0, 0x1c, 0xfe, 0xab, 0x34, 0x7f, 0x51, 0xde, 0xde, - 0x16, 0x95, 0x77, 0xb7, 0x45, 0xe5, 0xaf, 0xdb, 0xa2, 0xf2, 0xeb, 0x5d, 0x31, 0xf1, 0xee, 0xae, - 0x98, 0xf8, 0xfd, 0xae, 0x98, 0x00, 0x45, 0x9b, 0x6d, 0xba, 0x4d, 0x9b, 0xfe, 0xad, 0xed, 0x5d, - 0xf9, 0xa9, 0x2b, 0xe5, 0x4d, 0xf3, 0xd1, 0xff, 0xd4, 0xe0, 0x53, 0xc3, 0x22, 0x74, 0xf1, 0xd1, - 0x33, 0x4e, 0xc9, 0x4c, 0xfd, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1f, 0x24, 0x1a, 0x27, 0x1a, - 0x09, 0x00, 0x00, + // 924 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x96, 0x4f, 0x6f, 0x22, 0xb7, + 0x1b, 0xc7, 0x99, 0x84, 0xbf, 0x0e, 0x61, 0xfd, 0xf3, 0x8f, 0x25, 0x53, 0xd2, 0x12, 0x94, 0xb6, + 0x5b, 0x9a, 0x4a, 0xa0, 0x05, 0x56, 0xdd, 0xde, 0x3a, 0x04, 0x88, 0x50, 0x08, 0x89, 0x0c, 0x6c, + 0xbb, 0xab, 0x4a, 0xa3, 0x81, 0x71, 0xe9, 0x48, 0x83, 0x8d, 0x3c, 0x26, 0x0a, 0x2f, 0xa1, 0xb7, + 0x9e, 0xfa, 0x86, 0x7a, 0xd9, 0xe3, 0x1e, 0xab, 0x1e, 0x56, 0x55, 0xf2, 0x1a, 0x7a, 0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6e, 0x31, 0xed, 0x07, 0x07, 0xe4, + 0x4e, 0xa0, 0x1c, 0x88, 0x52, 0x63, 0x4a, 0xd4, 0xa8, 0xcb, 0x1a, 0x7b, 0xaa, 0x82, 0xe5, 0x1c, + 0x69, 0x20, 0x3a, 0x62, 0xe6, 0x42, 0x8d, 0xc9, 0x46, 0x7e, 0xf1, 0x48, 0x23, 0x35, 0xba, 0x78, + 0x65, 0xd8, 0x73, 0xff, 0x6e, 0xcb, 0x52, 0x74, 0x05, 0x80, 0x21, 0x04, 0xb7, 0x46, 0x73, 0x41, + 0x1c, 0x35, 0x2e, 0xfb, 0xf4, 0x98, 0xd0, 0x25, 0xd9, 0x10, 0x5a, 0x13, 0x40, 0x2f, 0x81, 0x6a, + 0x72, 0x36, 0x9b, 0x11, 0x53, 0xff, 0x2f, 0xaa, 0x8f, 0xd9, 0x9c, 0x0a, 0x35, 0x51, 0x54, 0x4a, + 0x87, 0x38, 0xb7, 0xe4, 0xda, 0x0a, 0x9f, 0xbb, 0x14, 0x65, 0x41, 0xec, 0x47, 0xdb, 0x98, 0x38, + 0x6a, 0xb2, 0xa8, 0x94, 0x12, 0xd8, 0x9b, 0xa0, 0x1f, 0x40, 0x52, 0x70, 0x63, 0x4c, 0x74, 0xcb, + 0x54, 0x53, 0x45, 0xa5, 0x94, 0x6e, 0x68, 0xee, 0x9a, 0x7f, 0xbc, 0x3f, 0xf9, 0x66, 0xc2, 0xb6, + 0x6c, 0x5a, 0xee, 0x33, 0x65, 0xdb, 0x64, 0x2c, 0x18, 0xaf, 0x4c, 0x99, 0x49, 0xec, 0x8a, 0x45, + 0x05, 0xe1, 0xd4, 0xb0, 0x2b, 0xa6, 0x21, 0x8c, 0xf2, 0xc0, 0x55, 0xea, 0x34, 0x71, 0x42, 0x4a, + 0x76, 0x4c, 0xf4, 0x1a, 0x24, 0x9c, 0x99, 0x41, 0x5d, 0x71, 0x20, 0xc5, 0xbf, 0x5d, 0x8a, 0xbf, + 0xfc, 0x70, 0x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, 0x1e, 0x64, 0x56, 0xaf, 0x6b, 0x5b, + 0xfe, 0x21, 0x4f, 0xc0, 0x71, 0xf7, 0xfa, 0x42, 0xc7, 0xad, 0xf3, 0x6b, 0xdc, 0xd4, 0xdb, 0x5d, + 0xed, 0x62, 0xeb, 0x12, 0x7f, 0x0e, 0x8a, 0xdb, 0x09, 0xf2, 0xc6, 0xc9, 0x61, 0x5f, 0xbf, 0xd2, + 0xfa, 0x97, 0xf0, 0x1f, 0xa5, 0xf1, 0xb3, 0xf2, 0xf6, 0xbe, 0xa0, 0xbc, 0xbb, 0x2f, 0x28, 0x7f, + 0xde, 0x17, 0x94, 0x5f, 0x1e, 0x0a, 0x91, 0x77, 0x0f, 0x85, 0xc8, 0xef, 0x0f, 0x85, 0x08, 0x28, + 0x58, 0x6c, 0xd7, 0x8b, 0xda, 0x70, 0x1f, 0x7c, 0xe7, 0xc6, 0x0d, 0xdd, 0x28, 0x6f, 0x1a, 0x1f, + 0xfc, 0x4f, 0xf5, 0xbe, 0x52, 0x26, 0x84, 0xfa, 0xdf, 0x4b, 0xa3, 0xb8, 0x8c, 0xd4, 0xfe, 0x0d, + 0x00, 0x00, 0xff, 0xff, 0x26, 0x40, 0x1a, 0x7b, 0x55, 0x09, 0x00, 0x00, } func (m *LogsData) Marshal() (dAtA []byte, err error) { @@ -713,6 +742,12 @@ func (m *LogRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.ObservedTimeUnixNano != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.ObservedTimeUnixNano)) + i-- + dAtA[i] = 0x59 + } { size := m.SpanId.Size() i -= size @@ -902,6 +937,9 @@ func (m *LogRecord) Size() (n int) { n += 1 + l + sovLogs(uint64(l)) l = m.SpanId.Size() n += 1 + l + sovLogs(uint64(l)) + if m.ObservedTimeUnixNano != 0 { + n += 9 + } return n } @@ -1577,6 +1615,16 @@ func (m *LogRecord) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 11: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field ObservedTimeUnixNano", wireType) + } + m.ObservedTimeUnixNano = 0 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + m.ObservedTimeUnixNano = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 default: iNdEx = preIndex skippy, err := skipLogs(dAtA[iNdEx:]) diff --git a/model/internal/data/protogen/metrics/v1/metrics.pb.go b/model/internal/data/protogen/metrics/v1/metrics.pb.go index 55d65dc32ad..b7fc8dba9e3 100644 --- a/model/internal/data/protogen/metrics/v1/metrics.pb.go +++ b/model/internal/data/protogen/metrics/v1/metrics.pb.go @@ -873,6 +873,8 @@ func (m *Summary) GetDataPoints() []*SummaryDataPoint { type NumberDataPoint struct { // The set of key/value pairs that uniquely identify the timeseries from // where this point belongs. The list may be empty (may contain 0 elements). + // Attribute keys MUST be unique (it is not allowed to have more than one + // attribute with the same key). Attributes []v11.KeyValue `protobuf:"bytes,7,rep,name=attributes,proto3" json:"attributes"` // StartTimeUnixNano is optional but strongly encouraged, see the // the detailed comments above Metric. @@ -1026,6 +1028,8 @@ func (*NumberDataPoint) XXX_OneofWrappers() []interface{} { type HistogramDataPoint struct { // The set of key/value pairs that uniquely identify the timeseries from // where this point belongs. The list may be empty (may contain 0 elements). + // Attribute keys MUST be unique (it is not allowed to have more than one + // attribute with the same key). Attributes []v11.KeyValue `protobuf:"bytes,9,rep,name=attributes,proto3" json:"attributes"` // StartTimeUnixNano is optional but strongly encouraged, see the // the detailed comments above Metric. @@ -1185,6 +1189,8 @@ func (m *HistogramDataPoint) GetFlags() uint32 { type ExponentialHistogramDataPoint struct { // The set of key/value pairs that uniquely identify the timeseries from // where this point belongs. The list may be empty (may contain 0 elements). + // Attribute keys MUST be unique (it is not allowed to have more than one + // attribute with the same key). Attributes []v11.KeyValue `protobuf:"bytes,1,rep,name=attributes,proto3" json:"attributes"` // StartTimeUnixNano is optional but strongly encouraged, see the // the detailed comments above Metric. @@ -1428,6 +1434,8 @@ func (m *ExponentialHistogramDataPoint_Buckets) GetBucketCounts() []uint64 { type SummaryDataPoint struct { // The set of key/value pairs that uniquely identify the timeseries from // where this point belongs. The list may be empty (may contain 0 elements). + // Attribute keys MUST be unique (it is not allowed to have more than one + // attribute with the same key). Attributes []v11.KeyValue `protobuf:"bytes,7,rep,name=attributes,proto3" json:"attributes"` // StartTimeUnixNano is optional but strongly encouraged, see the // the detailed comments above Metric. diff --git a/model/internal/data/protogen/resource/v1/resource.pb.go b/model/internal/data/protogen/resource/v1/resource.pb.go index 324bede3742..ab79e514c39 100644 --- a/model/internal/data/protogen/resource/v1/resource.pb.go +++ b/model/internal/data/protogen/resource/v1/resource.pb.go @@ -28,7 +28,9 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Resource information. type Resource struct { - // Set of labels that describe the resource. + // Set of attributes that describe the resource. + // Attribute keys MUST be unique (it is not allowed to have more than one + // attribute with the same key). Attributes []v1.KeyValue `protobuf:"bytes,1,rep,name=attributes,proto3" json:"attributes"` // dropped_attributes_count is the number of dropped attributes. If the value is 0, then // no attributes were dropped. diff --git a/model/internal/data/protogen/trace/v1/trace.pb.go b/model/internal/data/protogen/trace/v1/trace.pb.go index 75e8edec64c..f75d4051279 100644 --- a/model/internal/data/protogen/trace/v1/trace.pb.go +++ b/model/internal/data/protogen/trace/v1/trace.pb.go @@ -383,6 +383,8 @@ type Span struct { // // The OpenTelemetry API specification further restricts the allowed value types: // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/common.md#attributes + // Attribute keys MUST be unique (it is not allowed to have more than one + // attribute with the same key). Attributes []v11.KeyValue `protobuf:"bytes,9,rep,name=attributes,proto3" json:"attributes"` // dropped_attributes_count is the number of attributes that were discarded. Attributes // can be discarded because their keys are too long or because there are too many @@ -530,6 +532,8 @@ type Span_Event struct { // This field is semantically required to be set to non-empty string. Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // attributes is a collection of attribute key/value pairs on the event. + // Attribute keys MUST be unique (it is not allowed to have more than one + // attribute with the same key). Attributes []v11.KeyValue `protobuf:"bytes,3,rep,name=attributes,proto3" json:"attributes"` // dropped_attributes_count is the number of dropped attributes. If the value is 0, // then no attributes were dropped. @@ -610,6 +614,8 @@ type Span_Link struct { // The trace_state associated with the link. TraceState string `protobuf:"bytes,3,opt,name=trace_state,json=traceState,proto3" json:"trace_state,omitempty"` // attributes is a collection of attribute key/value pairs on the link. + // Attribute keys MUST be unique (it is not allowed to have more than one + // attribute with the same key). Attributes []v11.KeyValue `protobuf:"bytes,4,rep,name=attributes,proto3" json:"attributes"` // dropped_attributes_count is the number of dropped attributes. If the value is 0, // then no attributes were dropped. diff --git a/model/internal/pdata/common.go b/model/internal/pdata/common.go index 7c07be5308b..3d395c9371f 100644 --- a/model/internal/pdata/common.go +++ b/model/internal/pdata/common.go @@ -543,9 +543,7 @@ func (am AttributeMap) Get(key string) (AttributeValue, bool) { return AttributeValue{nil}, false } -// Delete deletes the entry associated with the key and returns true if the key -// was present in the map, otherwise returns false. -// Deprecated: [v0.46.0] Use Remove instead. +// Deprecated: [v0.47.0] Use Remove instead. func (am AttributeMap) Delete(key string) bool { return am.Remove(key) } diff --git a/processor/processorhelper/factory.go b/processor/processorhelper/factory.go deleted file mode 100644 index 6cf868ccb57..00000000000 --- a/processor/processorhelper/factory.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package processorhelper // import "go.opentelemetry.io/collector/processor/processorhelper" - -import ( - "go.opentelemetry.io/collector/component" -) - -// Deprecated: [v0.46.0] use component.ProcessorFactoryOption. -type FactoryOption = component.ProcessorFactoryOption - -// Deprecated: [v0.46.0] use component.ProcessorCreateDefaultConfigFunc. -type CreateDefaultConfig = component.ProcessorCreateDefaultConfigFunc - -// Deprecated: [v0.46.0] use component.CreateTracesProcessorFunc. -type CreateTracesProcessor = component.CreateTracesProcessorFunc - -// Deprecated: [v0.46.0] use component.CreateMetricsProcessorFunc. -type CreateMetricsProcessor = component.CreateMetricsProcessorFunc - -// Deprecated: [v0.46.0] use component.CreateLogsProcessorFunc. -type CreateLogsProcessor = component.CreateLogsProcessorFunc - -// Deprecated: [v0.46.0] use component.WithTracesProcessor. -var WithTraces = component.WithTracesProcessor - -// Deprecated: [v0.46.0] use component.WithMetricsProcessor. -var WithMetrics = component.WithMetricsProcessor - -// Deprecated: [v0.46.0] use component.WithLogsProcessor. -var WithLogs = component.WithLogsProcessor - -// Deprecated: [v0.46.0] use component.NewProcessorFactory. -var NewFactory = component.NewProcessorFactory diff --git a/processor/processorhelper/logs.go b/processor/processorhelper/logs.go index 8d049c1fc97..822a0c99a4b 100644 --- a/processor/processorhelper/logs.go +++ b/processor/processorhelper/logs.go @@ -24,7 +24,6 @@ import ( "go.opentelemetry.io/collector/component/componenterror" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/consumer/consumerhelper" "go.opentelemetry.io/collector/model/pdata" ) @@ -56,7 +55,7 @@ func NewLogsProcessor( eventOptions := spanAttributes(cfg.ID()) bs := fromOptions(options) - logsConsumer, err := consumerhelper.NewLogs(func(ctx context.Context, ld pdata.Logs) error { + logsConsumer, err := consumer.NewLogs(func(ctx context.Context, ld pdata.Logs) error { span := trace.SpanFromContext(ctx) span.AddEvent("Start processing.", eventOptions) var err error diff --git a/processor/processorhelper/metrics.go b/processor/processorhelper/metrics.go index e7c2d3eacd7..4585e51fda5 100644 --- a/processor/processorhelper/metrics.go +++ b/processor/processorhelper/metrics.go @@ -24,7 +24,6 @@ import ( "go.opentelemetry.io/collector/component/componenterror" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/consumer/consumerhelper" "go.opentelemetry.io/collector/model/pdata" ) @@ -56,7 +55,7 @@ func NewMetricsProcessor( eventOptions := spanAttributes(cfg.ID()) bs := fromOptions(options) - metricsConsumer, err := consumerhelper.NewMetrics(func(ctx context.Context, md pdata.Metrics) error { + metricsConsumer, err := consumer.NewMetrics(func(ctx context.Context, md pdata.Metrics) error { span := trace.SpanFromContext(ctx) span.AddEvent("Start processing.", eventOptions) var err error diff --git a/processor/processorhelper/processor.go b/processor/processorhelper/processor.go index ad60ef32a67..1797692bdc6 100644 --- a/processor/processorhelper/processor.go +++ b/processor/processorhelper/processor.go @@ -23,7 +23,6 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/consumer/consumerhelper" "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" ) @@ -55,21 +54,21 @@ func WithShutdown(shutdown component.ShutdownFunc) Option { // The default GetCapabilities function returns mutable capabilities. func WithCapabilities(capabilities consumer.Capabilities) Option { return func(o *baseSettings) { - o.consumerOptions = append(o.consumerOptions, consumerhelper.WithCapabilities(capabilities)) + o.consumerOptions = append(o.consumerOptions, consumer.WithCapabilities(capabilities)) } } type baseSettings struct { component.StartFunc component.ShutdownFunc - consumerOptions []consumerhelper.Option + consumerOptions []consumer.Option } // fromOptions returns the internal settings starting from the default and applying all options. func fromOptions(options []Option) *baseSettings { // Start from the default options: opts := &baseSettings{ - consumerOptions: []consumerhelper.Option{consumerhelper.WithCapabilities(consumer.Capabilities{MutatesData: true})}, + consumerOptions: []consumer.Option{consumer.WithCapabilities(consumer.Capabilities{MutatesData: true})}, } for _, op := range options { diff --git a/processor/processorhelper/traces.go b/processor/processorhelper/traces.go index e044f1af3ee..b802c539ea7 100644 --- a/processor/processorhelper/traces.go +++ b/processor/processorhelper/traces.go @@ -24,7 +24,6 @@ import ( "go.opentelemetry.io/collector/component/componenterror" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/consumer/consumerhelper" "go.opentelemetry.io/collector/model/pdata" ) @@ -56,7 +55,7 @@ func NewTracesProcessor( eventOptions := spanAttributes(cfg.ID()) bs := fromOptions(options) - traceConsumer, err := consumerhelper.NewTraces(func(ctx context.Context, td pdata.Traces) error { + traceConsumer, err := consumer.NewTraces(func(ctx context.Context, td pdata.Traces) error { span := trace.SpanFromContext(ctx) span.AddEvent("Start processing.", eventOptions) var err error diff --git a/proto_patch.sed b/proto_patch.sed index 9758580f9c8..0552ae077a8 100644 --- a/proto_patch.sed +++ b/proto_patch.sed @@ -1,4 +1,4 @@ -s+github.com/open-telemetry/opentelemetry-proto/gen/go/+go.opentelemetry.io/collector/model/internal/data/protogen/+g +s+go.opentelemetry.io/proto/otlp/+go.opentelemetry.io/collector/model/internal/data/protogen/+g s+package opentelemetry.proto.\(.*\).v1;+package opentelemetry.proto.\1.v1;\ \ diff --git a/receiver/receiverhelper/doc.go b/receiver/receiverhelper/doc.go deleted file mode 100644 index bf82d16d4d6..00000000000 --- a/receiver/receiverhelper/doc.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package receiverhelper contains utilities for receivers. -package receiverhelper // import "go.opentelemetry.io/collector/receiver/receiverhelper" diff --git a/receiver/receiverhelper/factory.go b/receiver/receiverhelper/factory.go deleted file mode 100644 index 6602c31d1e2..00000000000 --- a/receiver/receiverhelper/factory.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package receiverhelper // import "go.opentelemetry.io/collector/receiver/receiverhelper" - -import ( - "go.opentelemetry.io/collector/component" -) - -// Deprecated: [v0.46.0] use component.ReceiverFactoryOption. -type FactoryOption = component.ReceiverFactoryOption - -// Deprecated: [v0.46.0] use component.WithTracesReceiver. -var WithTraces = component.WithTracesReceiver - -// Deprecated: [v0.46.0] use component.WithMetricsReceiver. -var WithMetrics = component.WithMetricsReceiver - -// Deprecated: [v0.46.0] use component.WithLogsReceiver. -var WithLogs = component.WithLogsReceiver - -// Deprecated: [v0.46.0] use component.ReceiverCreateDefaultConfigFunc. -type CreateDefaultConfig = component.ReceiverCreateDefaultConfigFunc - -// Deprecated: [v0.46.0] use component.CreateTracesReceiverFunc. -type CreateTracesReceiver = component.CreateTracesReceiverFunc - -// Deprecated: [v0.46.0] use component.CreateMetricsReceiverFunc. -type CreateMetricsReceiver = component.CreateMetricsReceiverFunc - -// Deprecated: [v0.46.0] use component.CreateLogsReceiverFunc. -type CreateLogsReceiver = component.CreateLogsReceiverFunc - -// Deprecated: [v0.46.0] use component.NewReceiverFactory. -var NewFactory = component.NewReceiverFactory diff --git a/receiver/scraperhelper/scrapercontroller.go b/receiver/scraperhelper/scrapercontroller.go index 10aadef9c6d..8b96c379d87 100644 --- a/receiver/scraperhelper/scrapercontroller.go +++ b/receiver/scraperhelper/scrapercontroller.go @@ -39,9 +39,6 @@ type ScraperControllerSettings struct { CollectionInterval time.Duration `mapstructure:"collection_interval"` } -// Deprecated: [v0.46.0] use NewDefaultScraperControllerSettings instead. -var DefaultScraperControllerSettings = NewDefaultScraperControllerSettings - // NewDefaultScraperControllerSettings returns default scraper controller // settings with a collection interval of one minute. func NewDefaultScraperControllerSettings(cfgType config.Type) ScraperControllerSettings { diff --git a/service/config_provider.go b/service/config_provider.go index 1c9d17a65eb..42f86d0443e 100644 --- a/service/config_provider.go +++ b/service/config_provider.go @@ -106,6 +106,7 @@ func MustNewDefaultConfigProvider(configLocations []string, properties []string) map[string]configmapprovider.Provider{ "file": configmapprovider.NewFile(), "env": configmapprovider.NewEnv(), + "yaml": configmapprovider.NewYAML(), }, []config.MapConverterFunc{ configmapprovider.NewOverwritePropertiesConverter(properties), diff --git a/service/defaultcomponents/defaults.go b/service/defaultcomponents/defaults.go deleted file mode 100644 index 69f187f84be..00000000000 --- a/service/defaultcomponents/defaults.go +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package defaultcomponents composes the default set of components used by the otel service -package defaultcomponents // import "go.opentelemetry.io/collector/service/defaultcomponents" - -import ( - "go.uber.org/multierr" - - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/exporter/loggingexporter" - "go.opentelemetry.io/collector/exporter/otlpexporter" - "go.opentelemetry.io/collector/exporter/otlphttpexporter" - "go.opentelemetry.io/collector/extension/ballastextension" - "go.opentelemetry.io/collector/extension/zpagesextension" - "go.opentelemetry.io/collector/processor/batchprocessor" - "go.opentelemetry.io/collector/processor/memorylimiterprocessor" - "go.opentelemetry.io/collector/receiver/otlpreceiver" -) - -// Deprecated: [v0.45.0] Will be removed soon. -func Components() ( - component.Factories, - error, -) { - var errs error - - extensions, err := component.MakeExtensionFactoryMap( - zpagesextension.NewFactory(), - ballastextension.NewFactory(), - ) - errs = multierr.Append(errs, err) - - receivers, err := component.MakeReceiverFactoryMap( - otlpreceiver.NewFactory(), - ) - errs = multierr.Append(errs, err) - - exporters, err := component.MakeExporterFactoryMap( - loggingexporter.NewFactory(), - otlpexporter.NewFactory(), - otlphttpexporter.NewFactory(), - ) - errs = multierr.Append(errs, err) - - processors, err := component.MakeProcessorFactoryMap( - batchprocessor.NewFactory(), - memorylimiterprocessor.NewFactory(), - ) - errs = multierr.Append(errs, err) - - factories := component.Factories{ - Extensions: extensions, - Receivers: receivers, - Processors: processors, - Exporters: exporters, - } - - return factories, errs -} diff --git a/versions.yaml b/versions.yaml index 18167be44df..ee6f2c261ea 100644 --- a/versions.yaml +++ b/versions.yaml @@ -14,7 +14,7 @@ module-sets: collector-base: - version: v0.46.0 + version: v0.47.0 modules: - go.opentelemetry.io/collector - go.opentelemetry.io/collector/cmd/builder