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

Promtail: Add handler timeout for GCP Logs Push target #7401

Merged
merged 7 commits into from
Oct 14, 2022

Conversation

thepalbi
Copy link
Contributor

@thepalbi thepalbi commented Oct 12, 2022

What this PR does / why we need it:
After been running the GCP Logs Push target in actual workloads, we've noticed that GCP sends a lot of traffic, and adjusts that send rate according to the rate at which the receiver can process. To perform that adjustment, GCP considers as a NACK non 2xx HTTP responses.

This PR adds a target handler timeout (that includes as well the api.Entry channel send) to allow the user to configure this maximum processing time, therefore giving GCP notice that the sending rate is too high.

This new timeout is optional, and disabled by default.

Which issue(s) this PR fixes:
Related to https://github.com/grafana/cloud-onboarding/issues/2067

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide
  • Documentation added
  • Tests updated
  • CHANGELOG.md updated
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/upgrading/_index.md

@grafanabot
Copy link
Collaborator

./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki

Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell.

+           ingester	0%
+        distributor	0.2%
+            querier	0%
- querier/queryrange	-0.1%
+               iter	0%
+            storage	0%
+           chunkenc	0%
+              logql	0%
+               loki	0%

@pull-request-size pull-request-size bot added size/L and removed size/M labels Oct 12, 2022
@github-actions github-actions bot added the type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories label Oct 12, 2022
@thepalbi thepalbi changed the title Pablo/add gcp push timeout Promtail: Add handler timeout for GCP Logs Push target Oct 12, 2022
@thepalbi thepalbi marked this pull request as ready for review October 12, 2022 18:32
@thepalbi thepalbi requested a review from a team as a code owner October 12, 2022 18:32
@grafanabot
Copy link
Collaborator

./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki

Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell.

+           ingester	0%
+        distributor	0%
+            querier	0%
- querier/queryrange	-0.1%
+               iter	0%
+            storage	0%
+           chunkenc	0%
+              logql	0%
+               loki	0%

@grafanabot
Copy link
Collaborator

./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki

Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell.

+           ingester	0%
+        distributor	0%
+            querier	0%
+ querier/queryrange	0%
+               iter	0%
+            storage	0%
+           chunkenc	0%
+              logql	0%
+               loki	0.6%

@grafanabot
Copy link
Collaborator

./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki

Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell.

+           ingester	0%
+        distributor	0%
+            querier	0%
+ querier/queryrange	0.1%
+               iter	0%
+            storage	0%
+           chunkenc	0%
+              logql	0%
+               loki	0%

Copy link
Contributor

@kavirajk kavirajk left a comment

Choose a reason for hiding this comment

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

Looks overall good. thanks @thepalbi Left few minor comments.

clients/pkg/promtail/targets/gcplog/push_target.go Outdated Show resolved Hide resolved
clients/pkg/promtail/targets/gcplog/push_target.go Outdated Show resolved Hide resolved
@grafanabot
Copy link
Collaborator

./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki

Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell.

+           ingester	0%
+        distributor	0%
+            querier	0%
+ querier/queryrange	0%
+               iter	0%
+            storage	0%
+           chunkenc	0%
+              logql	0%
+               loki	0%

Copy link
Contributor

@kavirajk kavirajk left a comment

Choose a reason for hiding this comment

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

LGTM. thanks @thepalbi

@kavirajk kavirajk merged commit e73584a into main Oct 14, 2022
@kavirajk kavirajk deleted the pablo/add-gcp-push-timeout branch October 14, 2022 05:19
lxwzy pushed a commit to lxwzy/loki that referenced this pull request Nov 7, 2022
**What this PR does / why we need it**:
After been running the GCP Logs Push target in actual workloads, we've
noticed that GCP sends a lot of traffic, and adjusts that send rate
according to the rate at which the receiver can process. To perform that
adjustment, GCP considers as a NACK [non 2xx HTTP
responses](https://cloud.google.com/pubsub/docs/push#receive_push).

This PR adds a target handler timeout (that includes as well the
`api.Entry` channel send) to allow the user to configure this maximum
processing time, therefore giving GCP notice that the sending rate is
too high.

This new timeout is optional, and disabled by default.

**Which issue(s) this PR fixes**:
Related to https://github.com/grafana/cloud-onboarding/issues/2067

**Special notes for your reviewer**:

**Checklist**
- [ ] Reviewed the `CONTRIBUTING.md` guide
- [x] Documentation added
- [x] Tests updated
- [x] `CHANGELOG.md` updated
- [x] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/upgrading/_index.md`
changhyuni pushed a commit to changhyuni/loki that referenced this pull request Nov 8, 2022
**What this PR does / why we need it**:
After been running the GCP Logs Push target in actual workloads, we've
noticed that GCP sends a lot of traffic, and adjusts that send rate
according to the rate at which the receiver can process. To perform that
adjustment, GCP considers as a NACK [non 2xx HTTP
responses](https://cloud.google.com/pubsub/docs/push#receive_push).

This PR adds a target handler timeout (that includes as well the
`api.Entry` channel send) to allow the user to configure this maximum
processing time, therefore giving GCP notice that the sending rate is
too high.

This new timeout is optional, and disabled by default.

**Which issue(s) this PR fixes**:
Related to https://github.com/grafana/cloud-onboarding/issues/2067

**Special notes for your reviewer**:

**Checklist**
- [ ] Reviewed the `CONTRIBUTING.md` guide
- [x] Documentation added
- [x] Tests updated
- [x] `CHANGELOG.md` updated
- [x] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/upgrading/_index.md`
Abuelodelanada pushed a commit to canonical/loki that referenced this pull request Dec 1, 2022
**What this PR does / why we need it**:
After been running the GCP Logs Push target in actual workloads, we've
noticed that GCP sends a lot of traffic, and adjusts that send rate
according to the rate at which the receiver can process. To perform that
adjustment, GCP considers as a NACK [non 2xx HTTP
responses](https://cloud.google.com/pubsub/docs/push#receive_push).

This PR adds a target handler timeout (that includes as well the
`api.Entry` channel send) to allow the user to configure this maximum
processing time, therefore giving GCP notice that the sending rate is
too high.

This new timeout is optional, and disabled by default.

**Which issue(s) this PR fixes**:
Related to https://github.com/grafana/cloud-onboarding/issues/2067

**Special notes for your reviewer**:

**Checklist**
- [ ] Reviewed the `CONTRIBUTING.md` guide
- [x] Documentation added
- [x] Tests updated
- [x] `CHANGELOG.md` updated
- [x] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/upgrading/_index.md`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants