-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exporter/azureblobexporter First PR #11871
Closed
eedorenko
wants to merge
35
commits into
open-telemetry:main
from
eedorenko:eedorenko/azureblobexporter-1
Closed
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
ff93c31
azure blob exporter
eedorenko 6de804e
Azure Blob exporter
eedorenko 9827c8f
unit tests
eedorenko 4129fe1
cleaning
eedorenko 5cd9e89
change log
eedorenko 89b62d0
dependencies
eedorenko 56d7ecc
dependencies
eedorenko c776473
later to components
eedorenko a31fa74
linting
eedorenko 780883b
linting
eedorenko cc05a2d
make 1st PR
eedorenko 95ac3c3
updates
eedorenko f3e3cc7
linting
eedorenko 70a7075
Merge branch 'main' of https://github.com/open-telemetry/opentelemetr…
eedorenko acfc06e
config updates
eedorenko 74d9086
codeowners
eedorenko 5e49fee
Merge branch 'main' of https://github.com/open-telemetry/opentelemetr…
eedorenko 075d74a
unreleased
eedorenko 756619e
go mod tidy
eedorenko f18007a
linting
eedorenko 51bcfb2
linting
eedorenko ed885e9
go mod tidy
eedorenko 4b87207
Update exporter/azureblobexporter/factory.go
eedorenko 2d93ead
Merge branch 'main' into eedorenko/azureblobexporter-1
eedorenko d4038b9
changelog
eedorenko 8cae712
dependencies
eedorenko 175ffb2
factory
eedorenko 7e05d1f
Update exporter/azureblobexporter/factory.go
eedorenko fd24984
Update exporter/azureblobexporter/factory.go
eedorenko 665173f
Merge branch 'main' into eedorenko/azureblobexporter-1
eedorenko 694dc84
Merge branch 'eedorenko/azureblobexporter-1' of https://github.com/ee…
eedorenko 4889d0d
address comments
eedorenko 0803ed5
Update exporter/azureblobexporter/config.go
eedorenko 649b7aa
comments
eedorenko 3c91c58
Merge branch 'main' of https://github.com/open-telemetry/opentelemetr…
eedorenko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: new_component | ||
|
||
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) | ||
component: azureblobexporter | ||
|
||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
note: Add a new component `azureblobexporter` | ||
|
||
# One or more tracking issues related to the change | ||
issues: [8823] | ||
|
||
# (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: Add a new component `azureblobexporter` that exports logs and traces to Azure Blob Storage |
Validating CODEOWNERS rules …
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,31 @@ | ||
# Azure Blob Exporter | ||
|
||
| Status | | | ||
| ------------------------ | ----------- | | ||
| Stability |[development]| | ||
| Supported pipeline types | logs,traces | | ||
| Distributions | [contrib] | | ||
|
||
This exporter saves logs and trace data to [Azure Blob Storage](https://azure.microsoft.com/services/storage/blobs/). | ||
|
||
## Configuration | ||
|
||
The following settings are required: | ||
|
||
- `connection_string` (no default): Azure Blob Storage connection key, which can be found in the Azure Blob Storage resource on the Azure Portal. | ||
|
||
The following settings can be optionally configured: | ||
|
||
- `logs:` | ||
` container_name:` (default = "logs"): Name of the container where the exporter saves blobs with logs. | ||
- `traces:` | ||
` container_name:` (default = "traces"): Name of the container where the exporter saves blobs with traces. | ||
|
||
Example: | ||
|
||
```yaml | ||
exporters: | ||
azureblob: | ||
connection_string: DefaultEndpointsProtocol=https;AccountName=accountName;AccountKey=+idLkHYcL0MUWIKYHm2j4Q==;EndpointSuffix=core.windows.net | ||
``` | ||
|
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,36 @@ | ||
// Copyright 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 azureblobexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/azureblobexporter" | ||
|
||
// Config defines configuration for Azure Monitor | ||
type config struct { | ||
// Azure Blob Storage connection key, | ||
// which can be found in the Azure Blob Storage resource on the Azure Portal. (no default) | ||
ConnectionString string `mapstructure:"connection_string"` | ||
// Logs related configurations | ||
Logs logsConfig `mapstructure:"logs"` | ||
// Traces related configurations | ||
Traces tracesConfig `mapstructure:"traces"` | ||
} | ||
|
||
type logsConfig struct { | ||
// Name of the container where the exporter saves blobs with logs. (default = "logs") | ||
ContainerName string `mapstructure:"container_name"` | ||
} | ||
|
||
type tracesConfig struct { | ||
// Name of the container where the exporter saves blobs with traces. (default = "traces") | ||
ContainerName string `mapstructure:"container_name"` | ||
} |
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,62 @@ | ||
// Copyright 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 azureblobexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/azureblobexporter" | ||
|
||
import ( | ||
"context" | ||
|
||
"go.opentelemetry.io/collector/component" | ||
"go.opentelemetry.io/collector/exporter" | ||
"go.opentelemetry.io/collector/exporter/exporterhelper" | ||
) | ||
|
||
const ( | ||
// The value of "type" key in configuration. | ||
typeStr = "azureblob" | ||
logsContainerName = "logs" | ||
tracesContainerName = "traces" | ||
) | ||
|
||
// NewFactory returns a factory for Azure Blob exporter. | ||
func NewFactory() exporter.Factory { | ||
return exporter.NewFactory( | ||
typeStr, | ||
createDefaultConfig, | ||
exporter.WithTraces(createTracesExporter, component.StabilityLevelDevelopment), | ||
exporter.WithLogs(createLogsExporter, component.StabilityLevelDevelopment)) | ||
} | ||
|
||
func createDefaultConfig() component.Config { | ||
return &config{ | ||
Logs: logsConfig{ContainerName: logsContainerName}, | ||
Traces: tracesConfig{ContainerName: tracesContainerName}, | ||
} | ||
} | ||
|
||
func createTracesExporter( | ||
ctx context.Context, | ||
set exporter.CreateSettings, | ||
cfg component.Config, | ||
) (exporter.Traces, error) { | ||
return exporterhelper.NewTracesExporter(ctx, set, cfg, onTraceData) | ||
} | ||
|
||
func createLogsExporter( | ||
ctx context.Context, | ||
set exporter.CreateSettings, | ||
cfg component.Config, | ||
) (exporter.Logs, error) { | ||
return exporterhelper.NewLogsExporter(ctx, set, cfg, onLogData) | ||
} |
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,38 @@ | ||
module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/azureblobexporter | ||
|
||
go 1.18 | ||
|
||
require ( | ||
go.opentelemetry.io/collector v0.68.0 | ||
go.opentelemetry.io/collector/component v0.68.0 | ||
go.opentelemetry.io/collector/pdata v1.0.0-rc2 | ||
) | ||
|
||
require ( | ||
github.com/cenkalti/backoff/v4 v4.2.0 // indirect | ||
github.com/gogo/protobuf v1.3.2 // indirect | ||
github.com/golang/protobuf v1.5.2 // indirect | ||
github.com/json-iterator/go v1.1.12 // indirect | ||
github.com/knadh/koanf v1.4.4 // indirect | ||
github.com/mitchellh/copystructure v1.2.0 // indirect | ||
github.com/mitchellh/mapstructure v1.5.0 // indirect | ||
github.com/mitchellh/reflectwalk v1.0.2 // indirect | ||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | ||
github.com/modern-go/reflect2 v1.0.2 // indirect | ||
go.opencensus.io v0.24.0 // indirect | ||
go.opentelemetry.io/collector/confmap v0.68.0 // indirect | ||
go.opentelemetry.io/collector/consumer v0.68.0 // indirect | ||
go.opentelemetry.io/collector/featuregate v0.68.0 // indirect | ||
go.opentelemetry.io/otel v1.11.2 // indirect | ||
go.opentelemetry.io/otel/metric v0.34.0 // indirect | ||
go.opentelemetry.io/otel/trace v1.11.2 // indirect | ||
go.uber.org/atomic v1.10.0 // indirect | ||
go.uber.org/multierr v1.9.0 // indirect | ||
go.uber.org/zap v1.24.0 // indirect | ||
golang.org/x/net v0.0.0-20220805013720-a33c5aa5df48 // indirect | ||
golang.org/x/sys v0.3.0 // indirect | ||
golang.org/x/text v0.4.0 // indirect | ||
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect | ||
google.golang.org/grpc v1.51.0 // indirect | ||
google.golang.org/protobuf v1.28.1 // indirect | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These will need to be updated to require current versions.