Skip to content

Commit

Permalink
Merge branch 'main' into es-direct-serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
felixbarny authored Jan 10, 2025
2 parents d3e8c7a + 2956bb9 commit 8679172
Show file tree
Hide file tree
Showing 66 changed files with 1,149 additions and 497 deletions.
27 changes: 27 additions & 0 deletions .chloggen/add-nanosecond-converter.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: pkg/ottl

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add the `Nanosecond` converter to return the nanosecond component from the specified time.Time

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

# (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/add-second-converter.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: pkg/ottl

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add the `Second` converter to return the second component from the specified time.Time

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

# (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/cesreceiver_alpha.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: huaweicloudces

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Move huaweicloudces receiver to alpha

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

# (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/k8sattributes-deployment-name.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: k8sattributesprocessor

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Ensure the pods gathered by the processor contain the information about their related replica sets and deployments after the initial sync

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

# (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: []
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: telemetrygen

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Remove go-grpc-middleware dependency

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

# (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: []
77 changes: 77 additions & 0 deletions .github/workflows/scoped-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: scoped-test

on:
push:
branches: [ main ]
pull_request:
types: [opened, synchronize, reopened]

jobs:
changedfiles:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
outputs:
go_sources: ${{ steps.changed-files.outputs.sources_all_changed_files }}
go_tests: ${{ steps.changed-files.outputs.tests_all_changed_files }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get changed go files
id: changed-files
uses: tj-actions/changed-files@v45
with:
files_yaml: |
sources:
- '**/*.go'
- '!**/*_test.go'
tests:
- '**/*_test.go'
scoped-tests:
strategy:
fail-fast: false
matrix:
os: [ windows-latest ]
runs-on: ${{ matrix.os }}
needs: changedfiles
steps:
- name: Echo changed files
shell: bash
run: |
echo "go_sources: ${{ needs.changedfiles.outputs.go_sources }}"
echo "go_tests: ${{ needs.changedfiles.outputs.go_tests }}"
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22.8"
cache: false

- name: Try to restore go-cache
id: go-cache
timeout-minutes: 25
uses: actions/cache/restore@v4
with:
path: |
~/go/bin
~/go/pkg/mod
./.tools
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}

- name: Build test tools
run: make "$(${PWD} -replace '\\', '/')/.tools/gotestsum"

- name: Run changed tests
if: needs.changedfiles.outputs.go_tests
env:
CHANGED_GOLANG_TESTS: ${{ needs.changedfiles.outputs.go_tests }}
run: |
make run-changed-tests
- name: Run tests on dependent components
if: needs.changedfiles.outputs.go_sources
env:
CHANGED_GOLANG_SOURCES: ${{ needs.changedfiles.outputs.go_sources }}
run: |
make for-affected-components CMD="make test"
40 changes: 40 additions & 0 deletions Makefile.Common
Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,43 @@ testifylint-fix:
gci: $(TOOLS_BIN_DIR)/gci
@echo "running $(GCI)"
@$(GCI) write -s standard -s default -s "prefix(github.com/open-telemetry/opentelemetry-collector-contrib)" $(ALL_SRC_AND_DOC)

CHANGED_GOLANG_SOURCES?=$(shell git diff main --name-only | grep -E '.*\.go$$' | grep -v -E '.*_test\.go$$')
.PHONY: for-affected-components
for-affected-components:
@echo "Checking for affected components..."
@if [ -z '$(CHANGED_GOLANG_SOURCES)' ]; then \
echo "No go source changes detected in shippable code."; \
else \
cd $(SRC_ROOT); \
DEPENDENT_PKGS=$$(echo $(CHANGED_GOLANG_SOURCES) | xargs sed -n 's|^package .* // import "\(.*\)"$$|\1|p' | uniq); \
if [ -z '$${DEPENDENT_PKGS}' ]; then \
echo "No other package depends on the one being changed."; \
else \
DEPENDENT_PKG_DIRS=$$(echo $${DEPENDENT_PKGS} | tr ' ' '\n' | xargs -I {} grep --include=go.mod -rl {} | xargs dirname | uniq); \
set -e; for dir in $$(echo $${DEPENDENT_PKG_DIRS}); do \
(cd "$${dir}" && \
echo "running $${CMD} in $${dir}" && \
$${CMD} ); \
done \
fi \
fi

CHANGED_GOLANG_TESTS?=$(shell git diff main --name-only | grep -E '.*_test\.go$$')
.PHONY: run-changed-tests
run-changed-tests:
@echo "Checking for affected tests..."
@if [ -z '$(CHANGED_GOLANG_TESTS)' ]; then \
echo "No go test changes detected."; \
else \
cd $(SRC_ROOT); \
AFFECTED_TEST_DIRS=$$(echo $(CHANGED_GOLANG_TESTS) | tr ' ' '\n' | xargs dirname | uniq); \
if [ -z '$${AFFECTED_TEST_DIRS}' ]; then \
echo "Failed to find the affected test directories."; \
else \
set -e; for dir in $$(echo $${AFFECTED_TEST_DIRS}); do \
(cd "$${dir}" && \
$(GOTESTSUM) $(GOTESTSUM_OPT) --packages="./..." -- $(GOTEST_OPT) ); \
done \
fi \
fi
1 change: 1 addition & 0 deletions cmd/otelcontribcol/builder-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ receivers:
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/haproxyreceiver v0.117.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.117.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/httpcheckreceiver v0.117.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/huaweicloudcesreceiver v0.117.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/influxdbreceiver v0.117.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/iisreceiver v0.117.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.117.0
Expand Down
2 changes: 0 additions & 2 deletions cmd/telemetrygen/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/cmd/telemetryge
go 1.22.7

require (
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
github.com/spf13/cobra v1.8.1
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.10.0
Expand Down Expand Up @@ -36,7 +35,6 @@ require (
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
Expand Down
Loading

0 comments on commit 8679172

Please sign in to comment.