Skip to content

[Metricbeat] gcp: use ServiceMetrixPrefix in field extractor too#27286

Merged
endorama merged 3 commits intoelastic:masterfrom
endorama:endorama/gcp-service-metric-prefix-bug
Aug 13, 2021
Merged

[Metricbeat] gcp: use ServiceMetrixPrefix in field extractor too#27286
endorama merged 3 commits intoelastic:masterfrom
endorama:endorama/gcp-service-metric-prefix-bug

Conversation

@endorama
Copy link
Copy Markdown
Contributor

@endorama endorama commented Aug 9, 2021

What does this PR do?

Fixes a bug introduced with #26960

Why is it important?

#26960 was a partial implementation of the feature: it was missing a code change to use ServiceMetricPrefix in incomingFieldExtractor.

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

Run go test -v ./module/gcp/metrics/

Related issues

Use cases

Screenshots

Logs

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Aug 9, 2021
@endorama endorama added backport-v7.14.0 Automated backport with mergify backport-v7.15.0 Automated backport with mergify bug Team:Integrations Label for the Integrations team labels Aug 9, 2021
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Aug 9, 2021
@endorama endorama force-pushed the endorama/gcp-service-metric-prefix-bug branch from 56c8e13 to 2472cf4 Compare August 9, 2021 16:42
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Aug 9, 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: 2021-08-10T09:18:46.057+0000

  • Duration: 67 min 21 sec

  • Commit: 4f129d5

Test stats 🧪

Test Results
Failed 0
Passed 2649
Skipped 231
Total 2880

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 2649
Skipped 231
Total 2880

Prior to this commit `path.Join` was used to add the prefix to a metric,
thus adding the slash explicitly was not needed.

With to the addition of `RemovePrefixFrom()` I consider a better choice
to always normalize the prefix through the `prefix()` function.

Is worth considering that the prefix as written in the GCP doc contains
the final slash.
@endorama endorama marked this pull request as ready for review August 10, 2021 09:23
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/integrations (Team:Integrations)

@endorama endorama requested a review from kaiyan-sheng August 11, 2021 09:05
@endorama endorama changed the title gcp: use ServiceMetrixPrefix in field extractor too [Metricbeat] gcp: use ServiceMetrixPrefix in field extractor too Aug 11, 2021
Copy link
Copy Markdown
Contributor

@kaiyan-sheng kaiyan-sheng left a comment

Choose a reason for hiding this comment

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

LGTM!

@endorama endorama merged commit aa3a2b3 into elastic:master Aug 13, 2021
@endorama endorama deleted the endorama/gcp-service-metric-prefix-bug branch August 13, 2021 07:37
mergify bot pushed a commit that referenced this pull request Aug 13, 2021
endorama added a commit that referenced this pull request Aug 13, 2021
…ield extractor too (#27356)

(cherry picked from commit aa3a2b3)

Co-authored-by: endorama <526307+endorama@users.noreply.github.com>
endorama added a commit that referenced this pull request Aug 13, 2021
…field extractor too (#27357)

Co-authored-by: endorama <526307+endorama@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-v7.14.0 Automated backport with mergify backport-v7.15.0 Automated backport with mergify bug Team:Integrations Label for the Integrations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants