Skip to content

[GCP] Add gcp.metrics input package #4436

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

Merged
merged 11 commits into from
Dec 27, 2022

Conversation

gpop63
Copy link
Contributor

@gpop63 gpop63 commented Oct 10, 2022

What does this PR do?

Adds gcp.metrics 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.
  • I have verified that Kibana version constraints are current according to guidelines.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Screenshots

@gpop63 gpop63 added Team:Cloud-Monitoring Label for the Cloud Monitoring team Integration:gcp Google Cloud Platform labels Oct 10, 2022
@gpop63 gpop63 self-assigned this Oct 10, 2022
@elasticmachine
Copy link

elasticmachine commented Oct 10, 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-27T00:17:41.903+0000

  • Duration: 13 min 24 sec

🤖 GitHub comments

Expand to view the GitHub comments

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

  • /test : Re-trigger the build.

multi: false
required: false
show_user: true
- name: region
Copy link
Member

Choose a reason for hiding this comment

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

Make sure to add regions too as a setting

Copy link
Member

Choose a reason for hiding this comment

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

If this is a new input and we want to remove the region setting, consider not adding it 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.

@endorama since region will be deprecated in other gcp data streams, should it be deprecated in this package as well or removed entirely?

Copy link
Member

Choose a reason for hiding this comment

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

I think we can remove it entirely, as this is a new package.

@tetianakravchenko
Copy link
Contributor

Hi @gpop63!

Did you try to use this input package and deploy the elastic-agent that use policy with this input package?
Do you see dataset created with the name set as a Dataset name? Do you see data ingested?

I am trying to use input package as well, but for some reason I have an issue with dataset and data ingestion.

type: metrics
title: GCP Metrics
description: GCP Metrics.
input: gcp/metrics
Copy link
Contributor

Choose a reason for hiding this comment

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

why here is used /metrics in the input name? does it work this way?

for example: in https://github.com/elastic/package-spec repo we have an example of input package (sql input) https://github.com/elastic/package-spec/blob/main/test/packages/sql_input/manifest.yml#L20
and here is used input: sql

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've successfully managed to ingest data. However, I don't think the Dataset name is reflected. The input field should be the metricset from beats (I think). I've tried different inputs for this gcp package and somehow gcp/metrics works.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jsoriano could you help regarding the expected input here?

in sql example is used name of the module. Here used module_name/metricset.

Could you pleas clarify what is correct?

Copy link
Member

Choose a reason for hiding this comment

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

gcp/metrics sounds good, if you are trying to use the GCP module of Metricbeat. This input is also used on other packages, like here.

In general, for any input called <module>/metrics, Elastic Agent is going to use the <module> module of Metricbeat. These mappings are defined in Elastic Agent specs, specifically for these inputs in Metricbeat here.

in sql example is used name of the module. Here used module_name/metricset.

This is probably an error. Please take this example module with a grain of salt, this was used to test the package spec, but not actually used for real.

metric_types:
{{#each metrics}}
- "{{this}}"
{{/each}}
Copy link
Contributor

Choose a reason for hiding this comment

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

could you try to add

data_stream:
  dataset: {{data_stream.dataset}}

to see if dataset name will be respected in this case?

required: true
show_user: true
owner:
github: elastic/integrations
Copy link
Member

Choose a reason for hiding this comment

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

Please be more specific with the owner, should it be the cloud monitoring team here?

Suggested change
github: elastic/integrations
github: elastic/obs-cloud-monitoring

Copy link
Member

Choose a reason for hiding this comment

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

Should be elastic/obs-cloud-monitoring 👍

@botelastic
Copy link

botelastic bot commented Nov 25, 2022

Hi! We just realized that we haven't looked into this PR in a while. We're sorry! We're labeling this issue as Stale to make it hit our filters and make sure we get back to it as soon as possible. In the meantime, it'd be extremely helpful if you could take a look at it as well and confirm its relevance. A simple comment with a nice emoji will be enough :+1. Thank you for your contribution!

@botelastic botelastic bot added Stalled and removed Stalled labels Nov 25, 2022
@gpop63 gpop63 marked this pull request as ready for review December 15, 2022 15:13
@tommyers-elastic tommyers-elastic self-requested a review December 19, 2022 15:32
Copy link
Contributor

@tommyers-elastic tommyers-elastic left a comment

Choose a reason for hiding this comment

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

LGTM - do we have any user facing docs in the works to explain why this package has been created? perhaps we could put something in the README here? i'm assuming that once merged this will show up in the kibana UI, and could possibly cause confusion for customers.

@gpop63
Copy link
Contributor Author

gpop63 commented Dec 20, 2022

I added a package readme 5ad949c, not sure if it's descriptive enough. WDYT?

@endorama
Copy link
Member

@gpop63 I'll rework a bit the README to be more informative, and make clear this is still experimental (also should not show up in Kibana as version is <1.0.0)

@@ -0,0 +1,7 @@
# GCP Metrics Input
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# GCP Metrics Input
# GCP Custom Metrics

@@ -0,0 +1,7 @@
# GCP Metrics Input

The GCP metrics input package can collect metrics for any GCP service.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
The GCP metrics input package can collect metrics for any GCP service.
The GCP Custom Metrics input package can collect custom metrics for any GCP service.


A list of metrics and services that are available, can be found in the [GCP Cloud Monitoring API](https://cloud.google.com/monitoring/api/metrics_gcp) official documentation.

Custom ingest pipelines can be added through the Kibana UI, to get the data in the desired format.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Custom ingest pipelines can be added through the Kibana UI, to get the data in the desired format.
This package does not contain any ingest pipeline, so no pre-ingest data processing is applied out of the box. Custom ingest pipelines can be added through the Kibana UI, to get the data in the desired format.

@gpop63 gpop63 merged commit 9daefef into elastic:main Dec 27, 2022
@elasticmachine
Copy link

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

@andrewkroh andrewkroh added Integration:gcp_metrics GCP Metrics Input New Integration Issue or pull request for creating a new integration package. and removed Integration:gcp Google Cloud Platform labels Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Integration:gcp_metrics GCP Metrics Input New Integration Issue or pull request for creating a new integration package. Team:Cloud-Monitoring Label for the Cloud Monitoring team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[GCP] Migrate gcp.metrics beats metricset
7 participants