Skip to content

Commit

Permalink
Merge branch 'main' into integration-test-metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrsMark authored Nov 20, 2024
2 parents a8f6328 + 909c107 commit e6b23a7
Show file tree
Hide file tree
Showing 237 changed files with 1,090 additions and 817 deletions.
27 changes: 27 additions & 0 deletions .chloggen/chan-tim_autoDiscovery.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: sumologicexporter

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: adding new products for auto discovery

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

# (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: []
26 changes: 26 additions & 0 deletions .chloggen/k8sattributeprocessor-fg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Use this changelog template to create an entry for release notes.

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

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "Move k8sattr.fieldExtractConfigRegex.disallow feature gate to Beta."

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

# (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: "Disable the `k8sattr.fieldExtractConfigRegex.disallow` feature gate to get the old behavior."
# 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: []
24 changes: 24 additions & 0 deletions .chloggen/signalfx-contract.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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. otlpreceiver)component: awsfirehosereceiver
component: signalfxreceiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Follow receiver contract based on type of error
# One or more tracking issues or pull requests related to the change
issues: [5909]

# (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: Use 503 error code for retryable and 400 error code for not-retryable errors instead of responding with a 500 unconditionally.

# 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: []
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ jobs:
merge-multiple: true
pattern: coverage-artifacts-*
- name: Upload coverage report
uses: codecov/codecov-action@5c47607acb93fed5485fdbf7232e8a31425f672a # 5.0.2
uses: codecov/codecov-action@05f5a9cfad807516dbbef9929c4a42df3eb78766 # 5.0.3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,7 @@ docker-telemetrygen:

.PHONY: generate
generate: install-tools
cd ./internal/tools && go install go.opentelemetry.io/collector/cmd/mdatagen
$(MAKE) for-all CMD="$(GOCMD) generate ./..."
PATH="$$PWD/.tools:$$PATH" $(MAKE) for-all CMD="$(GOCMD) generate ./..."
$(MAKE) gofmt

.PHONY: githubgen-install
Expand Down
4 changes: 2 additions & 2 deletions examples/couchbase/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ services:
cpus: "0.50"
memory: 1512M
opentelemetry-collector-contrib:
image: otel/opentelemetry-collector-contrib:0.113.0
image: otel/opentelemetry-collector-contrib:0.114.0
command: ["--config=/etc/otel-collector-config.yml"]
volumes:
- ./otel-collector-config.yaml:/etc/otel-collector-config.yml
depends_on:
- couchbase
prometheus:
image: prom/prometheus:v2.55.1
image: prom/prometheus:v3.0.0
volumes:
- ./prometheus-config.yaml:/etc/prometheus/prometheus.yml
ports:
Expand Down
2 changes: 1 addition & 1 deletion examples/secure-tracing/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
- ./certs/ca.crt:/etc/ca.crt
- ./envoy-config.yaml:/etc/envoy-config.yaml
otel-collector:
image: otel/opentelemetry-collector:0.113.0
image: otel/opentelemetry-collector:0.114.0
command: ["--config=/etc/otel-collector-config.yaml"]
volumes:
- ./certs/otel-collector.crt:/etc/otel-collector.crt
Expand Down
1 change: 0 additions & 1 deletion exporter/alertmanagerexporter/alertmanager_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ func (s *alertmanagerExporter) pushTraces(ctx context.Context, td ptrace.Traces)

alert := s.convertEventsToAlertPayload(events)
err := s.postAlert(ctx, alert)

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion exporter/alertmanagerexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ func TestLoadConfig(t *testing.T) {
id component.ID
expected component.Config
}{

{
id: component.NewIDWithName(metadata.Type, ""),
expected: defaultCfg,
Expand Down
1 change: 0 additions & 1 deletion exporter/alibabacloudlogserviceexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ func TestLoadConfig(t *testing.T) {
id component.ID
expected component.Config
}{

{
id: component.NewIDWithName(metadata.Type, ""),
expected: defaultCfg,
Expand Down
3 changes: 2 additions & 1 deletion exporter/alibabacloudlogserviceexporter/logs_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ type logServiceLogsSender struct {

func (s *logServiceLogsSender) pushLogsData(
_ context.Context,
md plog.Logs) error {
md plog.Logs,
) error {
var err error
slsLogs := logDataToLogService(md)
if len(slsLogs) > 0 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ func instrumentationScopeToLogContents(instrumentationScope pcommon.Instrumentat

func mapLogRecordToLogService(lr plog.LogRecord,
resourceContents,
instrumentationLibraryContents []*sls.LogContent) *sls.Log {
instrumentationLibraryContents []*sls.LogContent,
) *sls.Log {
if lr.Body().Type() == pcommon.ValueTypeEmpty {
return nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ func newMetricLogFromRaw(
name string,
labels KeyValues,
nsec int64,
value float64) *sls.Log {
value float64,
) *sls.Log {
labels.Sort()
return &sls.Log{
Time: proto.Uint32(uint32(nsec / 1e9)),
Expand Down
3 changes: 0 additions & 3 deletions exporter/awscloudwatchlogsexporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ func newCwLogsPusher(expConfig *Config, params exp.Settings) (*cwlExporter, erro
// create CWLogs client with aws session config
svcStructuredLog := cwlogs.NewClient(params.Logger, awsConfig, params.BuildInfo, expConfig.LogGroupName, expConfig.LogRetention, expConfig.Tags, session, metadata.Type.String())
collectorIdentifier, err := uuid.NewRandom()

if err != nil {
return nil, err
}
Expand Down Expand Up @@ -105,13 +104,11 @@ func (e *cwlExporter) consumeLogs(_ context.Context, ld plog.Logs) error {
var errs error

err := pushLogsToCWLogs(e.logger, ld, e.Config, pusher)

if err != nil {
errs = errors.Join(errs, fmt.Errorf("Error pushing logs: %w", err))
}

err = pusher.ForceFlush()

if err != nil {
errs = errors.Join(errs, fmt.Errorf("Error flushing logs: %w", err))
}
Expand Down
14 changes: 7 additions & 7 deletions exporter/awsemfexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ import (
"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry"
)

var (
// eMFSupportedUnits contains the unit collection supported by CloudWatch backend service.
// https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html
eMFSupportedUnits = newEMFSupportedUnits()
)
// eMFSupportedUnits contains the unit collection supported by CloudWatch backend service.
// https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html
var eMFSupportedUnits = newEMFSupportedUnits()

// Config defines configuration for AWS EMF exporter.
type Config struct {
Expand Down Expand Up @@ -152,11 +150,13 @@ func (config *Config) isAppSignalsEnabled() bool {

func newEMFSupportedUnits() map[string]any {
unitIndexer := map[string]any{}
for _, unit := range []string{"Seconds", "Microseconds", "Milliseconds", "Bytes", "Kilobytes", "Megabytes",
for _, unit := range []string{
"Seconds", "Microseconds", "Milliseconds", "Bytes", "Kilobytes", "Megabytes",
"Gigabytes", "Terabytes", "Bits", "Kilobits", "Megabits", "Gigabits", "Terabits",
"Percent", "Count", "Bytes/Second", "Kilobytes/Second", "Megabytes/Second",
"Gigabytes/Second", "Terabytes/Second", "Bits/Second", "Kilobits/Second",
"Megabits/Second", "Gigabits/Second", "Terabits/Second", "Count/Second", "None"} {
"Megabits/Second", "Gigabits/Second", "Terabits/Second", "Count/Second", "None",
} {
unitIndexer[unit] = nil
}
return unitIndexer
Expand Down
1 change: 1 addition & 0 deletions exporter/awsemfexporter/datapoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ func generateOtelTestMetrics(generatedOtelMetrics ...pmetric.Metrics) pmetric.Me
}
return finalOtelMetrics
}

func generateDeltaMetricMetadata(adjustToDelta bool, metricName string, retainInitialValueForDelta bool) deltaMetricMetadata {
return deltaMetricMetadata{
adjustToDelta: adjustToDelta,
Expand Down
1 change: 0 additions & 1 deletion exporter/awsemfexporter/emf_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ func newEmfExporter(config *Config, set exporter.Settings) (*emfExporter, error)
cwlogs.WithUserAgentExtras(userAgentExtras...),
)
collectorIdentifier, err := uuid.NewRandom()

if err != nil {
return nil, err
}
Expand Down
1 change: 0 additions & 1 deletion exporter/awsemfexporter/metric_translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ func translateCWMetricToEMF(cWMetric *cWMetrics, config *Config) (*cwlogs.Event,
func translateGroupedMetricToEmf(groupedMetric *groupedMetric, config *Config, defaultLogStream string) (*cwlogs.Event, error) {
cWMetric := translateGroupedMetricToCWMetric(groupedMetric, config)
event, err := translateCWMetricToEMF(cWMetric, config)

if err != nil {
return nil, err
}
Expand Down
Loading

0 comments on commit e6b23a7

Please sign in to comment.