Skip to content
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
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ff93c31
azure blob exporter
eedorenko Feb 23, 2022
6de804e
Azure Blob exporter
eedorenko Feb 26, 2022
9827c8f
unit tests
eedorenko Mar 1, 2022
4129fe1
cleaning
eedorenko Mar 1, 2022
5cd9e89
change log
eedorenko Mar 1, 2022
89b62d0
dependencies
eedorenko Mar 1, 2022
56d7ecc
dependencies
eedorenko Mar 1, 2022
c776473
later to components
eedorenko Mar 1, 2022
a31fa74
linting
eedorenko Mar 1, 2022
780883b
linting
eedorenko Mar 1, 2022
cc05a2d
make 1st PR
eedorenko Mar 23, 2022
95ac3c3
updates
eedorenko Mar 24, 2022
f3e3cc7
linting
eedorenko Mar 24, 2022
70a7075
Merge branch 'main' of https://github.com/open-telemetry/opentelemetr…
eedorenko Apr 11, 2022
acfc06e
config updates
eedorenko Aug 10, 2022
74d9086
codeowners
eedorenko Aug 10, 2022
5e49fee
Merge branch 'main' of https://github.com/open-telemetry/opentelemetr…
eedorenko Aug 10, 2022
075d74a
unreleased
eedorenko Aug 10, 2022
756619e
go mod tidy
eedorenko Aug 10, 2022
f18007a
linting
eedorenko Aug 10, 2022
51bcfb2
linting
eedorenko Aug 10, 2022
ed885e9
go mod tidy
eedorenko Aug 10, 2022
4b87207
Update exporter/azureblobexporter/factory.go
eedorenko Oct 13, 2022
2d93ead
Merge branch 'main' into eedorenko/azureblobexporter-1
eedorenko Oct 13, 2022
d4038b9
changelog
eedorenko Oct 13, 2022
8cae712
dependencies
eedorenko Oct 13, 2022
175ffb2
factory
eedorenko Oct 13, 2022
7e05d1f
Update exporter/azureblobexporter/factory.go
eedorenko Dec 21, 2022
fd24984
Update exporter/azureblobexporter/factory.go
eedorenko Dec 21, 2022
665173f
Merge branch 'main' into eedorenko/azureblobexporter-1
eedorenko Dec 21, 2022
694dc84
Merge branch 'eedorenko/azureblobexporter-1' of https://github.com/ee…
eedorenko Dec 21, 2022
4889d0d
address comments
eedorenko Dec 21, 2022
0803ed5
Update exporter/azureblobexporter/config.go
eedorenko Jan 7, 2023
649b7aa
comments
eedorenko Jan 7, 2023
3c91c58
Merge branch 'main' of https://github.com/open-telemetry/opentelemetr…
eedorenko Jan 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .chloggen/add-azureblob-exporter.yaml
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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ exporter/awscloudwatchlogsexporter/ @open-telemetry/collect
exporter/awsemfexporter/ @open-telemetry/collector-contrib-approvers @Aneurysm9 @shaochengwang @mxiamxia
exporter/awskinesisexporter/ @open-telemetry/collector-contrib-approvers @Aneurysm9 @MovieStoreGuy
exporter/awsxrayexporter/ @open-telemetry/collector-contrib-approvers @willarmiros
exporter/azureblobexporter/ @open-telemetry/collector-contrib-approvers @eedorenko
exporter/azuremonitorexporter/ @open-telemetry/collector-contrib-approvers @pcwiese
exporter/azuredataexplorerexporter/ @open-telemetry/collector-contrib-approvers @asaharan @ag-ramachandran
exporter/carbonexporter/ @open-telemetry/collector-contrib-approvers @pjanotti
Expand Down
1 change: 1 addition & 0 deletions exporter/azureblobexporter/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../Makefile.Common
31 changes: 31 additions & 0 deletions exporter/azureblobexporter/README.md
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
```

36 changes: 36 additions & 0 deletions exporter/azureblobexporter/config.go
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"`
}
62 changes: 62 additions & 0 deletions exporter/azureblobexporter/factory.go
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)
}
38 changes: 38 additions & 0 deletions exporter/azureblobexporter/go.mod
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
Comment on lines +6 to +8
Copy link
Member

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.

)

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
)
Loading