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 flag to enable logsdb mode in logs data streams #1939

Merged
merged 3 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,8 @@ The following settings are available per profile:
an absolute path, out of the `.elastic-package` directory.
* `stack.kibana_http2_enabled` can be used to control if HTTP/2 should be used in versions of
kibana that support it. Defaults to true.
* `stack.logsdb_enabled` can be set to true to activate the feature flag in Elasticsearch that
enables logs index mode in all data streams that support it. Defaults to false.
* `stack.logstash_enabled` can be set to true to start Logstash and configure it as the
default output for tests using elastic-package. Supported only by the compose provider.
Defaults to false.
Expand Down
4 changes: 4 additions & 0 deletions internal/profile/_static/config.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
# Flag to enable apm-server in elastic-package stack profile config
# stack.apm_enabled: true

## Logs DB
# Flag to enable the logs index mode in logs data stream.
# stack.logsdb_enabled: true

## Enable logstash for testing
# Flag to enable logstash in elastic-package stack profile config
# stack.logstash_enabled: true
Expand Down
7 changes: 6 additions & 1 deletion internal/stack/_static/elasticsearch.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ xpack.security.http.ssl.certificate: "certs/cert.pem"

ingest.geoip.downloader.enabled: false

{{ $version := fact "elasticsearch_version" }}
{{- $version := fact "elasticsearch_version" -}}
jsoriano marked this conversation as resolved.
Show resolved Hide resolved
{{- $logsdb_enabled := fact "logsdb_enabled" -}}
{{ if (and (eq $logsdb_enabled "true") (not (semverLessThan $version "8.15.0-SNAPSHOT"))) }}
cluster.logsdb.enabled: true
{{- end -}}

{{ if semverLessThan $version "8.0.0" }}
script.max_compilations_rate: "use-context"
script.context.template.max_compilations_rate: "unlimited"
Expand Down
6 changes: 4 additions & 2 deletions internal/stack/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const (
configAPMEnabled = "stack.apm_enabled"
configGeoIPDir = "stack.geoip_dir"
configKibanaHTTP2Enabled = "stack.kibana_http2_enabled"
configLogsDBEnabled = "stack.logsdb_enabled"
configLogstashEnabled = "stack.logstash_enabled"
configSelfMonitorEnabled = "stack.self_monitor_enabled"
)
Expand Down Expand Up @@ -158,12 +159,13 @@ func applyResources(profile *profile.Profile, stackVersion string) error {
"username": elasticsearchUsername,
"password": elasticsearchPassword,

"agent_publish_ports": strings.Join(agentPorts, ","),
"apm_enabled": profile.Config(configAPMEnabled, "false"),
"geoip_dir": profile.Config(configGeoIPDir, "./ingest-geoip"),
"kibana_http2_enabled": profile.Config(configKibanaHTTP2Enabled, "true"),
"logsdb_enabled": profile.Config(configLogsDBEnabled, "false"),
"logstash_enabled": profile.Config(configLogstashEnabled, "false"),
"self_monitor_enabled": profile.Config(configSelfMonitorEnabled, "false"),
"agent_publish_ports": strings.Join(agentPorts, ","),
"kibana_http2_enabled": profile.Config(configKibanaHTTP2Enabled, "true"),
})

if err := os.MkdirAll(stackDir, 0755); err != nil {
Expand Down
2 changes: 2 additions & 0 deletions tools/readme/readme.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ The following settings are available per profile:
an absolute path, out of the `.elastic-package` directory.
* `stack.kibana_http2_enabled` can be used to control if HTTP/2 should be used in versions of
kibana that support it. Defaults to true.
* `stack.logsdb_enabled` can be set to true to activate the feature flag in Elasticsearch that
enables logs index mode in all data streams that support it. Defaults to false.
* `stack.logstash_enabled` can be set to true to start Logstash and configure it as the
default output for tests using elastic-package. Supported only by the compose provider.
Defaults to false.
Expand Down