Define new component type "connector" (#6577)
This establishes the new component type without including anything specific about the design of connectors.
This commit is contained in:
parent
6917e29e63
commit
c914964600
|
@ -0,0 +1,16 @@
|
|||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
|
||||
change_type: enhancement
|
||||
|
||||
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
|
||||
component: component
|
||||
|
||||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
|
||||
note: Define new component type 'connectors'
|
||||
|
||||
# One or more tracking issues or pull requests related to the change
|
||||
issues: [6577]
|
||||
|
||||
# (Optional) One or more lines of additional information to render under the primary note.
|
||||
# These lines will be padded with 2 spaces and then inserted directly into the document.
|
||||
# Use pipe (|) for multiline entries.
|
||||
subtext:
|
|
@ -104,6 +104,7 @@ const (
|
|||
KindProcessor
|
||||
KindExporter
|
||||
KindExtension
|
||||
KindConnector
|
||||
)
|
||||
|
||||
// StabilityLevel represents the stability level of the component created by the factory.
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
// 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 config // import "go.opentelemetry.io/collector/config"
|
||||
|
||||
import (
|
||||
"go.opentelemetry.io/collector/component"
|
||||
)
|
||||
|
||||
// ConnectorSettings defines common settings for a component.Connector configuration.
|
||||
// Specific connectors can embed this struct and extend it with more fields if needed.
|
||||
//
|
||||
// It is highly recommended to "override" the Validate() function.
|
||||
//
|
||||
// When embedded in the exporter config, it must be with `mapstructure:",squash"` tag.
|
||||
type ConnectorSettings struct {
|
||||
settings
|
||||
}
|
||||
|
||||
// NewConnectorSettings return a new ConnectorSettings with the given ComponentID.
|
||||
func NewConnectorSettings(id component.ID) ConnectorSettings {
|
||||
return ConnectorSettings{settings: newSettings(id)}
|
||||
}
|
||||
|
||||
var _ component.Config = (*ConnectorSettings)(nil)
|
||||
|
||||
// ID returns the connector ComponentID.
|
||||
func (cs *ConnectorSettings) ID() component.ID {
|
||||
return cs.id
|
||||
}
|
||||
|
||||
// SetIDName sets the connector name.
|
||||
func (cs *ConnectorSettings) SetIDName(idName string) {
|
||||
cs.id = component.NewIDWithName(cs.id.Type(), idName)
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
// 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 connector // import "go.opentelemetry.io/collector/connector"
|
||||
|
||||
import (
|
||||
"go.opentelemetry.io/collector/component"
|
||||
)
|
||||
|
||||
// Connector sends telemetry data from one pipeline to another. A connector
|
||||
// is both an exporter and receiver, working together to connect pipelines.
|
||||
// The purpose is to allow for differentiated processing of telemetry data.
|
||||
//
|
||||
// Connectors can be used to replicate or route data, merge data streams,
|
||||
// derive signals from other signals, etc.
|
||||
type Connector interface {
|
||||
component.Component
|
||||
}
|
||||
|
||||
// CreateSettings configures Connector creators.
|
||||
type CreateSettings struct {
|
||||
TelemetrySettings component.TelemetrySettings
|
||||
|
||||
// BuildInfo can be used by components for informational purposes
|
||||
BuildInfo component.BuildInfo
|
||||
}
|
Loading…
Reference in New Issue