Skip to content

Commit

Permalink
Merge branch 'lee/fbreceiver' into esotel-beats
Browse files Browse the repository at this point in the history
  • Loading branch information
VihasMakwana committed Sep 26, 2024
2 parents 126aa22 + 7cc59c9 commit b92b041
Show file tree
Hide file tree
Showing 17 changed files with 392 additions and 26 deletions.
23 changes: 23 additions & 0 deletions .buildkite/x-pack/pipeline.xpack.agentbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,30 @@ env:
GCP_HI_PERF_MACHINE_TYPE: "c2d-highcpu-16"
IMAGE_UBUNTU_X86_64: "family/platform-ingest-beats-ubuntu-2204"

IMAGE_BEATS_WITH_HOOKS_LATEST: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest"

steps:
- group: "Check/Update"
key: "x-pack-agentbeat-check-update"

steps:
- label: "agentbeat: Run pre-commit"
command: "pre-commit run --all-files"
agents:
image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}"
memory: "2Gi"
useCustomGlobalHooks: true
notify:
- github_commit_status:
context: "agentbeat: pre-commit"

- wait: ~
# with PRs, we want to run mandatory tests only if check/update step succeed
# for other cases, e.g. merge commits, we want to run mundatory test (and publish) independently of other tests
# this allows building DRA artifacts even if there is flakiness in check/update step
if: build.env("BUILDKITE_PULL_REQUEST") != "false"
depends_on: "x-pack-agentbeat-check-update"

- group: "Agentbeat tests"
key: "agentbeat-mandatory-tests"

Expand Down
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ CHANGELOG*
/x-pack/metricbeat/module/cockroachdb @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/containerd/ @elastic/obs-cloudnative-monitoring
/x-pack/metricbeat/module/coredns @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/enterprisesearch @elastic/ent-search-application
/x-pack/metricbeat/module/enterprisesearch @elastic/app-search-team
/x-pack/metricbeat/module/gcp @elastic/obs-ds-hosted-services @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/gcp/billing @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/gcp/cloudrun_metrics @elastic/obs-infraobs-integrations
Expand Down
2 changes: 0 additions & 2 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff]
- Fix publication of group data from the Okta entity analytics provider. {pull}40681[40681]
- Ensure netflow custom field configuration is applied. {issue}40735[40735] {pull}40730[40730]
- Fix replace processor handling of zero string replacement validation. {pull}40751[40751]
- Fix long filepaths in diagnostics exceeding max path limits on Windows. {pull}40909[40909]


*Heartbeat*

Expand Down
1 change: 0 additions & 1 deletion filebeat/input/v2/compat/compat.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ func (r *runner) Start() {
err := r.input.Run(
v2.Context{
ID: r.id,
IDWithoutName: r.id,
Agent: *r.agent,
Logger: log,
Cancelation: r.sig,
Expand Down
2 changes: 0 additions & 2 deletions filebeat/input/v2/input-cursor/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ func (inp *managedInput) Run(
grp.Go(func() (err error) {
// refine per worker context
inpCtx := ctx
// Preserve IDWithoutName, in case the context was constructed who knows how
inpCtx.IDWithoutName = ctx.ID
inpCtx.ID = ctx.ID + "::" + source.Name()
inpCtx.Logger = ctx.Logger.With("input_source", source.Name())

Expand Down
4 changes: 0 additions & 4 deletions filebeat/input/v2/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ type Context struct {
// The input ID.
ID string

// The input ID without name. Some inputs append sourcename, we need the id to be untouched
// https://github.com/elastic/beats/blob/43d80af2aea60b0c45711475d114e118d90c4581/filebeat/input/v2/input-cursor/input.go#L118
IDWithoutName string

// Agent provides additional Beat info like instance ID or beat name.
Agent beat.Info

Expand Down
97 changes: 97 additions & 0 deletions libbeat/outputs/otelconsumer/otelconsumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,38 +119,135 @@ func mapstrToPcommonMap(m mapstr.M) pcommon.Map {
switch x := v.(type) {
case string:
out.PutStr(k, x)
case []string:
dest := out.PutEmptySlice(k)
for _, i := range v.([]string) {
newVal := dest.AppendEmpty()
newVal.SetStr(i)
}
case int:
out.PutInt(k, int64(v.(int)))
case []int:
dest := out.PutEmptySlice(k)
for _, i := range v.([]int) {
newVal := dest.AppendEmpty()
newVal.SetInt(int64(i))
}
case int8:
out.PutInt(k, int64(v.(int8)))
case []int8:
dest := out.PutEmptySlice(k)
for _, i := range v.([]int8) {
newVal := dest.AppendEmpty()
newVal.SetInt(int64(i))
}
case int16:
out.PutInt(k, int64(v.(int16)))
case []int16:
dest := out.PutEmptySlice(k)
for _, i := range v.([]int16) {
newVal := dest.AppendEmpty()
newVal.SetInt(int64(i))
}
case int32:
out.PutInt(k, int64(v.(int32)))
case []int32:
dest := out.PutEmptySlice(k)
for _, i := range v.([]int32) {
newVal := dest.AppendEmpty()
newVal.SetInt(int64(i))
}
case int64:
out.PutInt(k, v.(int64))
case []int64:
dest := out.PutEmptySlice(k)
for _, i := range v.([]int64) {
newVal := dest.AppendEmpty()
newVal.SetInt(i)
}
case uint:
out.PutInt(k, int64(v.(uint)))
case []uint:
dest := out.PutEmptySlice(k)
for _, i := range v.([]uint) {
newVal := dest.AppendEmpty()
newVal.SetInt(int64(i))
}
case uint8:
out.PutInt(k, int64(v.(uint8)))
case []uint8:
dest := out.PutEmptySlice(k)
for _, i := range v.([]uint8) {
newVal := dest.AppendEmpty()
newVal.SetInt(int64(i))
}
case uint16:
out.PutInt(k, int64(v.(uint16)))
case []uint16:
dest := out.PutEmptySlice(k)
for _, i := range v.([]uint16) {
newVal := dest.AppendEmpty()
newVal.SetInt(int64(i))
}
case uint32:
out.PutInt(k, int64(v.(uint32)))
case []uint32:
dest := out.PutEmptySlice(k)
for _, i := range v.([]uint32) {
newVal := dest.AppendEmpty()
newVal.SetInt(int64(i))
}
case uint64:
out.PutInt(k, int64(v.(uint64)))
case []uint64:
dest := out.PutEmptySlice(k)
for _, i := range v.([]uint64) {
newVal := dest.AppendEmpty()
newVal.SetInt(int64(i))
}
case float32:
out.PutDouble(k, float64(v.(float32)))
case []float32:
dest := out.PutEmptySlice(k)
for _, i := range v.([]float32) {
newVal := dest.AppendEmpty()
newVal.SetDouble(float64(i))
}
case float64:
out.PutDouble(k, v.(float64))
case []float64:
dest := out.PutEmptySlice(k)
for _, i := range v.([]float64) {
newVal := dest.AppendEmpty()
newVal.SetDouble(i)
}
case bool:
out.PutBool(k, x)
case []bool:
dest := out.PutEmptySlice(k)
for _, i := range v.([]bool) {
newVal := dest.AppendEmpty()
newVal.SetBool(i)
}
case mapstr.M:
dest := out.PutEmptyMap(k)
newMap := mapstrToPcommonMap(x)
newMap.CopyTo(dest)
case []mapstr.M:
dest := out.PutEmptySlice(k)
for _, i := range v.([]mapstr.M) {
newVal := dest.AppendEmpty()
newMap := mapstrToPcommonMap(i)
newMap.CopyTo(newVal.SetEmptyMap())
}
case time.Time:
out.PutInt(k, x.UnixMilli())
case []time.Time:
dest := out.PutEmptySlice(k)
for _, i := range v.([]time.Time) {
newVal := dest.AppendEmpty()
newVal.SetInt(i.UnixMilli())
}
default:
out.PutStr(k, fmt.Sprintf("unknown type: %T", x))
}
Expand Down
Loading

0 comments on commit b92b041

Please sign in to comment.