-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add back deprecated stackdriverexporter which wraps googlecloudexporter
- Loading branch information
Showing
9 changed files
with
1,771 additions
and
12 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
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 @@ | ||
include ../../Makefile.Common |
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,34 @@ | ||
# Deprecated Stackdriver Exporter | ||
|
||
This exporter has been replaced by the [Google Cloud exporter](../googlecloudexporter/README.md). | ||
`stackdriver` exporter configurations will continue to work but are deprecated. Please use [Google | ||
Cloud exporter](../googlecloudexporter/README.md) instead. | ||
|
||
`stackdriver` exporter supports the same configuration options as [Google Cloud | ||
exporter](../googlecloudexporter/README.md). | ||
|
||
# Recommendations | ||
|
||
Please use the [Google Cloud exporter](../googlecloudexporter/README.md) or migrate to it by | ||
changing the exporter entry in your config from `stackdriver` to `googlecloud` and updating your | ||
pipelines to use this new key. All other configuration can rename the same. An example migration | ||
diff might look like this: | ||
|
||
```diff | ||
exporters: | ||
- stackdriver: | ||
+ googlecloud | ||
project: otel-starter-project | ||
use_insecure: false | ||
|
||
processors: | ||
batch: | ||
|
||
service: | ||
pipelines: | ||
traces: | ||
receivers: [otlp] | ||
processors: [batch] | ||
- exporters: [stackdriver] | ||
+ exporters: [googlecloud] | ||
``` |
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,31 @@ | ||
// Copyright 2019, 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 stackdriverexporter | ||
|
||
import ( | ||
"go.opentelemetry.io/collector/component" | ||
|
||
"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlecloudexporter" | ||
) | ||
|
||
const ( | ||
// The value of "type" key in configuration. | ||
typeStr = "stackdriver" | ||
) | ||
|
||
// NewFactory creates a factory for the stackdriver exporter | ||
func NewFactory() component.ExporterFactory { | ||
return googlecloudexporter.NewFactoryWithTypeStr(typeStr) | ||
} |
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,58 @@ | ||
// Copyright 2019, 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 stackdriverexporter | ||
|
||
import ( | ||
"context" | ||
"os" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"go.opentelemetry.io/collector/component" | ||
"go.opentelemetry.io/collector/config/configcheck" | ||
"go.uber.org/zap" | ||
|
||
"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlecloudexporter" | ||
) | ||
|
||
func TestCreateDefaultConfig(t *testing.T) { | ||
factory := NewFactory() | ||
cfg := factory.CreateDefaultConfig() | ||
assert.NotNil(t, cfg, "failed to create default config") | ||
assert.NoError(t, configcheck.ValidateConfig(cfg)) | ||
} | ||
|
||
func TestCreateExporter(t *testing.T) { | ||
if os.Getenv("GOOGLE_APPLICATION_CREDENTIALS") == "" { | ||
t.Skip("Default credentials not set, skip creating Stackdriver exporter") | ||
} | ||
ctx := context.Background() | ||
factory := NewFactory() | ||
cfg := factory.CreateDefaultConfig() | ||
eCfg := cfg.(*googlecloudexporter.Config) | ||
eCfg.ProjectID = "test" | ||
|
||
te, err := factory.CreateTracesExporter(ctx, component.ExporterCreateParams{ | ||
Logger: zap.NewNop(), | ||
}, eCfg) | ||
assert.Nil(t, err) | ||
assert.NotNil(t, te, "failed to create trace exporter") | ||
|
||
me, err := factory.CreateMetricsExporter(ctx, component.ExporterCreateParams{ | ||
Logger: zap.NewNop(), | ||
}, eCfg) | ||
assert.Nil(t, err) | ||
assert.NotNil(t, me, "failed to create metrics exporter") | ||
} |
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,12 @@ | ||
module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/stackdriverexporter | ||
|
||
go 1.16 | ||
|
||
require ( | ||
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlecloudexporter v0.0.0-00010101000000-000000000000 | ||
github.com/stretchr/testify v1.7.0 | ||
go.opentelemetry.io/collector v0.22.1-0.20210313012550-03904de3dd61 | ||
go.uber.org/zap v1.16.0 | ||
) | ||
|
||
replace github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlecloudexporter => ../googlecloudexporter |
Oops, something went wrong.