forked from open-telemetry/opentelemetry-collector
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move service.[Collector|NewSvcHandler|CollectorSettings|State|NewComm…
…and] to collector package (open-telemetry#6608) * Instrument obsreport.Processor (open-telemetry#6607) * Instrument obsreport.Processor * add processor promchecker tests * add chloggen * run make genpdata and fix linter errors * address review feedback and retest * pass cfg into createOtelMetrics * Update otelcol/moved.go Co-authored-by: Alex Boten <alex@boten.ca> * Update service/collector.go Co-authored-by: Alex Boten <alex@boten.ca> Co-authored-by: Moh Osman <59479562+moh-osman3@users.noreply.github.com> Co-authored-by: Alex Boten <alex@boten.ca>
- Loading branch information
1 parent
1dff5ad
commit f8834a7
Showing
17 changed files
with
226 additions
and
13 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,22 @@ | ||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
change_type: deprecation | ||
|
||
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) | ||
component: service | ||
|
||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
note: Deprecate service.[Collector|NewSvcHandler|CollectorSettings|State|NewCommand] in favor of otelcol package" | ||
|
||
# One or more tracking issues or pull requests related to the change | ||
issues: [6608] | ||
|
||
subtext: |- | ||
- Deprecate `service.Config` in favor of `otelcol.Config`. | ||
- Deprecate `service.ConfigProvider` in favor of `otelcol.ConfigProvider`. | ||
- Deprecate `service.NewConfigProvider` in favor of `otelcol.NewConfigProvider`. | ||
- Deprecate `service.CollectorSettings` in favor of `otelcol.CollectorSettings`. | ||
- Deprecate `service.Collector` in favor of `otelcol.Collector`. | ||
- Deprecate `service.New` in favor of `otelcol.NewCollector`. | ||
- Deprecate `service.State` in favor of `otelcol.State`. | ||
- Deprecate `service.NewSvcHandler` in favor of `otelcol.NewSvcHandler`. | ||
- Deprecate `service.NewCommand` in favor of `otelcol.NewCommand`. |
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 |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
//go:build windows | ||
// +build windows | ||
|
||
package service | ||
package otelcol | ||
|
||
import ( | ||
"os" | ||
|
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
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,69 @@ | ||
// 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 otelcol handles the command-line, configuration, and runs the | ||
// OpenTelemetry Collector. | ||
package otelcol // import "go.opentelemetry.io/collector/otelcol" | ||
|
||
import ( | ||
"go.opentelemetry.io/collector/service" | ||
) | ||
|
||
// State defines Collector's state. | ||
type State = service.State //nolint:staticcheck | ||
|
||
const ( | ||
StateStarting = service.StateStarting //nolint:staticcheck | ||
StateRunning = service.StateRunning //nolint:staticcheck | ||
StateClosing = service.StateClosing //nolint:staticcheck | ||
StateClosed = service.StateClosed //nolint:staticcheck | ||
) | ||
|
||
// Collector represents a server providing the OpenTelemetry Collector service. | ||
type Collector = service.Collector //nolint:staticcheck | ||
|
||
// NewCollector creates and returns a new instance of Collector. | ||
var NewCollector = service.New //nolint:staticcheck | ||
|
||
// CollectorSettings holds configuration for creating a new Collector. | ||
type CollectorSettings = service.CollectorSettings //nolint:staticcheck | ||
|
||
// ConfigProvider provides the service configuration. | ||
// | ||
// The typical usage is the following: | ||
// | ||
// cfgProvider.Get(...) | ||
// cfgProvider.Watch() // wait for an event. | ||
// cfgProvider.Get(...) | ||
// cfgProvider.Watch() // wait for an event. | ||
// // repeat Get/Watch cycle until it is time to shut down the Collector process. | ||
// cfgProvider.Shutdown() | ||
type ConfigProvider = service.ConfigProvider //nolint:staticcheck | ||
|
||
// ConfigProviderSettings are the settings to configure the behavior of the ConfigProvider. | ||
type ConfigProviderSettings = service.ConfigProviderSettings //nolint:staticcheck | ||
|
||
// NewConfigProvider returns a new ConfigProvider that provides the service configuration: | ||
// * Initially it resolves the "configuration map": | ||
// - Retrieve the confmap.Conf by merging all retrieved maps from the given `locations` in order. | ||
// - Then applies all the confmap.Converter in the given order. | ||
// | ||
// * Then unmarshalls the confmap.Conf into the service Config. | ||
var NewConfigProvider = service.NewConfigProvider //nolint:staticcheck | ||
|
||
// NewCommand constructs a new cobra.Command using the given CollectorSettings. | ||
var NewCommand = service.NewCommand //nolint:staticcheck | ||
|
||
// Config defines the configuration for the various elements of collector or agent. | ||
type Config = service.Config //nolint:staticcheck |
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,25 @@ | ||
// 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. | ||
|
||
//go:build windows | ||
// +build windows | ||
|
||
package otelcol // import "go.opentelemetry.io/collector/otelcol" | ||
|
||
import ( | ||
"go.opentelemetry.io/collector/service" | ||
) | ||
|
||
// NewSvcHandler constructs a new svc.Handler using the given CollectorSettings. | ||
var NewSvcHandler = service.NewSvcHandler //nolint:staticcheck |
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
File renamed without changes.
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,18 @@ | ||
receivers: | ||
nop: | ||
|
||
processors: | ||
nop: | ||
|
||
exporters: | ||
nop: | ||
|
||
service: | ||
telemetry: | ||
metrics: | ||
address: localhost:8888 | ||
pipelines: | ||
traces: | ||
receivers: [nop] | ||
processors: [invalid] | ||
exporters: [nop] |
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,30 @@ | ||
receivers: | ||
nop: | ||
|
||
processors: | ||
nop: | ||
|
||
exporters: | ||
nop: | ||
|
||
extensions: | ||
nop: | ||
|
||
service: | ||
telemetry: | ||
metrics: | ||
address: localhost:8888 | ||
extensions: [nop] | ||
pipelines: | ||
traces: | ||
receivers: [nop] | ||
processors: [nop] | ||
exporters: [nop] | ||
metrics: | ||
receivers: [nop] | ||
processors: [nop] | ||
exporters: [nop] | ||
logs: | ||
receivers: [nop] | ||
processors: [nop] | ||
exporters: [nop] |
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
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
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,25 @@ | ||
// 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 servicetest // import "go.opentelemetry.io/collector/service/servicetest" | ||
|
||
import ( | ||
"go.opentelemetry.io/collector/otelcol/otelcoltest" | ||
) | ||
|
||
// Deprecated: [v0.67.0] use otelcoltest.LoadConfig | ||
var LoadConfig = otelcoltest.LoadConfig | ||
|
||
// Deprecated: [v0.67.0] use otelcoltest.LoadConfigAndValidate | ||
var LoadConfigAndValidate = otelcoltest.LoadConfigAndValidate |
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