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

[GCP] Log ListTimeSeries and AggregatedList requests duration #40661

Merged
merged 10 commits into from
Sep 3, 2024

Conversation

gpop63
Copy link
Contributor

@gpop63 gpop63 commented Aug 29, 2024

Overview

Adds a debug log to show the total time taken for all ListTimeSeries and AggregatedList requests. This is useful to understand if it takes more than the period defined in config.

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.

Disruptive User Impact

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

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

botelastic bot commented Aug 29, 2024

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

@mergify mergify bot assigned gpop63 Aug 29, 2024
Copy link
Contributor

mergify bot commented Aug 29, 2024

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 add_gcp-metrics_timeseries_log upstream/add_gcp-metrics_timeseries_log
git merge upstream/main
git push upstream add_gcp-metrics_timeseries_log

Copy link
Contributor

mergify bot commented Aug 29, 2024

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @gpop63? 🙏.
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

@gpop63 gpop63 force-pushed the add_gcp-metrics_timeseries_log branch from f037090 to b91514f Compare August 29, 2024 20:19
@gpop63 gpop63 changed the title [GCP] Log ListTimeSeries requests duration [GCP] Log ListTimeSeries and AggregatedList requests duration Aug 29, 2024
@@ -124,6 +124,13 @@ func (r *metricsRequester) Metrics(ctx context.Context, serviceName string, alig
}
}

start := time.Now()
r.logger.Debug("started ListTimeSeries requests")
Copy link
Contributor

Choose a reason for hiding this comment

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

do we still need this debug log here?

@gpop63 gpop63 marked this pull request as ready for review August 30, 2024 08:18
@gpop63 gpop63 requested review from a team as code owners August 30, 2024 08:18
gpop63 and others added 2 commits September 3, 2024 13:00
Co-authored-by: subham sarkar <sarkar.subhams2@gmail.com>
Co-authored-by: subham sarkar <sarkar.subhams2@gmail.com>
Copy link
Contributor

@harnish-elastic harnish-elastic left a comment

Choose a reason for hiding this comment

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

Given minor comments otherwise LGTM!

gpop63 and others added 2 commits September 3, 2024 13:03
Co-authored-by: Harnish Chavda <118714680+harnish-elastic@users.noreply.github.com>
Co-authored-by: Harnish Chavda <118714680+harnish-elastic@users.noreply.github.com>
@gpop63 gpop63 merged commit 3f3e57d into elastic:main Sep 3, 2024
20 checks passed
@gpop63 gpop63 added the backport-8.15 Automated backport to the 8.15 branch with mergify label Sep 16, 2024
mergify bot pushed a commit that referenced this pull request Sep 16, 2024
…0661)

* log total time taken for ListTimeSeries requests

* add changelog entry

* fix PR id

* log total time taken for AggregatedList request

* update changelog entry

* remove log

* Update x-pack/metricbeat/module/gcp/metrics/compute/metadata.go

Co-authored-by: subham sarkar <sarkar.subhams2@gmail.com>

* Update x-pack/metricbeat/module/gcp/metrics/metrics_requester.go

Co-authored-by: subham sarkar <sarkar.subhams2@gmail.com>

* Update x-pack/metricbeat/module/gcp/metrics/compute/metadata.go

Co-authored-by: Harnish Chavda <118714680+harnish-elastic@users.noreply.github.com>

* Update x-pack/metricbeat/module/gcp/metrics/metrics_requester.go

Co-authored-by: Harnish Chavda <118714680+harnish-elastic@users.noreply.github.com>

---------

Co-authored-by: subham sarkar <sarkar.subhams2@gmail.com>
Co-authored-by: Harnish Chavda <118714680+harnish-elastic@users.noreply.github.com>
(cherry picked from commit 3f3e57d)
gpop63 added a commit that referenced this pull request Sep 17, 2024
…0661) (#40846)

* log total time taken for ListTimeSeries requests

* add changelog entry

* fix PR id

* log total time taken for AggregatedList request

* update changelog entry

* remove log

* Update x-pack/metricbeat/module/gcp/metrics/compute/metadata.go

Co-authored-by: subham sarkar <sarkar.subhams2@gmail.com>

* Update x-pack/metricbeat/module/gcp/metrics/metrics_requester.go

Co-authored-by: subham sarkar <sarkar.subhams2@gmail.com>

* Update x-pack/metricbeat/module/gcp/metrics/compute/metadata.go

Co-authored-by: Harnish Chavda <118714680+harnish-elastic@users.noreply.github.com>

* Update x-pack/metricbeat/module/gcp/metrics/metrics_requester.go

Co-authored-by: Harnish Chavda <118714680+harnish-elastic@users.noreply.github.com>

---------

Co-authored-by: subham sarkar <sarkar.subhams2@gmail.com>
Co-authored-by: Harnish Chavda <118714680+harnish-elastic@users.noreply.github.com>
(cherry picked from commit 3f3e57d)

Co-authored-by: Gabriel Pop <94497545+gpop63@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.15 Automated backport to the 8.15 branch 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.

[GCP] Improve logging and exception handling
6 participants