Skip to content

Commit

Permalink
Revert "Support new instrumentation config and tracer from Libbeat (e…
Browse files Browse the repository at this point in the history
…lastic#3836)"

This reverts commit 6ba318f.
  • Loading branch information
jalvz committed Jul 2, 2020
1 parent b7a6b6e commit 1ba1007
Show file tree
Hide file tree
Showing 15 changed files with 313 additions and 251 deletions.
2 changes: 1 addition & 1 deletion NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ Contents of "LICENSE":
--------------------------------------------------------------------
Dependency: github.com/elastic/beats/v7
Version: v7.0.0
Revision: 1498938e22f3
Revision: 0dcb3dfebef7
License type (autodetected): Apache-2.0

--------------------------------------------------------------------
Expand Down
70 changes: 33 additions & 37 deletions _meta/beat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,39 @@ apm-server:
# Url to expose expvar.
#url: "/debug/vars"

# Instrumentation support for the server's HTTP endpoints and event publisher.
#instrumentation:
# Set to true to enable instrumentation of the APM Server itself.
#enabled: false

# Environment in which the APM Server is running on (eg: staging, production, etc.)
#environment: ""

# Remote hosts to report instrumentation results to.
#hosts:
# - http://remote-apm-server:8200

# API Key for the remote APM Server(s).
# If api_key is set then secret_token will be ignored.
#api_key:

# Secret token for the remote APM Server(s).
#secret_token:

# Enable profiling of the server, recording profile samples as events.
#
# This feature is experimental.
#profiling:
#cpu:
# Set to true to enable CPU profiling.
#enabled: false
#interval: 60s
#duration: 10s
#heap:
# Set to true to enable heap profiling.
#enabled: false
#interval: 60s

# A pipeline is a definition of processors applied to documents when ingesting them to Elasticsearch.
# Using pipelines involves two steps:
# (1) registering a pipeline
Expand Down Expand Up @@ -950,43 +983,6 @@ output.elasticsearch:
# Kerberos realm.
#kerberos.realm: ELASTIC

#============================= Instrumentation =============================

# Instrumentation support for the server's HTTP endpoints and event publisher.
#instrumentation:

# Set to true to enable instrumentation of the APM Server itself.
#enabled: false

# Environment in which the APM Server is running on (eg: staging, production, etc.)
#environment: ""

# Hosts to report instrumentation results to.
# For reporting to itself, leave this field commented
#hosts:
# - http://remote-apm-server:8200

# API Key for the remote APM Server(s).
# If api_key is set then secret_token will be ignored.
#api_key:

# Secret token for the remote APM Server(s).
#secret_token:

# Enable profiling of the server, recording profile samples as events.
#
# This feature is experimental.
#profiling:
#cpu:
# Set to true to enable CPU profiling.
#enabled: false
#interval: 60s
#duration: 10s
#heap:
# Set to true to enable heap profiling.
#enabled: false
#interval: 60s

#================================= Paths ==================================

# The home path for the apm-server installation. This is the default base path
Expand Down
70 changes: 33 additions & 37 deletions apm-server.docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,39 @@ apm-server:
# Url to expose expvar.
#url: "/debug/vars"

# Instrumentation support for the server's HTTP endpoints and event publisher.
#instrumentation:
# Set to true to enable instrumentation of the APM Server itself.
#enabled: false

# Environment in which the APM Server is running on (eg: staging, production, etc.)
#environment: ""

# Remote hosts to report instrumentation results to.
#hosts:
# - http://remote-apm-server:8200

# API Key for the remote APM Server(s).
# If api_key is set then secret_token will be ignored.
#api_key:

# Secret token for the remote APM Server(s).
#secret_token:

# Enable profiling of the server, recording profile samples as events.
#
# This feature is experimental.
#profiling:
#cpu:
# Set to true to enable CPU profiling.
#enabled: false
#interval: 60s
#duration: 10s
#heap:
# Set to true to enable heap profiling.
#enabled: false
#interval: 60s

# A pipeline is a definition of processors applied to documents when ingesting them to Elasticsearch.
# Using pipelines involves two steps:
# (1) registering a pipeline
Expand Down Expand Up @@ -950,43 +983,6 @@ output.elasticsearch:
# Kerberos realm.
#kerberos.realm: ELASTIC

#============================= Instrumentation =============================

# Instrumentation support for the server's HTTP endpoints and event publisher.
#instrumentation:

# Set to true to enable instrumentation of the APM Server itself.
#enabled: false

# Environment in which the APM Server is running on (eg: staging, production, etc.)
#environment: ""

# Hosts to report instrumentation results to.
# For reporting to itself, leave this field commented
#hosts:
# - http://remote-apm-server:8200

# API Key for the remote APM Server(s).
# If api_key is set then secret_token will be ignored.
#api_key:

# Secret token for the remote APM Server(s).
#secret_token:

# Enable profiling of the server, recording profile samples as events.
#
# This feature is experimental.
#profiling:
#cpu:
# Set to true to enable CPU profiling.
#enabled: false
#interval: 60s
#duration: 10s
#heap:
# Set to true to enable heap profiling.
#enabled: false
#interval: 60s

#================================= Paths ==================================

# The home path for the apm-server installation. This is the default base path
Expand Down
70 changes: 33 additions & 37 deletions apm-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,39 @@ apm-server:
# Url to expose expvar.
#url: "/debug/vars"

# Instrumentation support for the server's HTTP endpoints and event publisher.
#instrumentation:
# Set to true to enable instrumentation of the APM Server itself.
#enabled: false

# Environment in which the APM Server is running on (eg: staging, production, etc.)
#environment: ""

# Remote hosts to report instrumentation results to.
#hosts:
# - http://remote-apm-server:8200

# API Key for the remote APM Server(s).
# If api_key is set then secret_token will be ignored.
#api_key:

# Secret token for the remote APM Server(s).
#secret_token:

# Enable profiling of the server, recording profile samples as events.
#
# This feature is experimental.
#profiling:
#cpu:
# Set to true to enable CPU profiling.
#enabled: false
#interval: 60s
#duration: 10s
#heap:
# Set to true to enable heap profiling.
#enabled: false
#interval: 60s

# A pipeline is a definition of processors applied to documents when ingesting them to Elasticsearch.
# Using pipelines involves two steps:
# (1) registering a pipeline
Expand Down Expand Up @@ -950,43 +983,6 @@ output.elasticsearch:
# Kerberos realm.
#kerberos.realm: ELASTIC

#============================= Instrumentation =============================

# Instrumentation support for the server's HTTP endpoints and event publisher.
#instrumentation:

# Set to true to enable instrumentation of the APM Server itself.
#enabled: false

# Environment in which the APM Server is running on (eg: staging, production, etc.)
#environment: ""

# Hosts to report instrumentation results to.
# For reporting to itself, leave this field commented
#hosts:
# - http://remote-apm-server:8200

# API Key for the remote APM Server(s).
# If api_key is set then secret_token will be ignored.
#api_key:

# Secret token for the remote APM Server(s).
#secret_token:

# Enable profiling of the server, recording profile samples as events.
#
# This feature is experimental.
#profiling:
#cpu:
# Set to true to enable CPU profiling.
#enabled: false
#interval: 60s
#duration: 10s
#heap:
# Set to true to enable heap profiling.
#enabled: false
#interval: 60s

#================================= Paths ==================================

# The home path for the apm-server installation. This is the default base path
Expand Down
10 changes: 4 additions & 6 deletions beater/beater.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,12 @@ type beater struct {
// Run runs the APM Server, blocking until the beater's Stop method is called,
// or a fatal error occurs.
func (bt *beater) Run(b *beat.Beat) error {

var tracerServer *tracerServer
var err error
if listener := b.Instrumentation.Listener(); listener != nil {
tracerServer = newTracerServer(bt.config, listener)
tracer, tracerServer, err := initTracer(b.Info, bt.config, bt.logger)
if err != nil {
return err
}
defer tracer.Close()

tracer := b.Instrumentation.Tracer()
runServer := runServer
if tracerServer != nil {
runServer = runServerWithTracerServer(runServer, tracerServer, tracer)
Expand Down
11 changes: 3 additions & 8 deletions beater/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (

"github.com/elastic/beats/v7/libbeat/beat"
"github.com/elastic/beats/v7/libbeat/common"
"github.com/elastic/beats/v7/libbeat/instrumentation"
"github.com/elastic/beats/v7/libbeat/logp"
"github.com/elastic/beats/v7/libbeat/outputs"
pubs "github.com/elastic/beats/v7/libbeat/publisher"
Expand Down Expand Up @@ -515,15 +514,11 @@ func setupServer(t *testing.T, cfg *common.Config, beatConfig *beat.BeatConfig,
pub = dummyPipeline(cfg, info)
}

instrumentation, err := instrumentation.New(baseConfig, info.Beat, info.Version)
require.NoError(t, err)

// create a beat
apmBeat := &beat.Beat{
Publisher: pub,
Info: info,
Config: beatConfig,
Instrumentation: instrumentation,
Publisher: pub,
Info: info,
Config: beatConfig,
}
return setupBeater(t, apmBeat, baseConfig, beatConfig)
}
Expand Down
Loading

0 comments on commit 1ba1007

Please sign in to comment.