Skip to content

Commit

Permalink
Merge branch 'main' into fix-broken-chrony-link
Browse files Browse the repository at this point in the history
  • Loading branch information
codeboten authored Dec 6, 2024
2 parents d043300 + 7ca07d5 commit c94607b
Show file tree
Hide file tree
Showing 51 changed files with 1,588 additions and 830 deletions.
27 changes: 27 additions & 0 deletions .chloggen/awsxrayexporter-fix-segment-gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: awsxrayexporter

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "Generate url section in xray segment when `net.peer.name` is available"

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [35375]

# (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:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user]
27 changes: 27 additions & 0 deletions .chloggen/deprecate-routing-processor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# 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. filelogreceiver)
component: routingprocessor

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Deprecated in favor of the routing connector.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [36616]

# (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:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user, api]
27 changes: 27 additions & 0 deletions .chloggen/elasticsearchexporter_merge-geo-location.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: elasticsearchexporter

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Map *.geo.location.{lat,lon} as geo_point field in OTel mode

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [36565]

# (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: In OTel mapping mode, merge *.geo.location.{lat,lon} to *.geo.location such that they are stored as geo_point in Elasticsearch.

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user]
30 changes: 30 additions & 0 deletions .chloggen/gh-trace-skeleton.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: githubreceiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Adds webhook skeleton to GitHub receiver to receive events from GitHub for tracing.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [27460]

# (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: |
This PR adds a skeleton for the GitHub receiver to receive events from GitHub
for tracing via a webhook. The trace portion of this receiver will run and
respond to GET requests for the health check only.
# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user]
29 changes: 29 additions & 0 deletions .chloggen/k8sattributes-k8s-client-init-log.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: bug_fix

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: k8sattributesreceiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Log any errors encountered during kube client initialisation

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [35879]

# (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: |
This addresses an issue where the collector, due to an error encountered during the kubernetes client initialisation,
was reporting an 'unavailable' status via the health check extension without any further information to be found in the logs.
# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: []
27 changes: 27 additions & 0 deletions .chloggen/msg_migrate-to-sdk-v2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: s3exporter

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Upgrading to adopt aws sdk v2

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [36699]

# (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:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user]
12 changes: 4 additions & 8 deletions connector/routingconnector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ connectors:
default_pipelines: [logs/other]
table:
- context: request
condition: reqeust["X-Tenant"] == "acme"
condition: request["X-Tenant"] == "acme"
pipelines: [logs/acme]
- context: request
condition: reqeust["X-Tenant"] == "ecorp"
condition: request["X-Tenant"] == "ecorp"
pipelines: [logs/ecorp]

service:
Expand Down Expand Up @@ -263,10 +263,10 @@ connectors:
condition: severity_number < SEVERITY_NUMBER_ERROR
pipelines: [logs/cheap]
- context: request
condition: reqeust["X-Tenant"] == "acme"
condition: request["X-Tenant"] == "acme"
pipelines: [logs/acme]
- context: request
condition: reqeust["X-Tenant"] == "ecorp"
condition: request["X-Tenant"] == "ecorp"
pipelines: [logs/ecorp]

service:
Expand All @@ -285,10 +285,6 @@ service:
exporters: [file/ecorp]
```
## Differences between the Routing Connector and Routing Processor
- The connector routes to pipelines, not exporters as the processor does.
[Connectors README]:https://github.com/open-telemetry/opentelemetry-collector/blob/main/connector/README.md
[OTTL]: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/pkg/ottl/README.md
Expand Down
32 changes: 22 additions & 10 deletions exporter/awss3exporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,28 @@ import (
// S3UploaderConfig contains aws s3 uploader related config to controls things
// like bucket, prefix, batching, connections, retries, etc.
type S3UploaderConfig struct {
Region string `mapstructure:"region"`
S3Bucket string `mapstructure:"s3_bucket"`
S3Prefix string `mapstructure:"s3_prefix"`
S3Partition string `mapstructure:"s3_partition"`
FilePrefix string `mapstructure:"file_prefix"`
Endpoint string `mapstructure:"endpoint"`
RoleArn string `mapstructure:"role_arn"`
S3ForcePathStyle bool `mapstructure:"s3_force_path_style"`
DisableSSL bool `mapstructure:"disable_ssl"`
Compression configcompression.Type `mapstructure:"compression"`
Region string `mapstructure:"region"`
// S3Bucket is the bucket name to be uploaded to.
S3Bucket string `mapstructure:"s3_bucket"`
// S3Prefix is the key (directory) prefix to written to inside the bucket
S3Prefix string `mapstructure:"s3_prefix"`
// S3Partition is used to provide the rollup on how data is written.
// Valid values are: [hour,minute]
S3Partition string `mapstructure:"s3_partition"`
// FilePrefix is the filename prefix used for the file to avoid any potential collisions.
FilePrefix string `mapstructure:"file_prefix"`
// Endpoint is the URL used for communicated with S3.
Endpoint string `mapstructure:"endpoint"`
// RoleArn is the role policy to use when interacting with S3
RoleArn string `mapstructure:"role_arn"`
// S3ForcePathStyle sets the value for force path style.
S3ForcePathStyle bool `mapstructure:"s3_force_path_style"`
// DisableSLL forces communication to happen via HTTP instead of HTTPS.
DisableSSL bool `mapstructure:"disable_ssl"`
// Compression sets the algorithm used to process the payload
// before uploading to S3.
// Valid values are: `gzip` or no value set.
Compression configcompression.Type `mapstructure:"compression"`
}

type MarshalerType string
Expand Down
10 changes: 0 additions & 10 deletions exporter/awss3exporter/data_writer.go

This file was deleted.

25 changes: 18 additions & 7 deletions exporter/awss3exporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,32 @@ import (
"go.opentelemetry.io/collector/pdata/pmetric"
"go.opentelemetry.io/collector/pdata/ptrace"
"go.uber.org/zap"

"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awss3exporter/internal/upload"
)

type s3Exporter struct {
config *Config
dataWriter dataWriter
signalType string
uploader upload.Manager
logger *zap.Logger
marshaler marshaler
}

func newS3Exporter(config *Config,
func newS3Exporter(
config *Config,
signalType string,
params exporter.Settings,
) *s3Exporter {
s3Exporter := &s3Exporter{
config: config,
dataWriter: &s3Writer{},
signalType: signalType,
logger: params.Logger,
}
return s3Exporter
}

func (e *s3Exporter) start(_ context.Context, host component.Host) error {
func (e *s3Exporter) start(ctx context.Context, host component.Host) error {
var m marshaler
var err error
if e.config.Encoding != nil {
Expand All @@ -48,6 +53,12 @@ func (e *s3Exporter) start(_ context.Context, host component.Host) error {
}

e.marshaler = m

up, err := newUploadManager(ctx, e.config, e.signalType, m.format())
if err != nil {
return err
}
e.uploader = up
return nil
}

Expand All @@ -61,7 +72,7 @@ func (e *s3Exporter) ConsumeMetrics(ctx context.Context, md pmetric.Metrics) err
return err
}

return e.dataWriter.writeBuffer(ctx, buf, e.config, "metrics", e.marshaler.format())
return e.uploader.Upload(ctx, buf)
}

func (e *s3Exporter) ConsumeLogs(ctx context.Context, logs plog.Logs) error {
Expand All @@ -70,7 +81,7 @@ func (e *s3Exporter) ConsumeLogs(ctx context.Context, logs plog.Logs) error {
return err
}

return e.dataWriter.writeBuffer(ctx, buf, e.config, "logs", e.marshaler.format())
return e.uploader.Upload(ctx, buf)
}

func (e *s3Exporter) ConsumeTraces(ctx context.Context, traces ptrace.Traces) error {
Expand All @@ -79,5 +90,5 @@ func (e *s3Exporter) ConsumeTraces(ctx context.Context, traces ptrace.Traces) er
return err
}

return e.dataWriter.writeBuffer(ctx, buf, e.config, "traces", e.marshaler.format())
return e.uploader.Upload(ctx, buf)
}
10 changes: 5 additions & 5 deletions exporter/awss3exporter/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type TestWriter struct {
t *testing.T
}

func (testWriter *TestWriter) writeBuffer(_ context.Context, buf []byte, _ *Config, _ string, _ string) error {
func (testWriter *TestWriter) Upload(_ context.Context, buf []byte) error {
assert.Equal(testWriter.t, testLogs, buf)
return nil
}
Expand All @@ -33,10 +33,10 @@ func getTestLogs(tb testing.TB) plog.Logs {
func getLogExporter(t *testing.T) *s3Exporter {
marshaler, _ := newMarshaler("otlp_json", zap.NewNop())
exporter := &s3Exporter{
config: createDefaultConfig().(*Config),
dataWriter: &TestWriter{t},
logger: zap.NewNop(),
marshaler: marshaler,
config: createDefaultConfig().(*Config),
uploader: &TestWriter{t},
logger: zap.NewNop(),
marshaler: marshaler,
}
return exporter
}
Expand Down
6 changes: 3 additions & 3 deletions exporter/awss3exporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func createLogsExporter(ctx context.Context,
params exporter.Settings,
config component.Config,
) (exporter.Logs, error) {
s3Exporter := newS3Exporter(config.(*Config), params)
s3Exporter := newS3Exporter(config.(*Config), "logs", params)

return exporterhelper.NewLogs(ctx, params,
config,
Expand All @@ -51,7 +51,7 @@ func createMetricsExporter(ctx context.Context,
params exporter.Settings,
config component.Config,
) (exporter.Metrics, error) {
s3Exporter := newS3Exporter(config.(*Config), params)
s3Exporter := newS3Exporter(config.(*Config), "metrics", params)

if config.(*Config).MarshalerName == SumoIC {
return nil, fmt.Errorf("metrics are not supported by sumo_ic output format")
Expand All @@ -67,7 +67,7 @@ func createTracesExporter(ctx context.Context,
params exporter.Settings,
config component.Config,
) (exporter.Traces, error) {
s3Exporter := newS3Exporter(config.(*Config), params)
s3Exporter := newS3Exporter(config.(*Config), "traces", params)

if config.(*Config).MarshalerName == SumoIC {
return nil, fmt.Errorf("traces are not supported by sumo_ic output format")
Expand Down
Loading

0 comments on commit c94607b

Please sign in to comment.