-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define new component type "connector"
This establishes the new component type without including anything specific about the design of connectors.
- Loading branch information
1 parent
5376db4
commit e3e50d3
Showing
4 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |