Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic configuration for the APM tracer #18861

Merged
merged 16 commits into from
Jun 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG-developer.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ The list below covers the major changes between 7.0.0-rc2 and master only.

==== Added

- Add configuration for APM instrumentation and expose the tracer trough the Beat object. {pull}17938[17938]
- Make the behavior of clientWorker and netClientWorker consistent when error is returned from publisher pipeline
- Metricset generator generates beta modules by default now. {pull}10657[10657]
- The `beat.Event` accessor methods now support `@metadata` keys. {pull}10761[10761]
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d

*Affecting all Beats*

- Add configuration for APM instrumentation and expose the tracer trough the Beat object. {pull}17938[17938]
- Add document_id setting to decode_json_fields processor. {pull}15859[15859]
- Include network information by default on add_host_metadata and add_observer_metadata. {issue}15347[15347] {pull}16077[16077]
- Add `aws_ec2` provider for autodiscover. {issue}12518[12518] {pull}14823[14823]
Expand Down
35 changes: 35 additions & 0 deletions auditbeat/auditbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1482,6 +1482,41 @@ logging.files:
# Enable or disable seccomp system call filtering on Linux. Default is enabled.
#seccomp.enabled: true

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

# Instrumentation support for the auditbeat.
#instrumentation:
# Set to true to enable instrumentation of auditbeat.
#enabled: false

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

# APM Server hosts to report instrumentation results to.
#hosts:
# - http://localhost:8200

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

# Secret token for the 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

# ================================= Migration ==================================

# This allows to enable 6.7 migration aliases
Expand Down
22 changes: 22 additions & 0 deletions auditbeat/auditbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,28 @@ processors:
# uncomment the following line.
#monitoring.elasticsearch:

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

# Instrumentation support for the auditbeat.
#instrumentation:
# Set to true to enable instrumentation of auditbeat.
#enabled: false

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

# APM Server hosts to report instrumentation results to.
#hosts:
# - http://localhost:8200

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

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


# ================================= Migration ==================================

# This allows to enable 6.7 migration aliases
Expand Down
35 changes: 35 additions & 0 deletions filebeat/filebeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2195,6 +2195,41 @@ logging.files:
# Enable or disable seccomp system call filtering on Linux. Default is enabled.
#seccomp.enabled: true

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

# Instrumentation support for the filebeat.
#instrumentation:
# Set to true to enable instrumentation of filebeat.
#enabled: false

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

# APM Server hosts to report instrumentation results to.
#hosts:
# - http://localhost:8200

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

# Secret token for the 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

# ================================= Migration ==================================

# This allows to enable 6.7 migration aliases
Expand Down
22 changes: 22 additions & 0 deletions filebeat/filebeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,28 @@ processors:
# uncomment the following line.
#monitoring.elasticsearch:

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

# Instrumentation support for the filebeat.
#instrumentation:
# Set to true to enable instrumentation of filebeat.
#enabled: false

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

# APM Server hosts to report instrumentation results to.
#hosts:
# - http://localhost:8200

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

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


# ================================= Migration ==================================

# This allows to enable 6.7 migration aliases
Expand Down
35 changes: 35 additions & 0 deletions heartbeat/heartbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1632,6 +1632,41 @@ logging.files:
# Enable or disable seccomp system call filtering on Linux. Default is enabled.
#seccomp.enabled: true

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

# Instrumentation support for the heartbeat.
#instrumentation:
# Set to true to enable instrumentation of heartbeat.
#enabled: false

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

# APM Server hosts to report instrumentation results to.
#hosts:
# - http://localhost:8200

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

# Secret token for the 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

# ================================= Migration ==================================

# This allows to enable 6.7 migration aliases
Expand Down
22 changes: 22 additions & 0 deletions heartbeat/heartbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,28 @@ processors:
# uncomment the following line.
#monitoring.elasticsearch:

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

# Instrumentation support for the heartbeat.
#instrumentation:
# Set to true to enable instrumentation of heartbeat.
#enabled: false

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

# APM Server hosts to report instrumentation results to.
#hosts:
# - http://localhost:8200

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

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


# ================================= Migration ==================================

# This allows to enable 6.7 migration aliases
Expand Down
35 changes: 35 additions & 0 deletions journalbeat/journalbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1424,6 +1424,41 @@ logging.files:
# Enable or disable seccomp system call filtering on Linux. Default is enabled.
#seccomp.enabled: true

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

# Instrumentation support for the journalbeat.
#instrumentation:
# Set to true to enable instrumentation of journalbeat.
#enabled: false

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

# APM Server hosts to report instrumentation results to.
#hosts:
# - http://localhost:8200

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

# Secret token for the 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

# ================================= Migration ==================================

# This allows to enable 6.7 migration aliases
Expand Down
22 changes: 22 additions & 0 deletions journalbeat/journalbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,28 @@ processors:
# uncomment the following line.
#monitoring.elasticsearch:

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

# Instrumentation support for the journalbeat.
#instrumentation:
# Set to true to enable instrumentation of journalbeat.
#enabled: false

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

# APM Server hosts to report instrumentation results to.
#hosts:
# - http://localhost:8200

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

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


# ================================= Migration ==================================

# This allows to enable 6.7 migration aliases
Expand Down
1 change: 1 addition & 0 deletions libbeat/_meta/config/default.reference.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@
{{template "monitoring.reference.yml.tmpl" .}}
{{template "http.reference.yml.tmpl" .}}
{{template "seccomp.reference.yml.tmpl" .}}
{{template "instrumentation.reference.yml.tmpl" .}}
{{template "migration.yml.tmpl" .}}
1 change: 1 addition & 0 deletions libbeat/_meta/config/default.short.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
{{template "processors.yml.tmpl" .}}
{{template "logging.yml.tmpl" .}}
{{template "monitoring.yml.tmpl" .}}
{{template "instrumentation.yml.tmpl" .}}
{{template "migration.yml.tmpl" .}}
34 changes: 34 additions & 0 deletions libbeat/_meta/config/instrumentation.reference.yml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{{header "Instrumentation"}}

# Instrumentation support for the {{.BeatName}}.
#instrumentation:
# Set to true to enable instrumentation of {{.BeatName}}.
#enabled: false

# Environment in which {{.BeatName}} is running on (eg: staging, production, etc.)
#environment: ""

# APM Server hosts to report instrumentation results to.
#hosts:
# - http://localhost:8200

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

# Secret token for the 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
21 changes: 21 additions & 0 deletions libbeat/_meta/config/instrumentation.yml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{header "Instrumentation"}}

# Instrumentation support for the {{.BeatName}}.
#instrumentation:
# Set to true to enable instrumentation of {{.BeatName}}.
#enabled: false

# Environment in which {{.BeatName}} is running on (eg: staging, production, etc.)
#environment: ""

# APM Server hosts to report instrumentation results to.
#hosts:
# - http://localhost:8200

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

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

3 changes: 3 additions & 0 deletions libbeat/beat/beat.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package beat

import (
"github.com/elastic/beats/v7/libbeat/common"
"github.com/elastic/beats/v7/libbeat/instrumentation"
"github.com/elastic/beats/v7/libbeat/keystore"
"github.com/elastic/beats/v7/libbeat/management"
)
Expand Down Expand Up @@ -69,6 +70,8 @@ type Beat struct {
Manager management.Manager // manager

Keystore keystore.Keystore

Instrumentation instrumentation.Instrumentation // instrumentation holds an APM agent for capturing and reporting traces
}

// BeatConfig struct contains the basic configuration of every beat
Expand Down
Loading