-
Notifications
You must be signed in to change notification settings - Fork 527
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
Send APM Server config to Kibana #5424
Send APM Server config to Kibana #5424
Conversation
I'm removing anything involving Question regarding the flattened format: Do we want to do any sort of lower camelcasing for the config values? Or just leave them with their default formatting, ie. {
"APIKeyConfig.Enabled": false,
"APIKeyConfig.LimitPerMin": 100,
"AgentConfigs": null,
"Aggregation.ServiceDestinations.Enabled": true,
"Aggregation.ServiceDestinations.Interval": 60000000000,
"Aggregation.ServiceDestinations.MaxGroups": 10000,
"Aggregation.Transactions.Enabled": true,
"Aggregation.Transactions.HDRHistogramSignificantFigures": 2,
"Aggregation.Transactions.Interval": 60000000000,
"Aggregation.Transactions.MaxTransactionGroups": 10000,
"AugmentEnabled": true,
"DataStreams.Enabled": false,
"DefaultServiceEnvironment": "",
"Expvar.Enabled": false,
"Expvar.URL": "/debug/vars",
"Host": "localhost:8200",
"Register.Ingest.Pipeline.Enabled": true,
"Register.Ingest.Pipeline.Overwrite": false,
"Register.Ingest.Pipeline.Path": "ingest/pipeline/definition.json",
"ResponseHeaders": null,
"RumConfig.AllowHeaders": [],
"RumConfig.AllowOrigins": [
"*"
],
"RumConfig.AllowServiceNames": null,
"RumConfig.Enabled": false,
"RumConfig.EventRate.Limit": 300,
"RumConfig.EventRate.LruSize": 1000,
"RumConfig.ExcludeFromGrouping": "^/webpack",
"RumConfig.LibraryPattern": "node_modules|bower_components|~",
"RumConfig.ResponseHeaders": null,
"RumConfig.SourceMapping.Cache.Expiration": 300000000000,
"RumConfig.SourceMapping.Enabled": true,
"RumConfig.SourceMapping.IndexPattern": "apm-*-sourcemap*",
"SelfInstrumentation.APIKey": "",
"SelfInstrumentation.Enabled": false,
"SelfInstrumentation.Environment": "",
"SelfInstrumentation.Hosts": null,
"SelfInstrumentation.Profiling.CPU.Duration": 10000000000,
"SelfInstrumentation.Profiling.CPU.Enabled": false,
"SelfInstrumentation.Profiling.CPU.Interval": 60000000000,
"SelfInstrumentation.Profiling.Heap.Enabled": false,
"SelfInstrumentation.Profiling.Heap.Interval": 60000000000,
"SelfInstrumentation.SecretToken": "",
"ShutdownTimeout": 5000000000,
"TLS": null,
"WriteTimeout": 30000000000
} |
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪 |
None of these can be set in ESS, but to be on the safe side I think it would be a good idea to remove:
@simitt will that work?
I think we should be sending the libbeat config input, rather than the apm-server config into which it is unmarshaled. The raw libbeat config is accessible in Line 135 in 7f55bc8
|
Following ssl related settings need to be synced:
Why is that? On the Kibana side we need to define a list of supported config options (hardcoded). |
A couple of reasons:
|
@axw good points; +1 |
indicates we're running in ece/ess
In the Kibana PR, I'm defining only the configs which map to input vars in the package policy: {
'apm-server.host': 'host',
'apm-server.secret_token': 'secret_token',
'apm-server.rum.enabled': 'enable_rum',
'apm-server.default_service_environment': 'default_service_environment',
'apm-server.rum.allow_service_names': 'rum_allow_service_names',
'apm-server.rum.allow_origins': 'rum_allow_origins',
'apm-server.rum.allow_headers': 'rum_allow_headers',
'apm-server.rum.event_rate.limit': 'rum_event_rate_limit',
'apm-server.rum.event_rate.lru_size': 'rum_event_rate_lru_size',
'apm-server.max_event_size': 'max_event_bytes',
'apm-server.capture_personal_data': 'capture_personal_data',
'apm-server.max_header_size': 'max_header_bytes',
'apm-server.idle_timeout': 'idle_timeout',
'apm-server.read_timeout': 'read_timeout',
'apm-server.shutdown_timeout': 'shutdown_timeout',
'apm-server.write_timeout': 'write_timeout',
'apm-server.max_connections': 'max_connections',
'apm-server.expvar.enabled': 'expvar_enabled',
'output.elasticsearch.ssl.enabled': 'tls_enabled',
'output.elasticsearch.ssl.certificate': 'tls_certificate',
'output.elasticsearch.ssl.key': 'tls_key',
'output.elasticsearch.ssl.supported_protocols': 'tls_supported_protocols',
'output.elasticsearch.ssl.cipher_suites': 'tls_cipher_suites',
'output.elasticsearch.ssl.curve_types': 'tls_curve_types',
} Anything that isn't included in this map will be displayed to the user as unsupported. |
@ogupte we've made a couple changes to the input vars but haven't pushed them to the package policy yet. There's one final change for 7.14 in #5410, and then we'll pushed an updated version. The config should look like the example you posted in your comment, ie. with the full path for each config. The example I posted above was from only marshalling the things nested under |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally looks good, left minor comments
// TODO: What sort of response will we get? | ||
if resp.StatusCode > http.StatusOK { | ||
return fmt.Errorf("bad response %s", resp.Status) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe cover the scenario where Kibana < 7.14
and therefore doesn't support the endpoint. (log and stop retrying)
protocol: "https" | ||
username: "elastic" | ||
password: "changeme" | ||
worker: 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instrumentation
and kibana
are not covered here; can you also cover some config option that doesn't start with apm-server
to check it is sent.
I just realized that the config options only contain the Since only apm-server options are supported as input vars in the apm integration, I guess that is fair, but we need to add some note to the APM migration UI that none of the other config options is ever supported. The config options are currently sent without the |
If we need to, I believe it is still possible to get the parent config: cast the |
This raw config only has apm-server values, but casting and then accessing the parent has the full paths for the received config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from a minor comment on the testcase, changes LGTM now.
This pull request is now in conflicts. Could you fix it @stuartnelson3? 🙏
|
(cherry picked from commit 1920f95) # Conflicts: # beater/beater.go # changelogs/head.asciidoc
Tested this on an ECE instance. |
(cherry picked from commit 1920f95) # Conflicts: # changelogs/head.asciidoc # kibana/send_config.go # kibana/send_config_test.go
Motivation/summary
Send a sanitized and flattened version of the apm-server config to kibana on
startup.
Closes #5377
Checklist
For functional changes, consider:
How to test these changes
Start up kibana, elasticsearch and apm-server. Verify that the apm-server
config is indexed in elasticsearch.
Related issues
Depends on elastic/kibana#100657