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

[O11y][Prometheus Input] Add system test cases #6490

Merged
merged 4 commits into from
Jul 5, 2023

Conversation

ali786XI
Copy link
Contributor

@ali786XI ali786XI commented Jun 6, 2023

  • Enhancement

What does this PR do?

  • This PR adds system test cases for the Prometheus Input package.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.

How to test this PR locally

  • Clone integrations repo.
  • Install elastic-package locally.
  • Start elastic stack using elastic-package.
  • Move to integrations/packages/prometheus_input directory.
  • Run the following command to run the system tests. elastic-package test system

Related issues

image

@ali786XI ali786XI added the Integration:prometheus_input Prometheus Input label Jun 6, 2023
@ali786XI ali786XI self-assigned this Jun 6, 2023
@ali786XI ali786XI requested a review from a team as a code owner June 6, 2023 13:35
@elasticmachine
Copy link

elasticmachine commented Jun 6, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-06-30T13:24:29.959+0000

  • Duration: 17 min 20 sec

Test stats 🧪

Test Results
Failed 0
Passed 2
Skipped 0
Total 2

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@@ -0,0 +1,4 @@
vars:
hosts:
- http://{{Hostname}}:{{Port}}
Copy link
Contributor

Choose a reason for hiding this comment

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

We are not collecting data of a specific service having a Prometheus end point here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ishleenk17 Do you mean like setting up any service such as WebSphere Application Server, IBM MQ, etc. and then collect the metrics using Prometheus?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's right.

@ishleenk17 ishleenk17 requested a review from a team June 30, 2023 12:25
"job": "prometheus",
"slice": "queue_time"
},
"prometheus_engine_query_duration_seconds_count": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why only two metrics show up the sample event? Does not prometheues :9090/metrics has many more metrics?

Copy link
Contributor

@ishleenk17 ishleenk17 Jun 30, 2023

Choose a reason for hiding this comment

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

@lalit-satapathy : That's why I have asked @aliabbas-elastic to have a service running and then run system test. Otherwise by default if we just bringup a Prometheus Input, we get these default metrics like job, labels only.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Assuming this runs the prom/prometheus image and loads the metrics from :9090/metrics which is fine IMO. I don't know why all other metrics are not showing up in sample event.

Example:
prometheus_target*_ metrics

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why only two metrics show up the sample event? Does not prometheues :9090/metrics has many more metrics?

Actually I am getting all the metrics but they are in different response. Prometheus logically groups the metrics under different labels and Prometheus Input ingests these groups in independent documents. But in sample_event.json only one document can be displayed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes looks like prometheus package is creating separate event for each of the Prometheus metric, looks like 1 metric per document.

Copy link
Contributor

Choose a reason for hiding this comment

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

@lalit-satapathy @aliabbas-elastic
I don't think it's 1 metric per document.
Please refer to the screenshot in this PR.
Here I have run Prometheus input for the Influxdb service.

Copy link
Collaborator

@lalit-satapathy lalit-satapathy Jun 30, 2023

Choose a reason for hiding this comment

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

strange, I saw single metric per document in my run.
Screenshot 2023-06-30 at 7 38 26 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Even in InfluxDB it sometimes gives single metric per document. So I think it is grouping that happens based on the quantile label provided go_gc_duration_seconds{quantile="0.75"} 0.000114446

image

Copy link
Contributor

Choose a reason for hiding this comment

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

So looks like grouping is happening by labels.
How about the metrics which don't have labels. How do those show up ?

Copy link
Contributor Author

@ali786XI ali786XI Jul 3, 2023

Choose a reason for hiding this comment

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

Those will be received in one single document under two labels prometheus.labels.instance and prometheus.labels.job. Please refer to the sample_event.json file.

@ali786XI ali786XI requested a review from ishleenk17 June 30, 2023 13:42
@lalit-satapathy
Copy link
Collaborator

Is there any risk in the linked docker image going away and breaking our tests in future? otherwise LGTM.

@ali786XI
Copy link
Contributor Author

ali786XI commented Jul 4, 2023

Is there any risk in the linked docker image going away and breaking our tests in future? otherwise LGTM.

No I don't think so there will be any risk as such as it an official image of the WebSphere Application Server.

@ali786XI ali786XI merged commit 8d26c84 into elastic:main Jul 5, 2023
@elasticmachine
Copy link

Package prometheus_input - 0.1.3 containing this change is available at https://epr.elastic.co/search?package=prometheus_input

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

Successfully merging this pull request may close these issues.

Add System Tests for Prometheus Input Package
5 participants