Skip to content

Commit f03072b

Browse files
authored
Merge branch 'main' into rmdeprecatedunmarshaler
2 parents 57d8f01 + bf6dc58 commit f03072b

File tree

24 files changed

+383
-291
lines changed

24 files changed

+383
-291
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- Move `consumerdata.MetricsData` to `internaldata.MetricsData` (#2512)
99
- Remove custom OpenCensus sematic conventions that have equivalent in otel (#2552)
1010
- Remove support for deprecated unmarshaler `CustomUnmarshaler`, only `Unmarshal` is supported (#2591)
11+
- Remove deprecated componenterror.CombineErrors (#2598)
1112

1213
## v0.21.0 Beta
1314

component/componenterror/errors.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ package componenterror
1818

1919
import (
2020
"errors"
21-
22-
"go.opentelemetry.io/collector/consumer/consumererror"
2321
)
2422

2523
var (
@@ -32,9 +30,3 @@ var (
3230
// ErrNilNextConsumer indicates an error on nil next consumer.
3331
ErrNilNextConsumer = errors.New("nil nextConsumer")
3432
)
35-
36-
// CombineErrors converts a list of errors into one error.
37-
// Deprecated: use consumererror.CombineErrors instead.
38-
func CombineErrors(errs []error) error {
39-
return consumererror.CombineErrors(errs)
40-
}

component/componenttest/nop_host.go

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,26 @@ import (
1919
"go.opentelemetry.io/collector/config/configmodels"
2020
)
2121

22-
// NopHost mocks a receiver.ReceiverHost for test purposes.
23-
type NopHost struct {
24-
}
22+
// nopHost mocks a receiver.ReceiverHost for test purposes.
23+
type nopHost struct{}
2524

26-
var _ component.Host = (*NopHost)(nil)
25+
var nopHostInstance component.Host = &nopHost{}
2726

28-
// NewNopHost returns a new instance of NopHost with proper defaults for most
29-
// tests.
27+
// NewNopHost returns a new instance of nopHost with proper defaults for most tests.
3028
func NewNopHost() component.Host {
31-
return &NopHost{}
29+
return nopHostInstance
3230
}
3331

34-
// ReportFatalError is used to report to the host that the receiver encountered
35-
// a fatal error (i.e.: an error that the instance can't recover from) after
36-
// its start function has already returned.
37-
func (nh *NopHost) ReportFatalError(_ error) {
38-
// Do nothing for now.
39-
}
32+
func (nh *nopHost) ReportFatalError(_ error) {}
4033

41-
// GetFactory of the specified kind. Returns the factory for a component type.
42-
func (nh *NopHost) GetFactory(_ component.Kind, _ configmodels.Type) component.Factory {
34+
func (nh *nopHost) GetFactory(_ component.Kind, _ configmodels.Type) component.Factory {
4335
return nil
4436
}
4537

46-
func (nh *NopHost) GetExtensions() map[configmodels.Extension]component.ServiceExtension {
38+
func (nh *nopHost) GetExtensions() map[configmodels.Extension]component.ServiceExtension {
4739
return nil
4840
}
4941

50-
func (nh *NopHost) GetExporters() map[configmodels.DataType]map[configmodels.Exporter]component.Exporter {
42+
func (nh *nopHost) GetExporters() map[configmodels.DataType]map[configmodels.Exporter]component.Exporter {
5143
return nil
5244
}

component/componenttest/nop_host_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
func TestNewNopHost(t *testing.T) {
2828
nh := NewNopHost()
2929
require.NotNil(t, nh)
30-
require.IsType(t, &NopHost{}, nh)
30+
require.IsType(t, &nopHost{}, nh)
3131

3232
nh.ReportFatalError(errors.New("TestError"))
3333
assert.Nil(t, nh.GetExporters())

config/configgrpc/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ README](../configtls/README.md).
2525
- `timeout`
2626
- [`read_buffer_size`](https://godoc.org/google.golang.org/grpc#ReadBufferSize)
2727
- [`write_buffer_size`](https://godoc.org/google.golang.org/grpc#WriteBufferSize)
28+
- [`per_rpc_auth`](https://pkg.go.dev/google.golang.org/grpc#PerRPCCredentials): the credentials to send for every RPC. Note that this isn't about sending the headers only during the initial connection as an `authorization` header under the `headers` would do: this is sent for every RPC performed during an established connection.
29+
- `auth_type`: the authentication type, currently only `bearer` is supported
30+
- `bearer_token`: the bearer token to use for each RPC call.
2831

2932
Example:
3033

config/configmodels/config.go

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
// Copyright The OpenTelemetry Authors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Package configmodels defines the data models for entities. This file defines the
16+
// models for configuration format. The defined entities are:
17+
// Config (the top-level structure), Receivers, Exporters, Processors, Pipelines.
18+
//
19+
// Receivers, Exporters and Processors typically have common configuration settings, however
20+
// sometimes specific implementations will have extra configuration settings.
21+
// This requires the configuration data for these entities to be polymorphic.
22+
//
23+
// To satisfy these requirements we declare interfaces Receiver, Exporter, Processor,
24+
// which define the behavior. We also provide helper structs ReceiverSettings, ExporterSettings,
25+
// ProcessorSettings, which define the common settings and un-marshaling from config files.
26+
//
27+
// Specific Receivers/Exporters/Processors are expected to at the minimum implement the
28+
// corresponding interface and if they have additional settings they must also extend
29+
// the corresponding common settings struct (the easiest approach is to embed the common struct).
30+
package configmodels
31+
32+
// Config defines the configuration for the various elements of collector or agent.
33+
type Config struct {
34+
Receivers
35+
Exporters
36+
Processors
37+
Extensions
38+
Service
39+
}
40+
41+
// Service defines the configurable components of the service.
42+
type Service struct {
43+
// Extensions is the ordered list of extensions configured for the service.
44+
Extensions []string
45+
46+
// Pipelines is the set of data pipelines configured for the service.
47+
Pipelines Pipelines
48+
}
49+
50+
// Type is the component type as it is used in the config.
51+
type Type string
52+
53+
// NamedEntity is a configuration entity that has a type and a name.
54+
type NamedEntity interface {
55+
Type() Type
56+
Name() string
57+
SetName(name string)
58+
}
59+
60+
// DataType is the data type that is supported for collection. We currently support
61+
// collecting metrics, traces and logs, this can expand in the future.
62+
type DataType string
63+
64+
// Currently supported data types. Add new data types here when new types are supported in the future.
65+
const (
66+
// TracesDataType is the data type tag for traces.
67+
TracesDataType DataType = "traces"
68+
69+
// MetricsDataType is the data type tag for metrics.
70+
MetricsDataType DataType = "metrics"
71+
72+
// LogsDataType is the data type tag for logs.
73+
LogsDataType DataType = "logs"
74+
)
75+
76+
// Pipeline defines a single pipeline.
77+
type Pipeline struct {
78+
Name string
79+
InputType DataType
80+
Receivers []string
81+
Processors []string
82+
Exporters []string
83+
}
84+
85+
// Pipelines is a map of names to Pipelines.
86+
type Pipelines map[string]*Pipeline

0 commit comments

Comments
 (0)