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
  • Loading branch information
ycombinator authored May 8, 2024
1 parent 410c40c commit a045482
Show file tree
Hide file tree
Showing 6 changed files with 534 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
8 changes: 7 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 @@ -85,6 +87,7 @@ require (
// 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
Expand Down Expand Up @@ -126,6 +129,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.3 // indirect
Expand Down Expand Up @@ -168,6 +172,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 @@ -185,6 +190,7 @@ 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
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
Expand Down
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,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 @@ -1322,6 +1324,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 @@ -1519,6 +1525,8 @@ 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=
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=
Expand Down
1 change: 1 addition & 0 deletions internal/pkg/otel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ This section provides a summary of components included in the Elastic Distributi

| Component | Version |
|---|---|
| elasticsearchexporter | v0.97.0|
| fileexporter | v0.97.0|
| debugexporter | v0.97.0|
| otlpexporter | v0.97.0|
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 a045482

Please sign in to comment.