From fb90d3aa9220bb8e9226fa304eb92a505ba1c900 Mon Sep 17 00:00:00 2001 From: Brandon Morelli Date: Tue, 12 Jan 2021 16:26:49 -0800 Subject: [PATCH 1/2] docs: link to other troubleshooting guides (#4608) --- docs/guide/troubleshooting.asciidoc | 3 ++- docs/troubleshooting.asciidoc | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/docs/guide/troubleshooting.asciidoc b/docs/guide/troubleshooting.asciidoc index a97ce09ddc3..f27b2694ba6 100644 --- a/docs/guide/troubleshooting.asciidoc +++ b/docs/guide/troubleshooting.asciidoc @@ -6,9 +6,10 @@ If you run into trouble, there are three places you can look for help. [float] === Troubleshooting documentation -The APM Server and each APM agent has a troubleshooting guide: +The APM Server, APM app, and each APM agent has a troubleshooting guide: * {apm-server-ref-v}/troubleshooting.html[APM Server troubleshooting] +* {kibana-ref}/troubleshooting.html[APM app troubleshooting] * {apm-dotnet-ref-v}/troubleshooting.html[.NET agent troubleshooting] * {apm-go-ref-v}/troubleshooting.html[Go agent troubleshooting] * {apm-java-ref-v}/trouble-shooting.html[Java agent troubleshooting] diff --git a/docs/troubleshooting.asciidoc b/docs/troubleshooting.asciidoc index 62bc85e7a84..8845cf3f124 100644 --- a/docs/troubleshooting.asciidoc +++ b/docs/troubleshooting.asciidoc @@ -1,13 +1,9 @@ -////////////////////////////////////////////////////////////////////////// -//// This content is mainly copied from filebeat and adapted for apm-server -////////////////////////////////////////////////////////////////////////// - [[troubleshooting]] = Troubleshoot [partintro] -- -If you have issues installing or running APM Server, +If you have issues installing or running APM Server, read the following tips: * <> @@ -22,6 +18,18 @@ Other sections in the documentation may also be helpful: * <> * {apm-overview-ref-v}/agent-server-compatibility.html[Agent/Server compatibility matrix] +If your issue is potentially related to other components of the APM ecosystem, +don't forget to check the relevant troubleshooting guides: + +* {kibana-ref}/troubleshooting.html[APM app troubleshooting] +* {apm-dotnet-ref-v}/troubleshooting.html[.NET agent troubleshooting] +* {apm-go-ref-v}/troubleshooting.html[Go agent troubleshooting] +* {apm-java-ref-v}/trouble-shooting.html[Java agent troubleshooting] +* {apm-node-ref-v}/troubleshooting.html[Node.js agent troubleshooting] +* {apm-py-ref-v}/troubleshooting.html[Python agent troubleshooting] +* {apm-ruby-ref-v}/debugging.html[Ruby agent troubleshooting] +* {apm-rum-ref-v}/troubleshooting.html[RUM troubleshooting] + -- include::common-problems.asciidoc[] From ad5d27273989c6591d1b7306c77f6c0c70b55b3b Mon Sep 17 00:00:00 2001 From: Andrew Wilkins Date: Wed, 13 Jan 2021 11:39:22 +0800 Subject: [PATCH 2/2] beater: separate recording static/dynamic config (#4609) * beater: separate recording static/dynamic config Record the static/root config separately from apm-server config, the latter of which may be dynamic in the future (i.e. due to Fleet policy updates). --- beater/beater.go | 3 ++- beater/telemetry.go | 37 +++++++++++++++++++++++-------------- beater/telemetry_test.go | 3 ++- 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/beater/beater.go b/beater/beater.go index ab25c4aa6c3..4952cfa266e 100644 --- a/beater/beater.go +++ b/beater/beater.go @@ -153,9 +153,10 @@ func (bt *beater) Run(b *beat.Beat) error { } // send configs to telemetry - if err := recordConfigs(b.Info, bt.config, bt.rawConfig); err != nil { + if err := recordRootConfig(b.Info, bt.rawConfig); err != nil { bt.logger.Errorf("Error recording telemetry data", err) } + recordAPMServerConfig(bt.config) tracer, tracerServer, err := bt.initTracing(b) if err != nil { diff --git a/beater/telemetry.go b/beater/telemetry.go index 8d6bbdff7a2..710a0fa9138 100644 --- a/beater/telemetry.go +++ b/beater/telemetry.go @@ -70,20 +70,14 @@ var configMonitors = &configTelemetry{ tailSamplingPolicies: monitoring.NewInt(apmRegistry, "sampling.tail.policies"), } -func recordConfigs(info beat.Info, apmCfg *config.Config, rootCfg *common.Config) error { +// recordRootConfig records static properties of the given root config for telemetry. +// This should be called once at startup, with the root config. +func recordRootConfig(info beat.Info, rootCfg *common.Config) error { indexManagementCfg, err := idxmgmt.NewIndexManagementConfig(info, rootCfg) if err != nil { return err } - configMonitors.dataStreamsEnabled.Set(apmCfg.DataStreams.Enabled) - configMonitors.rumEnabled.Set(apmCfg.RumConfig.IsEnabled()) - configMonitors.apiKeysEnabled.Set(apmCfg.APIKeyConfig.IsEnabled()) - configMonitors.kibanaEnabled.Set(apmCfg.Kibana.Enabled) - configMonitors.jaegerHTTPEnabled.Set(apmCfg.JaegerConfig.HTTP.Enabled) - configMonitors.jaegerGRPCEnabled.Set(apmCfg.JaegerConfig.GRPC.Enabled) - configMonitors.sslEnabled.Set(apmCfg.TLS.IsEnabled()) - configMonitors.pipelinesEnabled.Set(apmCfg.Register.Ingest.Pipeline.IsEnabled()) - configMonitors.pipelinesOverwrite.Set(apmCfg.Register.Ingest.Pipeline.ShouldOverwrite()) + configMonitors.dataStreamsEnabled.Set(indexManagementCfg.DataStreams) configMonitors.setupTemplateEnabled.Set(indexManagementCfg.Template.Enabled) configMonitors.setupTemplateOverwrite.Set(indexManagementCfg.Template.Overwrite) configMonitors.setupTemplateAppendFields.Set(len(indexManagementCfg.Template.AppendFields.GetKeys()) > 0) @@ -92,11 +86,26 @@ func recordConfigs(info beat.Info, apmCfg *config.Config, rootCfg *common.Config configMonitors.ilmSetupRequirePolicy.Set(indexManagementCfg.ILM.Setup.RequirePolicy) mode := indexManagementCfg.ILM.Mode configMonitors.ilmEnabled.Set(mode == ilm.ModeAuto || mode == ilm.ModeEnabled) + return nil +} - tailSamplingEnabled := apmCfg.Sampling.Tail != nil && apmCfg.Sampling.Tail.Enabled - configMonitors.tailSamplingEnabled.Set(tailSamplingEnabled) +// recordAPMServerConfig records dynamic APM Server config properties for telemetry. +// This should be called once each time runServer is called. +func recordAPMServerConfig(cfg *config.Config) { + configMonitors.rumEnabled.Set(cfg.RumConfig.IsEnabled()) + configMonitors.apiKeysEnabled.Set(cfg.APIKeyConfig.IsEnabled()) + configMonitors.kibanaEnabled.Set(cfg.Kibana.Enabled) + configMonitors.jaegerHTTPEnabled.Set(cfg.JaegerConfig.HTTP.Enabled) + configMonitors.jaegerGRPCEnabled.Set(cfg.JaegerConfig.GRPC.Enabled) + configMonitors.sslEnabled.Set(cfg.TLS.IsEnabled()) + configMonitors.pipelinesEnabled.Set(cfg.Register.Ingest.Pipeline.IsEnabled()) + configMonitors.pipelinesOverwrite.Set(cfg.Register.Ingest.Pipeline.ShouldOverwrite()) + + tailSamplingEnabled := cfg.Sampling.Tail != nil && cfg.Sampling.Tail.Enabled + tailSamplingPolicies := 0 if tailSamplingEnabled { - configMonitors.tailSamplingPolicies.Set(int64(len(apmCfg.Sampling.Tail.Policies))) + tailSamplingPolicies = len(cfg.Sampling.Tail.Policies) } - return nil + configMonitors.tailSamplingEnabled.Set(tailSamplingEnabled) + configMonitors.tailSamplingPolicies.Set(int64(tailSamplingPolicies)) } diff --git a/beater/telemetry_test.go b/beater/telemetry_test.go index d134a9564bc..0604ac702fd 100644 --- a/beater/telemetry_test.go +++ b/beater/telemetry_test.go @@ -54,7 +54,8 @@ func TestRecordConfigs(t *testing.T) { }, }, }) - require.NoError(t, recordConfigs(info, apmCfg, rootCfg)) + require.NoError(t, recordRootConfig(info, rootCfg)) + recordAPMServerConfig(apmCfg) assert.Equal(t, configMonitors.ilmSetupEnabled.Get(), true) assert.Equal(t, configMonitors.rumEnabled.Get(), false)