Skip to content

Commit

Permalink
Merge branch 'main' into mdatagen_fix_package_name
Browse files Browse the repository at this point in the history
  • Loading branch information
codeboten authored Dec 3, 2024
2 parents b60d25b + b9ff1bc commit 64faf62
Show file tree
Hide file tree
Showing 129 changed files with 4,148 additions and 4,788 deletions.
28 changes: 28 additions & 0 deletions .chloggen/11637-exporter-queue-batcher.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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: exporterqueue

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Introduce a feature gate exporter.UsePullingBasedExporterQueueBatcher to use the new pulling model in exporter queue batching.

# One or more tracking issues or pull requests related to the change
issues: [8122, 10368]

# (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 both queuing and batching is enabled for exporter, we now use a pulling model instead of a
pushing model. num_consumer in queue configuration is now used to specify the maximum number of
concurrent workers that are sending out the request.
# 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]
28 changes: 28 additions & 0 deletions .chloggen/igorpeshansky-windows-logger-timestamps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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. otlpreceiver)
component: otelcol

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Change all logged timestamps to ISO8601.

# One or more tracking issues or pull requests related to the change
issues: [10543]

# (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 makes log timestamps human-readable (as opposed to epoch seconds in
scientific notation), but may break users trying to parse logged lines in the
old format.
# 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]
25 changes: 25 additions & 0 deletions .chloggen/profiles-attributetable-slice.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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. otlpreceiver)
component: pdata/pprofile

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: AttributeTable is now a slice rather than a map

# One or more tracking issues or pull requests related to the change
issues: [11706]

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

# 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]
25 changes: 25 additions & 0 deletions .chloggen/profiles-proto-1-4-0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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. otlpreceiver)
component: pdata/pprofile

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Upgrade pdata to opentelemetry-proto v1.4.0

# One or more tracking issues or pull requests related to the change
issues: [11722]

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

# 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]
25 changes: 25 additions & 0 deletions .chloggen/rm-dep-receiver-scrapererror.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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. otlpreceiver)
component: receiver/scraper

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Move receiver/scrapererror package to scraper/scrapererror and deprecate original receiver/scrapererror package.

# One or more tracking issues or pull requests related to the change
issues: [11003]

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

# 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]
25 changes: 25 additions & 0 deletions .chloggen/service_telemetry_metrics_ca_cert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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: service

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add support for ca certificates in telemetry metrics otlp grpc exporter

# One or more tracking issues or pull requests related to the change
issues: [11633]

# (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: Before this change the Certificate value in config was silently ignored.

# 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: []
23 changes: 23 additions & 0 deletions .github/workflows/check-merge-freeze.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Merge freeze

on:
pull_request:
types: [opened, ready_for_review, synchronize, reopened, labeled, unlabeled]
branches: [main]
merge_group:
types: [checks_requested]

jobs:
check-merge-freeze:
name: Check
# This condition is to avoid blocking the PR causing the freeze in the first place.
if: ${{ !contains(github.event.pull_request.labels.*.name, 'release:merge-freeze') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
sparse-checkout: .github/workflows/scripts
- run: ./.github/workflows/scripts/check-merge-freeze.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: open-telemetry/opentelemetry-collector
11 changes: 11 additions & 0 deletions .github/workflows/scripts/check-merge-freeze.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash -e
#
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

BLOCKERS=$( gh pr list --search "label:release:merge-freeze" --json url --jq '.[].url' --repo "${REPO}" )
if [ "${BLOCKERS}" != "" ]; then
echo "Merging in main is frozen, as there are open PRs labeled 'release:merge-freeze': ${BLOCKERS}"
echo "If you believe this is no longer true, re-run this job to unblock your PR."
exit 1
fi
3 changes: 2 additions & 1 deletion .github/workflows/scripts/release-prepare-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ if [ "${CANDIDATE_BETA}" != "" ]; then
fi
git push origin "${BRANCH}"

gh pr create --title "[chore] Prepare release ${RELEASE_VERSION}" --body "
# The `release:merge-freeze` label will cause the `check-merge-freeze` workflow to fail, enforcing the freeze.
gh pr create --title "[chore] Prepare release ${RELEASE_VERSION}" --label release:merge-freeze --body "
The following commands were run to prepare this release:
${COMMANDS}
"
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ ocb:
OPENTELEMETRY_PROTO_SRC_DIR=pdata/internal/opentelemetry-proto

# The branch matching the current version of the proto to use
OPENTELEMETRY_PROTO_VERSION=v1.3.1
OPENTELEMETRY_PROTO_VERSION=v1.4.0

# Find all .proto files.
OPENTELEMETRY_PROTO_FILES := $(subst $(OPENTELEMETRY_PROTO_SRC_DIR)/,,$(wildcard $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/*/v1/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/collector/*/v1/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/*/v1experimental/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/collector/*/v1experimental/*.proto))
OPENTELEMETRY_PROTO_FILES := $(subst $(OPENTELEMETRY_PROTO_SRC_DIR)/,,$(wildcard $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/*/v1/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/collector/*/v1/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/*/v1development/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/collector/*/v1development/*.proto))

# Target directory to write generated files to.
PROTO_TARGET_GEN_DIR=pdata/internal/data/protogen
Expand Down
2 changes: 1 addition & 1 deletion cmd/builder/internal/builder/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

const defaultBetaOtelColVersion = "v0.114.0"
const defaultStableOtelColVersion = "v1.17.0"
const defaultStableOtelColVersion = "v1.20.0"

var (
// errMissingGoMod indicates an empty gomod field
Expand Down
5 changes: 1 addition & 4 deletions docs/security-best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,6 @@ receivers:
Generally, `localhost`-like addresses should be preferred over the 0.0.0.0 address.
For more information, see [CWE-1327](https://cwe.mitre.org/data/definitions/1327.html).

To change the default endpoint to be `localhost`-bound in all components, enable the `component.UseLocalHostAsDefaultHost` feature gate. This feature gate will be enabled by default in the Collector in a future release.


If `localhost` resolves to a different IP due to your DNS settings then explicitly use the loopback IP instead: `127.0.0.1` for IPv4 or `::1` for IPv6. In IPv6 setups, ensure your system supports both IPv4 and IPv6 loopback addresses to avoid issues.

Using `localhost` may not work in environments like Docker, Kubernetes, and other environments that have non-standard networking setups. We've documented a few working example setups for the OTLP receiver gRPC endpoint below, but other receivers and other Collector components may need similar configuration.
Expand Down Expand Up @@ -324,4 +321,4 @@ Extensions may also be used to run subprocesses. This can be useful when
collection mechanisms that cannot natively be run by the Collector (e.g.
FluentBit). Subprocesses expose a completely separate attack vector that would
depend on the subprocess itself. In general, care should be taken before
running any subprocesses alongside the Collector.
running any subprocesses alongside the Collector.
2 changes: 1 addition & 1 deletion exporter/debugexporter/internal/normal/profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (normalProfilesMarshaler) MarshalProfiles(pd pprofile.Profiles) ([]byte, er
buffer.WriteString(profile.ProfileID().String())

buffer.WriteString(" samples=")
buffer.WriteString(strconv.Itoa(profile.Profile().Sample().Len()))
buffer.WriteString(strconv.Itoa(profile.Sample().Len()))

if profile.Attributes().Len() > 0 {
profileAttributes := writeAttributes(profile.Attributes())
Expand Down
4 changes: 2 additions & 2 deletions exporter/debugexporter/internal/normal/profiles_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ func TestMarshalProfiles(t *testing.T) {
profiles := pprofile.NewProfiles()
profile := profiles.ResourceProfiles().AppendEmpty().ScopeProfiles().AppendEmpty().Profiles().AppendEmpty()
profile.SetProfileID([16]byte{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10})
profile.Profile().Sample().AppendEmpty()
profile.Profile().Sample().AppendEmpty()
profile.Sample().AppendEmpty()
profile.Sample().AppendEmpty()
profile.Attributes().PutStr("key1", "value1")
return profiles
}(),
Expand Down
44 changes: 17 additions & 27 deletions exporter/debugexporter/internal/otlptext/databuffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ func (b *dataBuffer) logExemplars(description string, se pmetric.ExemplarSlice)
}
}

func (b *dataBuffer) logProfileSamples(ss pprofile.SampleSlice) {
func (b *dataBuffer) logProfileSamples(ss pprofile.SampleSlice, attrs pprofile.AttributeTableSlice) {
if ss.Len() == 0 {
return
}
Expand All @@ -312,21 +312,16 @@ func (b *dataBuffer) logProfileSamples(ss pprofile.SampleSlice) {
b.logEntry(" Sample #%d", i)
sample := ss.At(i)

b.logEntry(" Location index: %d", sample.LocationIndex().AsRaw())
b.logEntry(" Location length: %d", sample.LocationsLength())
b.logEntry(" Stacktrace ID index: %d", sample.StacktraceIdIndex())
if lb := sample.Label().Len(); lb > 0 {
for j := 0; j < lb; j++ {
b.logEntry(" Label #%d", j)
b.logEntry(" -> Key: %d", sample.Label().At(j).Key())
b.logEntry(" -> Str: %d", sample.Label().At(j).Str())
b.logEntry(" -> Num: %d", sample.Label().At(j).Num())
b.logEntry(" -> Num unit: %d", sample.Label().At(j).NumUnit())
b.logEntry(" Value: %d", sample.Value().AsRaw())

if lai := sample.AttributeIndices().Len(); lai > 0 {
b.logEntry(" Attributes:")
for j := 0; j < lai; j++ {
attr := attrs.At(int(sample.AttributeIndices().At(j)))
b.logEntry(" -> %s: %s", attr.Key(), attr.Value().AsRaw())
}
}
b.logEntry(" Value: %d", sample.Value().AsRaw())
b.logEntry(" Attributes: %d", sample.Attributes().AsRaw())
b.logEntry(" Link: %d", sample.Link())
}
}

Expand All @@ -339,13 +334,11 @@ func (b *dataBuffer) logProfileMappings(ms pprofile.MappingSlice) {
b.logEntry(" Mapping #%d", i)
mapping := ms.At(i)

b.logEntry(" ID: %d", mapping.ID())
b.logEntry(" Memory start: %d", mapping.MemoryStart())
b.logEntry(" Memory limit: %d", mapping.MemoryLimit())
b.logEntry(" File offset: %d", mapping.FileOffset())
b.logEntry(" File name: %d", mapping.Filename())
b.logEntry(" Build ID: %d", mapping.BuildID())
b.logEntry(" Attributes: %d", mapping.Attributes().AsRaw())
b.logEntry(" File name: %d", mapping.FilenameStrindex())
b.logEntry(" Attributes: %d", mapping.AttributeIndices().AsRaw())
b.logEntry(" Has functions: %t", mapping.HasFunctions())
b.logEntry(" Has filenames: %t", mapping.HasFilenames())
b.logEntry(" Has line numbers: %t", mapping.HasLineNumbers())
Expand All @@ -362,7 +355,6 @@ func (b *dataBuffer) logProfileLocations(ls pprofile.LocationSlice) {
b.logEntry(" Location #%d", i)
location := ls.At(i)

b.logEntry(" ID: %d", location.ID())
b.logEntry(" Mapping index: %d", location.MappingIndex())
b.logEntry(" Address: %d", location.Address())
if ll := location.Line().Len(); ll > 0 {
Expand All @@ -375,8 +367,7 @@ func (b *dataBuffer) logProfileLocations(ls pprofile.LocationSlice) {
}
}
b.logEntry(" Is folded: %t", location.IsFolded())
b.logEntry(" Type index: %d", location.TypeIndex())
b.logEntry(" Attributes: %d", location.Attributes().AsRaw())
b.logEntry(" Attributes: %d", location.AttributeIndices().AsRaw())
}
}

Expand All @@ -389,10 +380,9 @@ func (b *dataBuffer) logProfileFunctions(fs pprofile.FunctionSlice) {
b.logEntry(" Function #%d", i)
function := fs.At(i)

b.logEntry(" ID: %d", function.ID())
b.logEntry(" Name: %d", function.Name())
b.logEntry(" System name: %d", function.SystemName())
b.logEntry(" Filename: %d", function.Filename())
b.logEntry(" Name: %d", function.NameStrindex())
b.logEntry(" System name: %d", function.SystemNameStrindex())
b.logEntry(" Filename: %d", function.FilenameStrindex())
b.logEntry(" Start line: %d", function.StartLine())
}
}
Expand All @@ -408,7 +398,7 @@ func (b *dataBuffer) logStringTable(ss pcommon.StringSlice) {
}
}

func (b *dataBuffer) logComment(c pcommon.Int64Slice) {
func (b *dataBuffer) logComment(c pcommon.Int32Slice) {
if c.Len() == 0 {
return
}
Expand All @@ -423,8 +413,8 @@ func attributeUnitsToMap(aus pprofile.AttributeUnitSlice) pcommon.Map {
m := pcommon.NewMap()
for i := 0; i < aus.Len(); i++ {
au := aus.At(i)
m.PutInt("attributeKey", au.AttributeKey())
m.PutInt("unit", au.Unit())
m.PutInt("attributeKey", int64(au.AttributeKeyStrindex()))
m.PutInt("unit", int64(au.UnitStrindex()))
}
return m
}
Expand Down
Loading

0 comments on commit 64faf62

Please sign in to comment.