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

[Metricbeat] support credentials_json in gcp module #29584

Merged
merged 5 commits into from
Jan 26, 2022

Conversation

endorama
Copy link
Member

@endorama endorama commented Dec 22, 2021

What does this PR do?

Adds support for credentials_json metricset configuration parameter to gcp.billing and gcp.metrics metricset.

Why is it important?

This change is required to support at metricset level this parameter that is already supported in Kibana Integration UI.

Filebeat gcp inputs support this parameter and due to the limitations in Kibana is not possible to use input level variables but globals are required. This PR fixes this in order to prevent having a configuration parameter in the UI that is not used by inputs.

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.

Author's Checklist

  • [ ]

How to test this PR locally

  1. Build x-pack/metricbeat
  2. Configure gcp module with:
  - module: gcp
    metricsets:
      - billing
    zone: "eu-"
    project_id: "..."
    credentials_json: '' # add your GCP SA JSON key content here
    exclude_labels: false
    dataset_id: "integration_testing_detached"
    table_pattern: "billing_export_test_data_detached"
    period: 24h

  1. Add your credentials in credentials_json
  2. Setup a BigQuery table with dummy data
  3. Run metricbeat and see collected data, it should work

Related issues

Use cases

Screenshots

Logs

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Dec 22, 2021
@mergify
Copy link
Contributor

mergify bot commented Dec 22, 2021

This pull request does not have a backport label. Could you fix it @endorama? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 7./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip Skip notification from the automated backport with mergify label Dec 22, 2021
@endorama endorama added backport-v8.0.0 Automated backport with mergify and removed backport-skip Skip notification from the automated backport with mergify labels Dec 22, 2021
@elasticmachine
Copy link
Collaborator

elasticmachine commented Dec 22, 2021

💚 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-01-25T16:43:43.561+0000

  • Duration: 76 min 12 sec

  • Commit: 6158887

Test stats 🧪

Test Results
Failed 0
Passed 2731
Skipped 240
Total 2971

💚 Flaky test report

Tests succeeded.

🤖 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!)

@endorama endorama changed the title [Metricbeat] support credentials_json in gcp.billing metricset [Metricbeat] support credentials_json in gcp module Dec 29, 2021
@endorama endorama self-assigned this Dec 29, 2021
@mtojek mtojek added the Team:Integrations Label for the Integrations team label Jan 24, 2022
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jan 24, 2022
@endorama endorama force-pushed the gcp/credentials_json-support branch from e688a00 to 6158887 Compare January 25, 2022 16:43
@endorama endorama marked this pull request as ready for review January 25, 2022 16:59
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations (Team:Integrations)

@endorama endorama added backport-v8.1.0 Automated backport with mergify and removed backport-v8.0.0 Automated backport with mergify backport-v8.1.0 Automated backport with mergify labels Jan 26, 2022
@endorama endorama merged commit 45cff00 into elastic:master Jan 26, 2022
@endorama endorama deleted the gcp/credentials_json-support branch January 26, 2022 10:24
yashtewari pushed a commit to build-security/beats that referenced this pull request Jan 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants