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

[Filebeat] Add /inputs/ route for Filebeat input metrics #33859

Merged
merged 5 commits into from
Dec 8, 2022

Conversation

andrewkroh
Copy link
Member

What does this PR do?

Expose metrics from Filebeat inputs under /inputs/. This moves metrics for aws-s3, aws-cloudwatch, cel, and lumberjack that were previously registered under the "dataset" monitoring namespace to the "inputs" namespace.

/inputs/ returns metrics related to input instances. It returns a list of objects where each object contains metrics for an instance of an input. Each object will minimally contain an input field that identifies the type of input (e.g. aws-s3) and an id field that is the unique identifier for the input instance.

A request may optionally specify a type query parameter to request metrics for a specific type of input. And pretty may be included to have the returned JSON be pretty formatted.

Why is it important?

This will establish a means of fetching input metrics. I plan to add a way to monitor this endpoint and create some dashboards.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Nov 29, 2022
@botelastic
Copy link

botelastic bot commented Nov 29, 2022

This pull request doesn't have a Team:<team> label.

@andrewkroh andrewkroh marked this pull request as ready for review November 29, 2022 03:28
@andrewkroh andrewkroh requested review from a team as code owners November 29, 2022 03:28
@andrewkroh andrewkroh requested review from cmacknz and fearful-symmetry and removed request for a team November 29, 2022 03:28
@mergify
Copy link
Contributor

mergify bot commented Nov 29, 2022

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @andrewkroh? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

@andrewkroh andrewkroh marked this pull request as draft November 29, 2022 03:49
@elasticmachine
Copy link
Collaborator

elasticmachine commented Nov 29, 2022

💚 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: 2022-12-06T17:16:29.626+0000

  • Duration: 181 min 49 sec

Test stats 🧪

Test Results
Failed 0
Passed 27592
Skipped 2127
Total 29719

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

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

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

Expose metrics from Filebeat inputs under /inputs/. This moves metrics for aws-s3, aws-cloudwatch,
cel, and lumberjack that were previously registered under the "dataset" monitoring namespace to the
"inputs" namespace.

`/inputs/` returns metrics related to input instances. It returns a list of
objects where each object contains metrics for an instance of an input. Each
object will minimally contain an `input` field that identifies the type of input
(e.g. `aws-s3`) and an `id` field that is the unique identifier for the input
instance.

A request may optionally specify a `type` query parameter to request metrics
for a specific type of input. And `pretty` may be included to have the
returned JSON be pretty formatted.
@andrewkroh andrewkroh marked this pull request as ready for review November 29, 2022 19:09
@mergify
Copy link
Contributor

mergify bot commented Dec 1, 2022

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b feature/filebeat/inputs-api upstream/feature/filebeat/inputs-api
git merge upstream/main
git push upstream feature/filebeat/inputs-api

Copy link
Contributor

@belimawr belimawr left a comment

Choose a reason for hiding this comment

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

LGTM, I added some small comments/suggestions.

The questions about parameter case and if we need to be that strict are my main concerns here.

libbeat/monitoring/inputmon/httphandler.go Outdated Show resolved Hide resolved
libbeat/monitoring/inputmon/httphandler.go Show resolved Hide resolved
libbeat/monitoring/inputmon/httphandler.go Outdated Show resolved Hide resolved
libbeat/monitoring/inputmon/httphandler_test.go Outdated Show resolved Hide resolved
libbeat/monitoring/inputmon/httphandler.go Outdated Show resolved Hide resolved
@sonarcloud
Copy link

sonarcloud bot commented Dec 6, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

No Coverage information No Coverage information
2.4% 2.4% Duplication

@andrewkroh andrewkroh merged commit 9249566 into elastic:main Dec 8, 2022
@andrewkroh andrewkroh added the backport-skip Skip notification from the automated backport with mergify label Dec 8, 2022
@@ -16,6 +16,8 @@ https:/elastic/beats/compare/v8.2.0\...main[Check the HEAD diff]

*Filebeat*

- Fixed error spam from `add_kubernetes_metadata` processor when running on AKS. {pull}33697[33697]
- Metrics hosted by the HTTP monitoring endpoint for the `aws-cloudwatch`, `aws-s3`, `cel`, and `lumberjack` inputs are now available under `/inputs/` instead of `/dataset`.
Copy link
Member

Choose a reason for hiding this comment

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

Is this a potential breaking change?

chrisberkhout pushed a commit that referenced this pull request Jun 1, 2023
Expose metrics from Filebeat inputs under /inputs/. This moves metrics for aws-s3, aws-cloudwatch,
cel, and lumberjack that were previously registered under the "dataset" monitoring namespace to the
"inputs" namespace.

`/inputs/` returns metrics related to input instances. It returns a list of
objects where each object contains metrics for an instance of an input. Each
object will minimally contain an `input` field that identifies the type of input
(e.g. `aws-s3`) and an `id` field that is the unique identifier for the input
instance.

A request may optionally specify a `type` query parameter to request metrics
for a specific type of input. And `pretty` may be included to have the
returned JSON be pretty formatted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-skip Skip notification from the automated backport with mergify needs_team Indicates that the issue/PR needs a Team:* label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants