Skip to content

Commit

Permalink
Make elasticsearchexporter available in Agent running in OTel mode (#…
Browse files Browse the repository at this point in the history
…4707)

* Make elasticsearch exporter available in Agent running in OTel mode

* Reordering dependencies

* Regenerating README

* Adding CHANGELOG entry

(cherry picked from commit a045482)

# Conflicts:
#	go.mod
#	go.sum
#	internal/pkg/otel/README.md
  • Loading branch information
ycombinator authored and mergify[bot] committed May 8, 2024
1 parent 10dfc72 commit aec439e
Show file tree
Hide file tree
Showing 6 changed files with 616 additions and 1 deletion.
484 changes: 484 additions & 0 deletions NOTICE.txt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Kind can be one of:
# - breaking-change: a change to previously-documented behavior
# - deprecation: functionality that is being removed in a later release
# - bug-fix: fixes a problem in a previous version
# - enhancement: extends functionality but does not break or fix existing behavior
# - feature: new functionality
# - known-issue: problems that we are aware of in a given version
# - security: impacts on the security of a product or a user’s deployment.
# - upgrade: important information for someone upgrading from a prior version
# - other: does not fit into any of the other categories
kind: feature

# Change summary; a 80ish characters long description of the change.
summary: Makes the `elasticsearchexporter` available to users running Elastic Agent in `otel` mode.

# Long description; in case the summary is not enough to describe the change
# this field accommodate a description without length limits.
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment.
#description:

# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc.
component: elastic-agent

# PR URL; optional; the PR number that added the changeset.
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
# Please provide it if you are adding a fragment for a different PR.
pr: https://github.com/elastic/elastic-agent/pull/4707

# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
# If not present is automatically filled by the tooling with the issue linked to the PR number.
#issue: https://github.com/owner/repo/1234
49 changes: 48 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/elastic/elastic-agent

go 1.21
go 1.21.0

toolchain go1.21.8

require (
github.com/Microsoft/go-winio v0.6.1
Expand Down Expand Up @@ -105,6 +107,39 @@ require (
)

require (
<<<<<<< HEAD
=======
// open telemetry dependencies
// pinned to v0.97.0 due to issue with ports binding which causes our tests to fail
// Do NOT upgrade the version beyond 0.97.0 until https://github.com/open-telemetry/opentelemetry-collector/issues/10031 is fixed!
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/elasticsearchexporter v0.97.0
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.97.0
github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.97.0
github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.97.0
github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.97.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.97.0
go.opentelemetry.io/collector/component v0.97.0
go.opentelemetry.io/collector/confmap v0.99.0
go.opentelemetry.io/collector/confmap/converter/expandconverter v0.97.0
go.opentelemetry.io/collector/confmap/provider/envprovider v0.97.0
go.opentelemetry.io/collector/confmap/provider/fileprovider v0.97.0
go.opentelemetry.io/collector/confmap/provider/httpprovider v0.97.0
go.opentelemetry.io/collector/confmap/provider/httpsprovider v0.97.0
go.opentelemetry.io/collector/confmap/provider/yamlprovider v0.97.0
go.opentelemetry.io/collector/exporter v0.97.0
go.opentelemetry.io/collector/exporter/debugexporter v0.97.0
go.opentelemetry.io/collector/exporter/otlpexporter v0.97.0
go.opentelemetry.io/collector/featuregate v1.6.0
go.opentelemetry.io/collector/otelcol v0.97.0
go.opentelemetry.io/collector/processor v0.97.0
go.opentelemetry.io/collector/processor/batchprocessor v0.97.0
go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.97.0
go.opentelemetry.io/collector/receiver v0.97.0
go.opentelemetry.io/collector/receiver/otlpreceiver v0.97.0
)

require (
>>>>>>> a045482d51 (Make `elasticsearchexporter` available in Agent running in OTel mode (#4707))
github.com/Jeffail/gabs/v2 v2.6.0 // indirect
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/akavel/rsrc v0.8.0 // indirect
Expand All @@ -120,6 +155,7 @@ require (
github.com/dnephin/pflag v1.0.7 // indirect
github.com/docker/docker v25.0.5+incompatible // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/elastic/go-elasticsearch/v7 v7.17.10 // indirect
github.com/elastic/go-structform v0.0.10 // indirect
github.com/elastic/go-windows v1.0.1 // indirect
github.com/elastic/gosigar v0.14.2 // indirect
Expand Down Expand Up @@ -161,6 +197,7 @@ require (
github.com/knadh/koanf/providers/confmap v0.1.0 // indirect
github.com/knadh/koanf/v2 v2.1.1 // indirect
github.com/leodido/ragel-machinery v0.0.0-20190525184631-5f46317e436b // indirect
github.com/lestrrat-go/strftime v1.0.6 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/markbates/pkger v0.17.0 // indirect
Expand All @@ -178,12 +215,22 @@ require (
github.com/mostynb/go-grpc-compression v1.2.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/onsi/ginkgo/v2 v2.9.0 // indirect
<<<<<<< HEAD
github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.98.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.98.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.98.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.98.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.98.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.98.0 // indirect
=======
github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.97.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.97.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.97.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.97.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.97.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.97.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.97.0 // indirect
>>>>>>> a045482d51 (Make `elasticsearchexporter` available in Agent running in OTel mode (#4707))
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
Expand Down
43 changes: 43 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,8 @@ github.com/elastic/elastic-package v0.77.0/go.mod h1:Xeqx0OOVnKBfFoSHsHmKI74RxgR
github.com/elastic/elastic-transport-go/v8 v8.5.0 h1:v5membAl7lvQgBTexPRDBO/RdnlQX+FM9fUVDyXxvH0=
github.com/elastic/elastic-transport-go/v8 v8.5.0/go.mod h1:YLHer5cj0csTzNFXoNQ8qhtGY1GTvSqPnKWKaqQE3Hk=
github.com/elastic/go-elasticsearch/v7 v7.17.7/go.mod h1:OJ4wdbtDNk5g503kvlHLyErCgQwwzmDtaFC4XyOxXA4=
github.com/elastic/go-elasticsearch/v7 v7.17.10 h1:TCQ8i4PmIJuBunvBS6bwT2ybzVFxxUhhltAs3Gyu1yo=
github.com/elastic/go-elasticsearch/v7 v7.17.10/go.mod h1:OJ4wdbtDNk5g503kvlHLyErCgQwwzmDtaFC4XyOxXA4=
github.com/elastic/go-elasticsearch/v8 v8.0.0-20210317102009-a9d74cec0186/go.mod h1:xe9a/L2aeOgFKKgrO3ibQTnMdpAeL0GC+5/HpGScSa4=
github.com/elastic/go-elasticsearch/v8 v8.13.1 h1:du5F8IzUUyCkzxyHdrO9AtopcG95I/qwi2WK8Kf1xlg=
github.com/elastic/go-elasticsearch/v8 v8.13.1/go.mod h1:DIn7HopJs4oZC/w0WoJR13uMUxtHeq92eI5bqv5CRfI=
Expand Down Expand Up @@ -1329,6 +1331,10 @@ github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6Fm
github.com/leodido/ragel-machinery v0.0.0-20181214104525-299bdde78165/go.mod h1:WZxr2/6a/Ar9bMDc2rN/LJrE/hF6bXE4LPyDSIxwAfg=
github.com/leodido/ragel-machinery v0.0.0-20190525184631-5f46317e436b h1:11UHH39z1RhZ5dc4y4r/4koJo6IYFgTRMe/LlwRTEw0=
github.com/leodido/ragel-machinery v0.0.0-20190525184631-5f46317e436b/go.mod h1:WZxr2/6a/Ar9bMDc2rN/LJrE/hF6bXE4LPyDSIxwAfg=
github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc h1:RKf14vYWi2ttpEmkA4aQ3j4u9dStX2t4M8UM6qqNsG8=
github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is=
github.com/lestrrat-go/strftime v1.0.6 h1:CFGsDEt1pOpFNU+TJB0nhz9jl+K0hZSLE205AhTIGQQ=
github.com/lestrrat-go/strftime v1.0.6/go.mod h1:f7jQKgV5nnJpYgdEasS+/y7EsTb8ykN2z68n3TtcTaw=
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE=
Expand Down Expand Up @@ -1526,6 +1532,7 @@ github.com/onsi/gomega v1.22.1/go.mod h1:x6n7VNe4hw0vkyYUM4mjIXx3JbLiPaBPNgB7PRQ
github.com/onsi/gomega v1.23.0/go.mod h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2vQAg=
github.com/onsi/gomega v1.27.3 h1:5VwIwnBY3vbBDOJrNtA4rVdiTZCsq9B5F12pvy1Drmk=
github.com/onsi/gomega v1.27.3/go.mod h1:5vG284IBtfDAmDyrK+eGyZmUgUlmi+Wngqo557cZ6Gw=
<<<<<<< HEAD
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.98.0 h1:eD48RXTOTI4mUqwmMbifd2xygNPFQk2+Q+h79tMKgRo=
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.98.0/go.mod h1:iUXj76MTvLxgCJX6MU5d44bDSJJDkhZyKWTgSqt3DQw=
github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding v0.98.0 h1:GNDpMm6OqCTe7r1PFyDhm4CXQTqYPrnA3FEPt6ZkKzY=
Expand Down Expand Up @@ -1558,6 +1565,42 @@ github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformpro
github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.98.0/go.mod h1:iz/isMSPjHCFKiS9twzsfBMwy1j7p4fAxLSL47mf7zI=
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.98.0 h1:hiudTWIOCQ6boREJ10ijrsaSwB6ywZ+Zf9JpDWBLsfM=
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.98.0/go.mod h1:C+3Bs5efAss1Wv0y1Bfq5YWGf8xmoF0d2TCDx/Kr5o8=
=======
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/elasticsearchexporter v0.97.0 h1:VDx9u2xhgrjb0ozp2/SDeSF0cGZ0ECP4KSSQT8jOo5U=
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/elasticsearchexporter v0.97.0/go.mod h1:PXX2jvijwqSwoS2wR/kNqeW3YLH9FcWIkJp4GBOGlVE=
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.97.0 h1:hiLEBltXVuC1aTxp8J/6dJv0qu1dLJMFvmU7BJSlWoM=
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.97.0/go.mod h1:tkySqhV+P3MZI0GhbSHFFs4dkYlUjFqUDm+L9AIdU4I=
github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding v0.97.0 h1:HgmPxcExu/+JEe0SAH3nCwE/tXXtZR8piQLukFNwKZM=
github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding v0.97.0/go.mod h1:2LAf/7p2hjm8s4mweCdK7B6JrthY4oU8/KyTUWNf8J0=
github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension v0.97.0 h1:5LqASms3h6fwZhMQbkxlx72eBLzLdXRkUNzTNl6S1qU=
github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension v0.97.0/go.mod h1:SnFQAfMJ8dNyIW/VaTjhXhgAdQt+nW7bYOO0nVZryJQ=
github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.97.0 h1:p7ANWW52nAKp9+f7RgGZvvXqU80rZu6yXVdSvcrgta0=
github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.97.0/go.mod h1:eLeuqRgW59hKeKdSdD2mNOs64yBKuxyp6udwgToUxjE=
github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.97.0 h1:jPhm8t6pJcxgng2DaEhPZ3sY44KBoM0W32j6aI+hMgU=
github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.97.0/go.mod h1:PAJCWmb9gEZh1OhazzHrvUGQeu31Rzqm8OJQVfxlLwU=
github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.97.0 h1:vX/BkTfd7/cvydXJ7FmUy5iSviQeNGAgTCoXcLu7/Ww=
github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.97.0/go.mod h1:yrlbvRlLeny1kFmj4Ac9BSqv/pOr2h7sOIvDE6OMCKk=
github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.97.0 h1:f3HVDcjUVUbOpKWiebD9v8+9YdDdNvzPyKh3IVb0ORY=
github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.97.0/go.mod h1:110wLws4lB2Jpv58rK7YoaMIhIEmLlzw5/viC0XJhbM=
github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.97.0 h1:sd7JEwe5e7VYel/6gFWTKFTsQz8PxzdpU8tWlL6Ymos=
github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.97.0/go.mod h1:2E6Bx0OjGlwbsdpakU6ZiMb2VeA2hIcssmFL9Ov251g=
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.97.0 h1:bVeo7BahYY4rWdaEuzJX2Tn20MbvYcEHXbFjV2IwnPQ=
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.97.0/go.mod h1:lj29zRdEZdvbQvZ6g7Pb+tSPw4dQE/jahe39fRgO+08=
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.97.0 h1:zVXzbHR2aXRuypZXve4+AxcEYeeYeqzl76WtkZ/pGpw=
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.97.0/go.mod h1:K6kz22H/i+t2/BGyCsaaNxFKjoXr1VJPhJV4GtjnJK0=
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.97.0 h1:MWki5BBYideAF82i3ladRxmed3nkkGHDUA1YC2p2mz8=
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.97.0/go.mod h1:Zsl3xSYy9QFqZ5lTPXqPHSuxz03kUaMw75kvvScE+94=
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.97.0 h1:j0YEfadJv26PQWhaMynfWcDtSnsAGvBmGW9wwp+q2mU=
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.97.0/go.mod h1:BleH1EFM1PjhKy9geg/FVIsvc/v7hl+FqZlxAnzUHSk=
github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.97.0 h1:CeNd+aJaRCDb3bwNvC75ilP8uFRpWI3oD5rSJgmP7AY=
github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.97.0/go.mod h1:2YXD48xGbLZ2mk5ScmrDYzPXjZb4R+1c2723AWuz5Pw=
github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.97.0 h1:Fa3TvB9WKi6wF3N1Kn4oDeyrigAidK+0uQaAvRQUwLQ=
github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.97.0/go.mod h1:XKpJmOEQTVg6CdbWi9n1Gr+MYc3A6DtYX3uuYB7Q4so=
github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.97.0 h1:8UfxoSP0ZKkib+RWZVdCixHEjkz1VxspRAmHqmexO9M=
github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.97.0/go.mod h1:LNP6YdtDyTLyKgLFmg0qo7U4LgIlsYlRH9kC47j+vT4=
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.97.0 h1:LDeauKxJqswkxA2XVWXHAa9zpQuIbz1JpqrWtVscNl0=
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.97.0/go.mod h1:kl9u418k+2spS75V0kDglwysLzpDGu50eC9MK4r6Yy0=
>>>>>>> a045482d51 (Make `elasticsearchexporter` available in Agent running in OTel mode (#4707))
github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
Expand Down
7 changes: 7 additions & 0 deletions internal/pkg/otel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,16 @@ This section provides a summary of components included in the Elastic Distributi

| Component | Version |
|---|---|
<<<<<<< HEAD
| fileexporter | v0.98.0|
| debugexporter | v0.96.0|
| otlpexporter | v0.96.0|
=======
| elasticsearchexporter | v0.97.0|
| fileexporter | v0.97.0|
| debugexporter | v0.97.0|
| otlpexporter | v0.97.0|
>>>>>>> a045482d51 (Make `elasticsearchexporter` available in Agent running in OTel mode (#4707))


Expand Down
2 changes: 2 additions & 0 deletions internal/pkg/otel/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"go.opentelemetry.io/collector/processor/memorylimiterprocessor" // for putting backpressure when approach a memory limit

// Exporters:
"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/elasticsearchexporter"
fileexporter "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter" // for e2e tests
debugexporter "go.opentelemetry.io/collector/exporter/debugexporter" // for dev
"go.opentelemetry.io/collector/exporter/otlpexporter"
Expand Down Expand Up @@ -57,6 +58,7 @@ func components() (otelcol.Factories, error) {
otlpexporter.NewFactory(),
debugexporter.NewFactory(),
fileexporter.NewFactory(),
elasticsearchexporter.NewFactory(),
)
if err != nil {
return otelcol.Factories{}, err
Expand Down

0 comments on commit aec439e

Please sign in to comment.