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

Cherry-pick #18398 to 7.8: [Metricbeat] Remove checking region/zone and service name from googlecloud #18434

Merged
merged 2 commits into from
May 12, 2020
Merged

Conversation

kaiyan-sheng
Copy link
Contributor

@kaiyan-sheng kaiyan-sheng commented May 11, 2020

Cherry-pick of PR #18398 to 7.8 branch. Original message:

What does this PR do?

This PR is to remove validations for region/zone/service name in order for stackdriver metricset to work for wider services.

Why is it important?

service is only used to check when adding metadata and this is only available for compute metricset right now.

region/zone is not required for making ListTimeSeriesRequest API.

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.

How to test this PR locally

  1. Enable googlecloud in Metricbeat
    ./metricbeat modules enable googlecloud

  2. Modify modules.d/googlecloud.yml to use stackdriver metricset to collect logging metrics:

- module: googlecloud
  metricsets:
    - stackdriver
  project_id: elastic-observability
  credentials_file_path: "/Users/kaiyansheng/Downloads/elastic-observability-d17781618202.json"
  exclude_labels: false
  period: 1m
  stackdriver:
    service: billing
    metrics:
      - aligner: ALIGN_NONE
        metric_types:
          - "logging.googleapis.com/billing/bytes_ingested"
          - "logging.googleapis.com/byte_count"
  1. Start metricbeat:
./metricbeat -e
  1. You should see metrics in Kibana like:
    googlecloud.stackdriver.byte_count.value and googlecloud.stackdriver.billing.bytes_ingested.value

  2. Change modules.d/googlecloud.yml to collect compute metrics and also should work:

- module: googlecloud
  metricsets:
    - stackdriver
  project_id: "your project id"
  credentials_file_path: "your JSON credentials file path"
  exclude_labels: false
  period: 1m
  period: 1m
  stackdriver:
    service: compute
    metrics:
      - aligner: ALIGN_NONE
        metric_types:
          - "compute.googleapis.com/instance/cpu/reserved_cores"
          - "compute.googleapis.com/instance/cpu/usage_time"
          - "compute.googleapis.com/instance/cpu/utilization"
          - "compute.googleapis.com/instance/uptime"

Related issues

…cloud (#18398)

* remove validate region/zone

* add stackdriver into googlecloud default config

(cherry picked from commit 2d7c9d5)
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label May 11, 2020
@kaiyan-sheng kaiyan-sheng self-assigned this May 11, 2020
@kaiyan-sheng kaiyan-sheng added the Team:Platforms Label for the Integrations - Platforms team label May 11, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-platforms (Team:Platforms)

@elasticmachine
Copy link
Collaborator

elasticmachine commented May 12, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

Test stats 🧪

Test Results
Failed 0
Passed 2325
Skipped 560
Total 2885

Steps errors

Expand to view the steps failures

  • Name: Report to Codecov
    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Result: FAILURE

    • Duration: 2 min 22 sec

    • Start Time: 2020-05-12T14:28:48.341+0000

    • log

@andresrc andresrc removed the needs_team Indicates that the issue/PR needs a Team:* label label May 12, 2020
@kaiyan-sheng kaiyan-sheng merged commit 7ea3a92 into elastic:7.8 May 12, 2020
@kaiyan-sheng kaiyan-sheng deleted the backport_18398_7.8 branch May 12, 2020 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport review Team:Platforms Label for the Integrations - Platforms team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants