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

Test rerouting works for input packages (and normal integrations) that provide type: metrics #6337

Closed
gsantoro opened this issue May 26, 2023 · 4 comments
Assignees

Comments

@gsantoro
Copy link
Contributor

As a follow up of this comment and this issue, we would like to test if rerouting is enabled (it has the correct permissions) for a sample input package prometheus_input. No code changes should be required. Similar test has been done before for input packages with type: logs, so this is just to test that it behaves similarly for type: metrics data sets.

@gsantoro gsantoro self-assigned this May 26, 2023
@gsantoro
Copy link
Contributor Author

make sure the testing is done against Kubernetes from source since 8.9.0-SNAPSHOT today doesn't have the code changes made in fleet to support dynamic_dataset/namespace

@gsantoro
Copy link
Contributor Author

gsantoro commented Jun 21, 2023

I have done some testing with the following setup:

  1. Elastic-package to setup stack with 8.9.0-SNAPSHOT
  2. Stop kibana container and start Kibana from source
  3. Setup elastic-agent running in k8s with Fleet and connect with the elastic-package network
  4. setup a sample pod exporting prometheus-like metrics so that you can have an endpoint reachable by the prometheus integration
  5. add prometheus integration to the agent policy
  6. once everything is setup. you can check if there is an entry for metrics-*-* in one of the elastic-agent api keys.

@gsantoro
Copy link
Contributor Author

gsantoro commented Jun 21, 2023

I can confirm that metrics-*-* is correctly added to the permissions of the API for an agent with an input package for metrics. Here I have used the Prometheus input integration for testing.

Since this integration Prometheus Input is currently in Technical preview it can only be found when enabling Display beta integrations in Kibana in the list of integrations

@gsantoro gsantoro changed the title Test rerouting works for input packages that provide type: metrics Test rerouting works for input packages (and normal integrations) that provide type: metrics Jun 21, 2023
@gsantoro
Copy link
Contributor Author

i can also confirm that the same behaviour is valid for non input packages (aka normal integrations).

I temporarily created a 1.5.1 version of prometheus with the code changes in the manifest

# Ensures agents have permissions to write data to `logs-*-*`
elasticsearch.dynamic_dataset: true
elasticsearch.dynamic_namespace: true

for the datastream collector and then tested it similarly to prometheus_input input package. permissions are correctly added to the api keys

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

No branches or pull requests

1 participant