Skip to content

Conversation

mrodm
Copy link
Contributor

@mrodm mrodm commented Sep 10, 2025

Relates #2835
Depends on elastic/kibana#233090
Depends on elastic/fleet-server#5469

Add support of system tests in input packages using otelcol input.

How to test this PR locally

Use the kibana code from elastic/kibana#233090. Enable the feature flag enableOtelIntegrations.

Using elastic-package to install the scenario (with these instructions: https://github.com/elastic/elastic-package/blob/main/docs/howto/use_existing_stack.md).

mage build:cover docker:customagentimage
export ELASTIC_AGENT_IMAGE_REF_OVERRIDE=<image tag generated in previous step>
export ELASTIC_PACKAGE_ELASTICSEARCH_PASSWORD=changeme
export ELASTIC_PACKAGE_ELASTICSEARCH_USERNAME=elastic
export ELASTIC_PACKAGE_KIBANA_HOST=http://localhost:5601
export ELASTIC_PACKAGE_ELASTICSEARCH_HOST=http://localhost:9200
elastic-package stack up -v -d --provider environment --version 9.2.0-SNAPSHOT

elastic-package -C test/packages/parallel/httpcheck test system -v

@mrodm
Copy link
Contributor Author

mrodm commented Sep 10, 2025

@jsoriano it looks like there is no "Index Template" created when these input packages using otelcol input are installed:
httpcheck no index template

As a reference, for instance sql_input input package creates this Index Template:
sql_input index template

This makes the system test fail with this error:

[0] failed to load mappings from index template preview (metrics-httpcheck.check.otel): error getting mapping: [400 Bad Request] {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"unable to simulate template [metrics-httpcheck.check.otel] that does not exist"}],"type":"illegal_argument_exception","reason":"unable to simulate template [metrics-httpcheck.check.otel] that does not exist"},"status":400}

This is used to get the mappings that were installed to compare them with those that are available after being ingested the documents.

@mrodm
Copy link
Contributor Author

mrodm commented Sep 10, 2025

Ok, it seems that it is pending as mentioned in elastic/kibana#232628

In addition they should contain @package and @custom templates included in current packages, so package developers and users can still customize mappings or pipelines.

Do you think there is going to be an Index Template installed for that as in the other packages?

Comment on lines -1065 to -1066
// Delete old data
logger.Debug("deleting old data in data stream...")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted. Outdated message.

@@ -1062,22 +1068,7 @@ func (r *tester) prepareScenario(ctx context.Context, config *testConfig, stackC
}
Copy link
Contributor Author

@mrodm mrodm Sep 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like that it does not need to update the datasets the Integration Policies created by elastic-package via:

ds := createPackageDatastream(*policyToTest, *r.pkgManifest, policyTemplate, *r.dataStreamManifest, *config, policyToTest.Namespace)

Comment on lines +1613 to +1617
if scenario.policyTemplateInput == otelCollectorInputName {
// Input packages whose input is `otelcol` must add the `.otel` suffix
// Example: httpcheck.metrics.otel
expectedDataset += "." + otelSuffixDataset
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documents ingested contain the dataset with suffix otel:

    "data_stream": {
      "dataset": "httpcheck.check.otel",
      "namespace": "83653",
      "type": "metrics"
    },

@elasticmachine
Copy link
Collaborator

elasticmachine commented Sep 12, 2025

💔 Build Failed

Failed CI Steps

History

cc @mrodm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants