Skip to content

Commit

Permalink
Merge branch 'main' into move-attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
odubajDT authored Oct 2, 2024
2 parents 32aae5a + a191550 commit a0016ff
Show file tree
Hide file tree
Showing 198 changed files with 2,396 additions and 932 deletions.
30 changes: 30 additions & 0 deletions .chloggen/elasticsearchexporter_mapping-hint.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: elasticsearchexporter

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Implement elasticsearch.mapping.hints attribute handling for data points in OTel mapping mode

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

# (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:
elasticsearch.mapping.hints takes a slice of strings.
`_doc_count` enables emitting `_doc_count` for the document.
`aggregate_metric_double` causes histogram or exponential histogram to be emitted as aggregate_metric_double.

# 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]
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
change_type: enhancement

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Emit _doc_count for metric documents in OTel mode when data point attribute _doc_count is true
note: Add ToKeyValueString Converter

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

# (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.
Expand All @@ -24,4 +24,4 @@ subtext:
# 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]
change_logs: []
28 changes: 28 additions & 0 deletions .chloggen/prw-receiver.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: new_component

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: |
Add a new receiver for Prometheus Remote Write.
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [33782]

# (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/refactor-config-in-opampsupervisor.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: opampsupervisor

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Pass config structure instead of file path when using NewSupervisor function

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

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: No longer return an error when geo metadata is not found by a provider.

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

# (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: []
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ receiver/otlpjsonfilereceiver/ @open-teleme
receiver/podmanreceiver/ @open-telemetry/collector-contrib-approvers @rogercoll
receiver/postgresqlreceiver/ @open-telemetry/collector-contrib-approvers @djaglowski
receiver/prometheusreceiver/ @open-telemetry/collector-contrib-approvers @Aneurysm9 @dashpole
receiver/prometheusremotewritereceiver/ @open-telemetry/collector-contrib-approvers @dashpole @ArthurSens
receiver/pulsarreceiver/ @open-telemetry/collector-contrib-approvers @dmitryax @dao-jun
receiver/purefareceiver/ @open-telemetry/collector-contrib-approvers @jpkrohling @dgoscn @chrroberts-pure
receiver/purefbreceiver/ @open-telemetry/collector-contrib-approvers @jpkrohling @dgoscn @chrroberts-pure
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ body:
- receiver/podman
- receiver/postgresql
- receiver/prometheus
- receiver/prometheusremotewrite
- receiver/pulsar
- receiver/purefa
- receiver/purefb
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ body:
- receiver/podman
- receiver/postgresql
- receiver/prometheus
- receiver/prometheusremotewrite
- receiver/pulsar
- receiver/purefa
- receiver/purefb
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/other.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ body:
- receiver/podman
- receiver/postgresql
- receiver/prometheus
- receiver/prometheusremotewrite
- receiver/pulsar
- receiver/purefa
- receiver/purefb
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/unmaintained.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ body:
- receiver/podman
- receiver/postgresql
- receiver/prometheus
- receiver/prometheusremotewrite
- receiver/pulsar
- receiver/purefa
- receiver/purefb
Expand Down
3 changes: 1 addition & 2 deletions .github/auto_assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ assigneeGroups:
- codeboten
- djaglowski
- dmitryax
# Unavailable 2024-08-12 -- 2024-08-23, 2024-09-06 -- 2024-09-30
# - evan-bradley
- evan-bradley
- jpkrohling
- MovieStoreGuy
- mx-psi
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ jobs:
merge-multiple: true
pattern: coverage-artifacts-*
- name: Upload coverage report
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # 4.5.0
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # 4.6.0
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ gogci:
gotidy:
$(MAKE) $(FOR_GROUP_TARGET) TARGET="tidy"

.PHONY: remove-toolchain
remove-toolchain:
$(MAKE) $(FOR_GROUP_TARGET) TARGET="toolchain"

.PHONY: gomoddownload
gomoddownload:
$(MAKE) $(FOR_GROUP_TARGET) TARGET="moddownload"
Expand Down Expand Up @@ -404,11 +408,12 @@ update-otel:$(MULTIMOD)
$(MULTIMOD) sync -s=true -o ../opentelemetry-collector -m beta --commit-hash $(OTEL_VERSION)
git add . && git commit -s -m "[chore] multimod update beta modules" ; \
$(MAKE) gotidy
$(call updatehelper,$(CORE_VERSIONS),$(GOMOD),./cmd/otelcontribcol/builder-config.yaml)
$(call updatehelper,$(CORE_VERSIONS),$(GOMOD),./cmd/otelcontribcol/builder-config.yaml)
$(call updatehelper,$(CORE_VERSIONS),$(GOMOD),./cmd/oteltestbedcol/builder-config.yaml)
$(MAKE) genotelcontribcol
$(MAKE) genoteltestbedcol
$(MAKE) oteltestbedcol
$(MAKE) remove-toolchain

.PHONY: otel-from-tree
otel-from-tree:
Expand Down
4 changes: 4 additions & 0 deletions Makefile.Common
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ tidy:
rm -fr go.sum
$(GOCMD) mod tidy -compat=1.22.0

.PHONY: toolchain
toolchain:
$(GOCMD) get toolchain@none

.PHONY: misspell
misspell: $(TOOLS_BIN_DIR)/misspell
@echo "running $(MISSPELL)"
Expand Down
3 changes: 2 additions & 1 deletion cmd/githubgen/allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ tomasmota
m1rp
jriguera
abhishek-at-cloudwerx
joker-star-l
joker-star-l
ArthurSens
6 changes: 5 additions & 1 deletion cmd/opampsupervisor/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ func newUnstartedOpAMPServer(t *testing.T, connectingCallback onConnectingFuncFa

func newSupervisor(t *testing.T, configType string, extraConfigData map[string]string) *supervisor.Supervisor {
cfgFile := getSupervisorConfig(t, configType, extraConfigData)
s, err := supervisor.NewSupervisor(zap.NewNop(), cfgFile.Name())

cfg, err := config.Load(cfgFile.Name())
require.NoError(t, err)

s, err := supervisor.NewSupervisor(zap.NewNop(), cfg)
require.NoError(t, err)

return s
Expand Down
10 changes: 9 additions & 1 deletion cmd/opampsupervisor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"go.uber.org/zap"

"github.com/open-telemetry/opentelemetry-collector-contrib/cmd/opampsupervisor/supervisor"
"github.com/open-telemetry/opentelemetry-collector-contrib/cmd/opampsupervisor/supervisor/config"
)

func main() {
Expand All @@ -19,7 +20,14 @@ func main() {

logger, _ := zap.NewDevelopment()

supervisor, err := supervisor.NewSupervisor(logger, *configFlag)
cfg, err := config.Load(*configFlag)
if err != nil {
logger.Error(err.Error())
os.Exit(-1)
return
}

supervisor, err := supervisor.NewSupervisor(logger, cfg)
if err != nil {
logger.Error(err.Error())
os.Exit(-1)
Expand Down
30 changes: 30 additions & 0 deletions cmd/opampsupervisor/supervisor/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import (
"runtime"
"time"

"github.com/knadh/koanf/parsers/yaml"
"github.com/knadh/koanf/providers/file"
"github.com/knadh/koanf/v2"
"github.com/open-telemetry/opamp-go/protobufs"
"go.opentelemetry.io/collector/config/configtls"
)
Expand All @@ -25,6 +28,33 @@ type Supervisor struct {
Storage Storage `mapstructure:"storage"`
}

// Load loads the Supervisor config from a file.
func Load(configFile string) (Supervisor, error) {
if configFile == "" {
return Supervisor{}, errors.New("path to config file cannot be empty")
}

k := koanf.New("::")
if err := k.Load(file.Provider(configFile), yaml.Parser()); err != nil {
return Supervisor{}, err
}

decodeConf := koanf.UnmarshalConf{
Tag: "mapstructure",
}

cfg := DefaultSupervisor()
if err := k.UnmarshalWithConf("", &cfg, decodeConf); err != nil {
return Supervisor{}, fmt.Errorf("cannot parse %s: %w", configFile, err)
}

if err := cfg.Validate(); err != nil {
return Supervisor{}, fmt.Errorf("cannot validate supervisor config %s: %w", configFile, err)
}

return cfg, nil
}

func (s Supervisor) Validate() error {
if err := s.Server.Validate(); err != nil {
return err
Expand Down
Loading

0 comments on commit a0016ff

Please sign in to comment.