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/datasetexporter]: Initial implementation of logs and traces #21815

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
fd8ee6c
[exporter/datasetexporter]: Add support for sending logs
martin-majlis-s1 May 5, 2023
b40524b
Merge branch 'main' into issue-20660-datasetexporter-logs-initial-code
martin-majlis-s1 May 10, 2023
ddccebe
Fix gci issues
martin-majlis-s1 May 11, 2023
d4f666a
Fix another batch of lint errors
martin-majlis-s1 May 11, 2023
ed1da0f
Regenerate metadata
martin-majlis-s1 May 11, 2023
8b0fc15
Change nanoseconds from int to string
martin-majlis-s1 May 11, 2023
62defb9
Remove changes in go.sum files
martin-majlis-s1 May 11, 2023
83aae30
Update exporter/datasetexporter/examples/e2e/README.md
martin-majlis-s1 May 12, 2023
da0c5f4
Update exporter/datasetexporter/traces_exporter.go
martin-majlis-s1 May 12, 2023
456cd94
Incorporate suggestions from the PR
martin-majlis-s1 May 12, 2023
24e803c
Merge branch 'main' into issue-20660-datasetexporter-logs-traces-init…
martin-majlis-s1 May 12, 2023
0af59fa
Use dataset-go library version 0.0.7
martin-majlis-s1 May 12, 2023
8eb3d5b
Add Changelog entry
martin-majlis-s1 May 12, 2023
539d90b
Run `make` and fix all issues
martin-majlis-s1 May 12, 2023
c9bfc0c
Add support for making aggregation configurable
martin-majlis-s1 May 12, 2023
fa2d4c3
Update syntax in the README
martin-majlis-s1 May 12, 2023
d73e26c
Merge branch 'main' into issue-20660-datasetexporter-logs-traces-init…
martin-majlis-s1 May 15, 2023
c0b439c
Fix go.mod in otelcontribcol
martin-majlis-s1 May 15, 2023
73e9ab6
Fix go.sum in datasetexporter
martin-majlis-s1 May 15, 2023
740f7fe
Fix go.sum for otelcontribcol
martin-majlis-s1 May 15, 2023
9900a05
Fix make goporto
martin-majlis-s1 May 15, 2023
bb30197
Run make crosslink
martin-majlis-s1 May 15, 2023
ecb09ec
Run make gotidy to pass another check
martin-majlis-s1 May 15, 2023
fcb384d
Update readme for example
martin-majlis-s1 May 15, 2023
050cf54
Rename docker-compose.yml to yaml
martin-majlis-s1 May 15, 2023
06fd3ab
User lowerCased constant names
martin-majlis-s1 May 15, 2023
27940c2
Merge branch 'main' into issue-20660-datasetexporter-logs-traces-init…
martin-majlis-s1 May 17, 2023
16b34d1
Remove examples
martin-majlis-s1 May 17, 2023
f4e2dbf
Run make crosslink
martin-majlis-s1 May 17, 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
Prev Previous commit
Next Next commit
Remove examples
  • Loading branch information
martin-majlis-s1 committed May 17, 2023
commit 16b34d1331571df4db16cd550d234d453ec33815
6 changes: 4 additions & 2 deletions exporter/datasetexporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ See the [Getting Started](https://app.scalyr.com/help/getting-started) guide.

### Required Settings

- `dataset_url` (no default): The URL of the DataSet API that ingests the data. Most likely https://app.scalyr.com. If not specified env variable `DATASET_URL` is used.
- `api_key` (no default): The "Log Write" API Key required to use API. Instructions how to get [API key](https://app.scalyr.com/help/api-keys). If not specified env variable `DATASET_API_KEY` is used.
- `dataset_url` (no default): The URL of the DataSet API that ingests the data. Most likely https://app.scalyr.com.
- `api_key` (no default): The "Log Write" API Key required to use API. Instructions how to get [API key](https://app.scalyr.com/help/api-keys).

If you do not want to specify `api_key` in the file, you can use the [builtin functionality](https://opentelemetry.io/docs/collector/configuration/#configuration-environment-variables) and use `api_key: ${env:DATASET_API_KEY}`.

### Optional Settings

Expand Down
12 changes: 0 additions & 12 deletions exporter/datasetexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ package datasetexporter // import "github.com/open-telemetry/opentelemetry-colle

import (
"fmt"
"os"
"time"

"github.com/scalyr/dataset-go/pkg/buffer"
Expand Down Expand Up @@ -82,17 +81,6 @@ func (c *Config) Unmarshal(conf *confmap.Conf) error {
return fmt.Errorf("cannot unmarshal config: %w", err)
}

if len(c.DatasetURL) == 0 {
c.DatasetURL = os.Getenv("DATASET_URL")
}
if len(c.APIKey) == 0 {
c.APIKey = configopaque.String(os.Getenv("DATASET_API_KEY"))
}

if c.TracesSettings.MaxWait == 0 {
c.TracesSettings.MaxWait = tracesMaxWait
}

return nil
}

Expand Down
32 changes: 0 additions & 32 deletions exporter/datasetexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"time"

"github.com/stretchr/testify/suite"
"go.opentelemetry.io/collector/config/configopaque"
"go.opentelemetry.io/collector/confmap"
"go.opentelemetry.io/collector/exporter/exporterhelper"
)
Expand Down Expand Up @@ -54,37 +53,6 @@ func (s *SuiteConfig) TestConfigUnmarshalUnknownAttributes() {
s.Equal(expectedError.Error(), err.Error())
}

func (s *SuiteConfig) TestConfigKeepValuesWhenEnvSet() {
s.T().Setenv("DATASET_URL", "https://example.org")
s.T().Setenv("DATASET_API_KEY", "api_key")

f := NewFactory()
config := f.CreateDefaultConfig().(*Config)
configMap := confmap.NewFromStringMap(map[string]interface{}{
"dataset_url": "https://example.com",
"api_key": configopaque.String("secret"),
})
err := config.Unmarshal(configMap)
s.Nil(err)

s.Equal("https://example.com", config.DatasetURL)
s.Equal(configopaque.String("secret"), config.APIKey)
}

func (s *SuiteConfig) TestConfigUseEnvWhenSet() {
s.T().Setenv("DATASET_URL", "https://example.org")
s.T().Setenv("DATASET_API_KEY", "api_key")

f := NewFactory()
config := f.CreateDefaultConfig().(*Config)
configMap := confmap.NewFromStringMap(map[string]interface{}{})
err := config.Unmarshal(configMap)
s.Nil(err)

s.Equal("https://example.org", config.DatasetURL)
s.Equal("api_key", string(config.APIKey))
}

func (s *SuiteConfig) TestConfigUseDefaults() {
f := NewFactory()
config := f.CreateDefaultConfig().(*Config)
Expand Down
3 changes: 0 additions & 3 deletions exporter/datasetexporter/examples/e2e/.dockerignore

This file was deleted.

15 changes: 0 additions & 15 deletions exporter/datasetexporter/examples/e2e/Dockerfile

This file was deleted.

28 changes: 0 additions & 28 deletions exporter/datasetexporter/examples/e2e/README.md

This file was deleted.

46 changes: 0 additions & 46 deletions exporter/datasetexporter/examples/e2e/docker-compose.yaml

This file was deleted.

87 changes: 0 additions & 87 deletions exporter/datasetexporter/examples/e2e/otel-config.yaml

This file was deleted.

39 changes: 0 additions & 39 deletions exporter/datasetexporter/examples/e2e/otelcol-builder.yaml

This file was deleted.

Loading
Loading