Skip to content

Cloudflare receiver does not listen on any port specified in the endpoint #33222

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

Closed
devonhk opened this issue May 24, 2024 · 2 comments
Closed
Labels
bug Something isn't working needs triage New item requiring triage receiver/cloudflare

Comments

@devonhk
Copy link

devonhk commented May 24, 2024

Component(s)

receiver/cloudflare

What happened?

Description

I'm trying to create cloudflare log receiver to receive LogPush jobs. I'm using the otel K8s operator to deploy collectors.

Steps to Reproduce

  1. Create an otel collect (simplified example):
apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryCollector
metadata:
  name: cloudflare-waf-collector
spec:
  serviceAccount: agent
  mode: deployment
  envFrom:
    - secretRef:
        name: cloudflare-waf-collector
  config: |
    {{- tpl (.Files.Get "files/cloudflare-waf-config.yaml") . | nindent 4 }}
  1. Create a collector config file:
receivers:
  cloudflare:
    logs:
      endpoint: 0.0.0.0:8000
      secret: ${env:CF_SECRET}
exporters:
  debug:
    verbosity: detailed
  otlp:
    endpoint: "otel-agent-collector:4317"
service:
  telemetry:
    metrics:
      address: 0.0.0.0:8888
  pipelines:
    logs:
      receivers: [ cloudflare ]
      exporters: [ otlp ]

Expected Result

A pod is created with a collector listening on port 8000.

Actual Result

These are all the ports the collector was listening on:

[root@admin]# ss -tpln | grep otel
LISTEN 0      4096     10.5.23.115:8889       0.0.0.0:*    users:(("otelcol-contrib",pid=4469,fd=7)) 
LISTEN 0      4096               *:8888             *:*    users:(("otelcol-contrib",pid=4469,fd=3)) 
LISTEN 0      4096               *:8127             *:*    users:(("otelcol-contrib",pid=4469,fd=12))
LISTEN 0      4096               *:4317             *:*    users:(("otelcol-contrib",pid=4469,fd=15))
LISTEN 0      4096               *:4318             *:*    users:(("otelcol-contrib",pid=4469,fd=18))

The container logs don't say anything about the cloudflare receiver being initialized:

2024-05-24T17:28:28.324Z	info	[email protected]/service.go:102	Setting up own telemetry...
2024-05-24T17:28:28.324Z	info	[email protected]/telemetry.go:103	Serving metrics	{"address": "0.0.0.0:8888", "level": "Normal"}
2024-05-24T17:28:28.355Z	info	[email protected]/service.go:169	Starting otelcol-contrib...	{"Version": "0.101.0", "NumCPU": 16}
2024-05-24T17:28:28.355Z	info	extensions/extensions.go:34	Starting extensions...
2024-05-24T17:28:28.355Z	info	[email protected]/service.go:195	Everything is ready. Begin running and processing data.
2024-05-24T17:28:28.355Z	warn	localhostgate/featuregate.go:63	The default endpoints for all servers in components will change to use localhost instead of 0.0.0.0 in a future version. Use the feature gate to preview the new default.	{"feature gate ID": "component.UseLocalHostAsDefaultHost"}

Collector version

v0.101.0

Environment information

Environment

OS: image: otel/opentelemetry-collector-contrib:0.101.0

OpenTelemetry Collector configuration

receivers:
  cloudflare:
    logs:
      endpoint: 0.0.0.0:8000
      secret: ${env:CF_SECRET}
exporters:
  debug:
    verbosity: detailed
  otlp:
    endpoint: "otel-agent-collector:4317"
service:
  telemetry:
    metrics:
      address: 0.0.0.0:8888
  pipelines:
    logs:
      receivers: [ cloudflare ]
      exporters: [ otlp ]

Log output

2024-05-24T17:28:28.324Z	info	[email protected]/service.go:102	Setting up own telemetry...
2024-05-24T17:28:28.324Z	info	[email protected]/telemetry.go:103	Serving metrics	{"address": "0.0.0.0:8888", "level": "Normal"}
2024-05-24T17:28:28.355Z	info	[email protected]/service.go:169	Starting otelcol-contrib...	{"Version": "0.101.0", "NumCPU": 16}
2024-05-24T17:28:28.355Z	info	extensions/extensions.go:34	Starting extensions...
2024-05-24T17:28:28.355Z	info	[email protected]/service.go:195	Everything is ready. Begin running and processing data.
2024-05-24T17:28:28.355Z	warn	localhostgate/featuregate.go:63	The default endpoints for all servers in components will change to use localhost instead of 0.0.0.0 in a future version. Use the feature gate to preview the new default.	{"feature gate ID": "component.UseLocalHostAsDefaultHost"}

Additional context

No response

@devonhk devonhk added bug Something isn't working needs triage New item requiring triage labels May 24, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@devonhk
Copy link
Author

devonhk commented May 27, 2024

So it turns out the issue might be with the opentelemetry operator. I did some more testing and the cloudflare receiver correctly binds to the port defined in the endpoint. However the operator wasn't exposing the port in the Kubernetes Service it managed.
I'll open a bug in this project instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage New item requiring triage receiver/cloudflare
Projects
None yet
Development

No branches or pull requests

1 participant