Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
sakulali committed Sep 20, 2023
2 parents 91c0217 + 5745f37 commit 7d602b4
Show file tree
Hide file tree
Showing 54 changed files with 1,378 additions and 131 deletions.
27 changes: 27 additions & 0 deletions .chloggen/26304-azuremonitor-exporter.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: breaking

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Unexport `Accept` to comply with checkapi

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

# (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: [api]
17 changes: 17 additions & 0 deletions .chloggen/add_multiline_pattern_omit_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 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: pkg/stanza

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add 'omit_pattern' setting to `split.Config`.

# One or more tracking issues related to the change
issues: [26381]

# (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 can be used omit the start or end pattern from a log entry.
27 changes: 27 additions & 0 deletions .chloggen/add_skywalking_metric.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: skywaklingreceiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: implement receiver for JVM metrics in Skywalking and adapted it to the OpenTelemetry protocol.

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

# (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: []
27 changes: 27 additions & 0 deletions .chloggen/awsemf_dropnan.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: bug_fix

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: AWS EMF Exporter will not drop any metrics that contain NaN values to avoid JSON marshal errors.

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

# (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/bugfix_26496105-StatusMessage.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: azuredataexplorerexporter

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Added an optional column in the exported trace data to store the status code and message as a dynamic field.

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

# (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/s390x-platform-enablement.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: supported platforms

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add `linux/s390x` architecture to cross build tests in CI

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

# (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: []
27 changes: 27 additions & 0 deletions .chloggen/use-envmap-awscontainerinsightsreceiver.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: receiver/awscontainerinsightsreceiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Remove the need to set an env var in the receiver to get CPU and memory info

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

# (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: []
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ examples/demo/ @open-te

exporter/alibabacloudlogserviceexporter/ @open-telemetry/collector-contrib-approvers @shabicheng @kongluoxing @qiansheng91
exporter/awscloudwatchlogsexporter/ @open-telemetry/collector-contrib-approvers @boostchicken @bryan-aguilar @rapphil
exporter/awsemfexporter/ @open-telemetry/collector-contrib-approvers @Aneurysm9 @shaochengwang @mxiamxia
exporter/awsemfexporter/ @open-telemetry/collector-contrib-approvers @Aneurysm9 @shaochengwang @mxiamxia @bryan-aguilar
exporter/awskinesisexporter/ @open-telemetry/collector-contrib-approvers @Aneurysm9 @MovieStoreGuy
exporter/awss3exporter/ @open-telemetry/collector-contrib-approvers @atoulme @pdelewski
exporter/awsxrayexporter/ @open-telemetry/collector-contrib-approvers @wangzlei @srprash
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ jobs:
- arm
- arm64
- ppc64le
- s390x
include:
- os: linux
- arch: arm
Expand All @@ -417,12 +418,16 @@ jobs:
arch: arm
- os: darwin
arch: ppc64le
- os: darwin
arch: s390x
- os: windows
arch: arm
- os: windows
arch: arm64
- os: windows
arch: ppc64le
- os: windows
arch: s390x
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
Expand Down Expand Up @@ -485,6 +490,8 @@ jobs:
run: ./internal/buildscripts/packaging/fpm/${{ matrix.package_type }}/build.sh "${{ steps.github_tag.outputs.tag }}" "arm64" "./dist/"
- name: Build ${{ matrix.package_type }} ppc64le package
run: ./internal/buildscripts/packaging/fpm/${{ matrix.package_type }}/build.sh "${{ steps.github_tag.outputs.tag }}" "ppc64le" "./dist/"
- name: Build ${{ matrix.package_type }} s390x package
run: ./internal/buildscripts/packaging/fpm/${{ matrix.package_type }}/build.sh "${{ steps.github_tag.outputs.tag }}" "s390x" "./dist/"
- name: Test ${{ matrix.package_type }} package
run: |
if [[ "${{ matrix.package_type }}" = "deb" ]]; then
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/scripts/verify-dist-files-exist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ files=(
bin/otelcontribcol_linux_arm64
bin/otelcontribcol_linux_ppc64le
bin/otelcontribcol_linux_amd64
bin/otelcontribcol_linux_s390x
bin/otelcontribcol_windows_amd64.exe
dist/otel-contrib-collector-*.aarch64.rpm
dist/otel-contrib-collector_*_amd64.deb
dist/otel-contrib-collector-*.x86_64.rpm
dist/otel-contrib-collector_*_arm64.deb
dist/otel-contrib-collector-*.ppc64le.rpm
dist/otel-contrib-collector_*_ppc64le.deb
dist/otel-contrib-collector_*_s390x.deb
dist/otel-contrib-collector-*.s390x.rpm
# skip. See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/10113
# dist/otel-contrib-collector-*amd64.msi

Expand Down
3 changes: 0 additions & 3 deletions cmd/checkapi/allowlist.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
connector/servicegraphconnector
exporter/awskinesisexporter
exporter/azuremonitorexporter
exporter/coralogixexporter
exporter/dynatraceexporter
exporter/f5cloudexporter
exporter/kafkaexporter
exporter/kineticaexporter
exporter/loadbalancingexporter
exporter/logzioexporter
exporter/lokiexporter
exporter/pulsarexporter
exporter/sentryexporter
Expand Down
2 changes: 1 addition & 1 deletion cmd/opampsupervisor/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/knadh/koanf/providers/rawbytes v0.1.0
github.com/knadh/koanf/v2 v2.0.1
github.com/oklog/ulid/v2 v2.1.0
github.com/open-telemetry/opamp-go v0.6.0
github.com/open-telemetry/opamp-go v0.8.0
go.opentelemetry.io/collector/config/configtls v0.85.0
go.uber.org/zap v1.26.0
)
Expand Down
4 changes: 2 additions & 2 deletions cmd/opampsupervisor/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion exporter/awsemfexporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ and then sends them directly to CloudWatch Logs using the
[PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) API.

## Data Conversion
Convert OpenTelemetry ```Int64DataPoints```, ```DoubleDataPoints```, ```SummaryDataPoints``` metrics datapoints into CloudWatch ```EMF``` structured log formats and send it to CloudWatch. Logs and Metrics will be displayed in CloudWatch console.
Convert OpenTelemetry ```Int64DataPoints```, ```DoubleDataPoints```, ```SummaryDataPoints``` metrics datapoints into
CloudWatch ```EMF``` structured log formats and send it to CloudWatch. Logs and Metrics will be displayed in
CloudWatch console. NaN values are not supported by CloudWatch EMF and will be dropped by the exporter.

## Exporter Configuration

Expand Down
51 changes: 51 additions & 0 deletions exporter/awsemfexporter/datapoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ type dataPoints interface {
// retained: indicates whether the data point is valid for further process
// NOTE: It is an expensive call as it calculates the metric value.
CalculateDeltaDatapoints(i int, instrumentationScopeName string, detailedMetrics bool, calculators *emfCalculators) (dataPoint []dataPoint, retained bool)
// IsStaleOrNaN returns true if metric value has NoRecordedValue flag set or if any metric value contains a NaN.
// When return value is true, IsStaleOrNaN also returns the attributes attached to the metric which can be used for
// logging purposes.
IsStaleOrNaN(i int) (bool, pcommon.Map)
}

// deltaMetricMetadata contains the metadata required to perform rate/delta calculation
Expand Down Expand Up @@ -145,6 +149,17 @@ func (dps numberDataPointSlice) CalculateDeltaDatapoints(i int, instrumentationS
return []dataPoint{{name: dps.metricName, value: metricVal, labels: labels, timestampMs: timestampMs}}, retained
}

func (dps numberDataPointSlice) IsStaleOrNaN(i int) (bool, pcommon.Map) {
metric := dps.NumberDataPointSlice.At(i)
if metric.Flags().NoRecordedValue() {
return true, metric.Attributes()
}
if metric.ValueType() == pmetric.NumberDataPointValueTypeDouble {
return math.IsNaN(metric.DoubleValue()), metric.Attributes()
}
return false, pcommon.Map{}
}

// CalculateDeltaDatapoints retrieves the HistogramDataPoint at the given index.
func (dps histogramDataPointSlice) CalculateDeltaDatapoints(i int, instrumentationScopeName string, _ bool, _ *emfCalculators) ([]dataPoint, bool) {
metric := dps.HistogramDataPointSlice.At(i)
Expand All @@ -164,6 +179,17 @@ func (dps histogramDataPointSlice) CalculateDeltaDatapoints(i int, instrumentati
}}, true
}

func (dps histogramDataPointSlice) IsStaleOrNaN(i int) (bool, pcommon.Map) {
metric := dps.HistogramDataPointSlice.At(i)
if metric.Flags().NoRecordedValue() {
return true, metric.Attributes()
}
if math.IsNaN(metric.Max()) || math.IsNaN(metric.Sum()) || math.IsNaN(metric.Min()) {
return true, metric.Attributes()
}
return false, pcommon.Map{}
}

// CalculateDeltaDatapoints retrieves the ExponentialHistogramDataPoint at the given index.
func (dps exponentialHistogramDataPointSlice) CalculateDeltaDatapoints(idx int, instrumentationScopeName string, _ bool, _ *emfCalculators) ([]dataPoint, bool) {
metric := dps.ExponentialHistogramDataPointSlice.At(idx)
Expand Down Expand Up @@ -246,6 +272,20 @@ func (dps exponentialHistogramDataPointSlice) CalculateDeltaDatapoints(idx int,
}}, true
}

func (dps exponentialHistogramDataPointSlice) IsStaleOrNaN(i int) (bool, pcommon.Map) {
metric := dps.ExponentialHistogramDataPointSlice.At(i)
if metric.Flags().NoRecordedValue() {
return true, metric.Attributes()
}
if math.IsNaN(metric.Max()) ||
math.IsNaN(metric.Min()) ||
math.IsNaN(metric.Sum()) {
return true, metric.Attributes()
}

return false, pcommon.Map{}
}

// CalculateDeltaDatapoints retrieves the SummaryDataPoint at the given index and perform calculation with sum and count while retain the quantile value.
func (dps summaryDataPointSlice) CalculateDeltaDatapoints(i int, instrumentationScopeName string, detailedMetrics bool, calculators *emfCalculators) ([]dataPoint, bool) {
metric := dps.SummaryDataPointSlice.At(i)
Expand Down Expand Up @@ -303,6 +343,17 @@ func (dps summaryDataPointSlice) CalculateDeltaDatapoints(i int, instrumentation
return datapoints, retained
}

func (dps summaryDataPointSlice) IsStaleOrNaN(i int) (bool, pcommon.Map) {
metric := dps.SummaryDataPointSlice.At(i)
if metric.Flags().NoRecordedValue() {
return true, metric.Attributes()
}
if math.IsNaN(metric.Sum()) {
return true, metric.Attributes()
}
return false, metric.Attributes()
}

// createLabels converts OTel AttributesMap attributes to a map
// and optionally adds in the OTel instrumentation library name
func createLabels(attributes pcommon.Map, instrLibName string) map[string]string {
Expand Down
Loading

0 comments on commit 7d602b4

Please sign in to comment.