-
Notifications
You must be signed in to change notification settings - Fork 528
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* idxmgmt: create independent data streams Supporter Create a completely separate Supporter when data streams are enabled. If data streams are enabled, ensure that no setup (template, ILM, pipeline) related config is specified. * beater: enabling data streams disables pipeline If data streams are enabled, pipeline registration is disabled and attempting to setup pipelines will fail. No pipeline will be specified when indexing; the pipeline must be specified in the index template. Also, if the server is running managed (by Fleet), the server will fail to start unless data streams are enabled. * systemtest: add tests for data streams * idxmgmt: log warnings upon finding legacy config If legacy config is defined along with data streams config, log warnings rather than returning errors.
- v8.17.2
- v8.17.1
- v8.17.0
- v8.16.4
- v8.16.3
- v8.16.2
- v8.16.1
- v8.16.0
- v8.15.5
- v8.15.4
- v8.15.3
- v8.15.2
- v8.15.1
- v8.15.0
- v8.14.3
- v8.14.3+build202408141002
- v8.14.2
- v8.14.1
- v8.14.0
- v8.13.4
- v8.13.3
- v8.13.2
- v8.13.1
- v8.13.0
- v8.12.2
- v8.12.1
- v8.12.0
- v8.11.4
- v8.11.3
- v8.11.2
- v8.11.1
- v8.11.0
- v8.10.4
- v8.10.3
- v8.10.2
- v8.10.1
- v8.10.0
- v8.9.2
- v8.9.1
- v8.9.0
- v8.8.2
- v8.8.1
- v8.8.0
- v8.7.1
- v8.7.0
- v8.6.2
- v8.6.1
- v8.6.0
- v8.5.3
- v8.5.2
- v8.5.1
- v8.5.0
- v8.4.3
- v8.4.2
- v8.4.1
- v8.4.0
- v8.3.3
- v8.3.2
- v8.3.1
- v8.3.0
- v8.2.3
- v8.2.2
- v8.2.1
- v8.2.0
- v8.1.3
- v8.1.2
- v8.1.1
- v8.1.0
- v8.0.1
- v8.0.0
- v8.0.0-rc2
- v8.0.0-rc1
- v8.0.0-beta1
- v8.0.0-alpha2
- v8.0.0-alpha1
Showing
17 changed files
with
579 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Licensed to Elasticsearch B.V. under one or more contributor | ||
// license agreements. See the NOTICE file distributed with | ||
// this work for additional information regarding copyright | ||
// ownership. Elasticsearch B.V. licenses this file to you under | ||
// the Apache License, Version 2.0 (the "License"); you may | ||
// not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
package config | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/require" | ||
|
||
"github.com/elastic/beats/v7/libbeat/common" | ||
) | ||
|
||
func TestDataStreamsPipeline(t *testing.T) { | ||
cfg, err := NewConfig(common.MustNewConfigFrom(map[string]interface{}{"data_streams.enabled": true}), nil) | ||
require.NoError(t, err) | ||
assert.Equal(t, "", cfg.Pipeline) // enabling data streams disables use of the pipeline | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// Licensed to Elasticsearch B.V. under one or more contributor | ||
// license agreements. See the NOTICE file distributed with | ||
// this work for additional information regarding copyright | ||
// ownership. Elasticsearch B.V. licenses this file to you under | ||
// the Apache License, Version 2.0 (the "License"); you may | ||
// not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
package idxmgmt | ||
|
||
import ( | ||
"github.com/pkg/errors" | ||
|
||
"github.com/elastic/beats/v7/libbeat/common" | ||
"github.com/elastic/beats/v7/libbeat/common/fmtstr" | ||
"github.com/elastic/beats/v7/libbeat/idxmgmt" | ||
"github.com/elastic/beats/v7/libbeat/outputs" | ||
"github.com/elastic/beats/v7/libbeat/outputs/outil" | ||
|
||
"github.com/elastic/apm-server/datastreams" | ||
) | ||
|
||
type dataStreamsSupporter struct{} | ||
|
||
// BuildSelector returns an outputs.IndexSelector which routes events through | ||
// to data streams based on well-defined data_stream.* fields in events. | ||
func (dataStreamsSupporter) BuildSelector(*common.Config) (outputs.IndexSelector, error) { | ||
fmtstr, err := fmtstr.CompileEvent(datastreams.IndexFormat) | ||
if err != nil { | ||
return nil, err | ||
} | ||
expr, err := outil.FmtSelectorExpr(fmtstr, "", outil.SelectorLowerCase) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return outil.MakeSelector(expr), nil | ||
} | ||
|
||
// Enabled always returns false, indicating that this idxmgmt.Supporter does | ||
// not setting up templates or ILM policies. | ||
func (dataStreamsSupporter) Enabled() bool { | ||
return false | ||
} | ||
|
||
// Manager returns a no-op idxmgmt.Manager. | ||
func (dataStreamsSupporter) Manager(client idxmgmt.ClientHandler, assets idxmgmt.Asseter) idxmgmt.Manager { | ||
return dataStreamsManager{} | ||
} | ||
|
||
type dataStreamsManager struct{} | ||
|
||
// VerifySetup always returns true and an empty string, to avoid logging | ||
// duplicate warnings. | ||
func (dataStreamsManager) VerifySetup(template, ilm idxmgmt.LoadMode) (bool, string) { | ||
// Just return true to avoid logging warnings. We'll error out in Setup. | ||
return true, "" | ||
} | ||
|
||
// Setup will always return an error, in response to manual setup (i.e. `apm-server setup`). | ||
func (dataStreamsManager) Setup(template, ilm idxmgmt.LoadMode) error { | ||
return errors.New("index setup must be performed externally when using data streams, by installing the 'apm' integration package") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.