-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[receiver/cloudflarereceiver] New Alpha Logs Component cloudflarereceiver #17993
[receiver/cloudflarereceiver] New Alpha Logs Component cloudflarereceiver #17993
Conversation
Foresight Summary
View More Details✅ tracegen workflow has finished in 5 minutes 19 seconds (
|
Job | Failed Steps | Tests | |
---|---|---|---|
build-dev | - 🔗 | N/A | See Details |
publish-latest | - 🔗 | N/A | See Details |
publish-stable | - 🔗 | N/A | See Details |
⭕ build-and-test-windows workflow has finished in 4 seconds (40 minutes 46 seconds less than main
branch avg.) and finished at 14th Feb, 2023.
Job | Failed Steps | Tests | |
---|---|---|---|
windows-unittest-matrix | - 🔗 | N/A | See Details |
windows-unittest | - 🔗 | N/A | See Details |
✅ telemetrygen workflow has finished in 54 seconds (2 minutes 12 seconds less than main
branch avg.) and finished at 14th Feb, 2023.
Job | Failed Steps | Tests | |
---|---|---|---|
build-dev | - 🔗 | N/A | See Details |
publish-latest | - 🔗 | N/A | See Details |
publish-stable | - 🔗 | N/A | See Details |
✅ check-links workflow has finished in 1 minute 28 seconds (1 minute 6 seconds less than main
branch avg.) and finished at 14th Feb, 2023.
Job | Failed Steps | Tests | |
---|---|---|---|
changed files | - 🔗 | N/A | See Details |
check-links | - 🔗 | N/A | See Details |
✅ changelog workflow has finished in 2 minutes 19 seconds (1 minute 24 seconds less than main
branch avg.) and finished at 14th Feb, 2023.
Job | Failed Steps | Tests | |
---|---|---|---|
changelog | - 🔗 | N/A | See Details |
✅ prometheus-compliance-tests workflow has finished in 14 minutes 28 seconds (⚠️ 5 minutes 39 seconds more than main
branch avg.) and finished at 14th Feb, 2023.
Job | Failed Steps | Tests | |
---|---|---|---|
prometheus-compliance-tests | - 🔗 | ✅ 21 ❌ 0 ⏭ 0 🔗 | See Details |
❌ build-and-test workflow has finished in 35 minutes 7 seconds (30 minutes 29 seconds less than main
branch avg.) and finished at 14th Feb, 2023. 4 jobs failed. There are 2 test failures.
Job | Failed Steps | Tests | |
---|---|---|---|
correctness-metrics | - 🔗 | ✅ 2 ❌ 0 ⏭ 0 🔗 | See Details |
correctness-traces | - 🔗 | ✅ 17 ❌ 0 ⏭ 0 🔗 | See Details |
unittest-matrix (1.18, internal) | - 🔗 | ✅ 561 ❌ 0 ⏭ 0 🔗 | See Details |
unittest-matrix (1.19, extension) | - 🔗 | ✅ 537 ❌ 0 ⏭ 0 🔗 | See Details |
unittest-matrix (1.18, processor) | - 🔗 | ✅ 1528 ❌ 0 ⏭ 0 🔗 | See Details |
unittest-matrix (1.19, processor) | - 🔗 | ✅ 1528 ❌ 0 ⏭ 0 🔗 | See Details |
unittest-matrix (1.19, internal) | - 🔗 | ✅ 561 ❌ 0 ⏭ 0 🔗 | See Details |
unittest-matrix (1.18, receiver-0) | - 🔗 | ✅ 2613 ❌ 0 ⏭ 0 🔗 | See Details |
unittest-matrix (1.18, exporter) | - 🔗 | ✅ 2455 ❌ 0 ⏭ 0 🔗 | See Details |
unittest-matrix (1.19, receiver-0) | - 🔗 | ✅ 2613 ❌ 0 ⏭ 0 🔗 | See Details |
unittest-matrix (1.19, receiver-1) | - 🔗 | ✅ 1928 ❌ 0 ⏭ 0 🔗 | See Details |
unittest-matrix (1.18, other) | Run Unit Tests 🔗 | ✅ 4613 ❌ 2 ⏭ 0 🔗 | See Details |
unittest-matrix (1.18, receiver-1) | - 🔗 | ✅ 1810 ❌ 0 ⏭ 0 🔗 | See Details |
unittest-matrix (1.19, exporter) | - 🔗 | ✅ 2110 ❌ 0 ⏭ 0 🔗 | See Details |
unittest-matrix (1.19, other) | - 🔗 | ✅ 4508 ❌ 0 ⏭ 0 🔗 | See Details |
integration-tests | - 🔗 | ✅ 55 ❌ 0 ⏭ 0 🔗 | See Details |
setup-environment | - 🔗 | N/A | See Details |
check-codeowners | - 🔗 | N/A | See Details |
lint-matrix (receiver-0) | - 🔗 | N/A | See Details |
lint-matrix (receiver-1) | - 🔗 | N/A | See Details |
lint-matrix (processor) | - 🔗 | N/A | See Details |
lint-matrix (exporter) | - 🔗 | N/A | See Details |
lint-matrix (extension) | - 🔗 | N/A | See Details |
lint-matrix (internal) | - 🔗 | N/A | See Details |
lint-matrix (other) | Lint 🔗 | N/A | See Details |
check-collector-module-version | - 🔗 | N/A | See Details |
build-examples | - 🔗 | N/A | See Details |
checks | - 🔗 | N/A | See Details |
unittest-matrix (1.18, extension) | - 🔗 | N/A | See Details |
unittest (1.19) | - 🔗 | N/A | See Details |
unittest (1.18) | Interpret result 🔗 | N/A | See Details |
lint | Interpret result 🔗 | N/A | See Details |
cross-compile | - 🔗 | N/A | See Details |
windows-msi | - 🔗 | N/A | See Details |
build-package | - 🔗 | N/A | See Details |
publish-check | - 🔗 | N/A | See Details |
publish-dev | - 🔗 | N/A | See Details |
publish-stable | - 🔗 | N/A | See Details |
✅ load-tests workflow has finished in 18 minutes 38 seconds and finished at 14th Feb, 2023.
Job | Failed Steps | Tests | |
---|---|---|---|
loadtest (TestIdleMode) | - 🔗 | ✅ 1 ❌ 0 ⏭ 0 🔗 | See Details |
loadtest (TestMetric10kDPS|TestMetricsFromFile) | - 🔗 | ✅ 6 ❌ 0 ⏭ 0 🔗 | See Details |
loadtest (TestTraceAttributesProcessor) | - 🔗 | ✅ 3 ❌ 0 ⏭ 0 🔗 | See Details |
loadtest (TestTraceNoBackend10kSPS|TestTrace1kSPSWithAttrs) | - 🔗 | ✅ 8 ❌ 0 ⏭ 0 🔗 | See Details |
loadtest (TestBallastMemory|TestLog10kDPS) | - 🔗 | ✅ 18 ❌ 0 ⏭ 0 🔗 | See Details |
loadtest (TestMetricResourceProcessor|TestTrace10kSPS) | - 🔗 | ✅ 12 ❌ 0 ⏭ 0 🔗 | See Details |
loadtest (TestTraceBallast1kSPSWithAttrs|TestTraceBallast1kSPSAddAttrs) | - 🔗 | ✅ 10 ❌ 0 ⏭ 0 🔗 | See Details |
setup-environment | - 🔗 | N/A | See Details |
✅ e2e-tests workflow has finished in 17 minutes 1 second and finished at 14th Feb, 2023.
Job | Failed Steps | Tests | |
---|---|---|---|
kubernetes-test | - 🔗 | N/A | See Details |
*You can configure Foresight comments in your organization settings page.
receiver/cloudflarereceiver/logs.go
Outdated
l.logger.Debug("starting to poll for Cloudflare logs") | ||
storageClient, err := adapter.GetStorageClient(ctx, host, l.storageID, l.id) | ||
if err != nil { | ||
l.logger.Error("failed to set up storage: %w", zap.Error(err)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this return the err and stop start instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getting storage client returns an error now on start
receiver/cloudflarereceiver/logs.go
Outdated
} | ||
|
||
func (l *logsReceiver) startPolling(ctx context.Context, _ component.Host) { | ||
l.logger.Debug("starting cloudflare receiver in retrieval mode") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l.logger.Debug("starting cloudflare receiver in retrieval mode") | |
l.logger.Debug("starting cloudflare receiver") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
74a193d
to
f14a393
Compare
3659753
to
3dcd8df
Compare
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
@@ -228,6 +229,7 @@ func Components() (otelcol.Factories, error) { | |||
bigipreceiver.NewFactory(), | |||
carbonreceiver.NewFactory(), | |||
chronyreceiver.NewFactory(), | |||
cloudflarereceiver.NewFactory(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should check out how to add your receiver now to this list, this has changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
case cfg.Auth.APIToken != "": | ||
api, err = cloudflare.NewWithAPIToken(cfg.Auth.APIToken) | ||
default: | ||
return nil, errInvalidAuthenticationConfigured |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this be done in cfg.Validate() ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, it is done in there - so you don't need to check that here anymore. cfg.Validate() is called before the component is created.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated, removed default case
|
||
// addRequiredFields adds fields EdgeEndTimestamp and EdgeResponseStatus which | ||
// are the logs timestamp and severity status value. | ||
func addRequiredFields(cfg *Config) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's a bit odd, and we try not to mutate config if possible. Any chance this can be done downstream in the receiver?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the feedback. I'll talk to my peers about it. We also just got the enterprise cloudflare environment up, so
I'll be able to verify a successful run soon.
} | ||
|
||
func putStringToMapNotNil(m pcommon.Map, k string, v *string) { | ||
if v != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have a test case testing when v is nil?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added TestAddNilValuesToMap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good - some nits but overall ready to accept. Please rebase too.
94c5c97
to
89eb6cc
Compare
…d fields when custom fields are supplied
89eb6cc
to
abd7499
Compare
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Closing this pr because LogPush described in this issue seems to be the best way moving forward. |
Description:
Adds a new
cloudflare
receiver that polls Cloudflare's LogPull Enterprise API.It uses Cloudflare Authentication headers in the form of a X-Auth-Email and X-Auth-Key combination or an API Token.
Link to tracking Issue: Resolves #17376
Testing:
Unit testing and mocked integration testing were performed.
Documentation: New README.md
Note: Waiting on a sandbox cloudflare env for final testing before exiting from draft pr.