Skip to content

feat: add splunkhec receiver #3440

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

Open
wants to merge 39 commits into
base: main
Choose a base branch
from

Conversation

kalleep
Copy link
Contributor

@kalleep kalleep commented Apr 24, 2025

PR Description

This pr adds otelcol.receiver.splunkhec component. This is a wrapper for https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/splunkhecreceiver.

Currently this support all settings from upstream except ack. To support this we must also add support for AckExtention. We can wait with that until we see a need for it.

I did some manual testing that it works

otelcol.receiver.splunkhec "default" {
	output {
		logs = [otelcol.exporter.debug.default.input]
		metrics = [otelcol.exporter.debug.default.input]
	}	
}

otelcol.exporter.debug "default" {
	verbosity = "detailed"
}

Request to generate log:

curl http://localhost:8088/ -d '{"time": 1437522387, "source": "my_source", "sourcetype": "my_sample_data", "index": "my_index", "host": "my_host", "event": { "message": "some message", "severity": "Info" }}'

Request to generate metric:

curl http://localhost:8088/ -d '{"time": 1437522387, "source": "my_source", "sourcetype": "my_sample_data", "index": "my_index", "host": "my_host", "event": "metric", "fields": {"metric_name:single": 123 }]'

Which issue(s) this PR fixes

Fixes: #3080

Notes to the Reviewer

We had a lot of functions in different tests named getFreeAddr that did the same thing. I added this function to componenttests and reused it in every place I could find.

PR Checklist

  • CHANGELOG.md updated
  • Documentation added
  • Tests updated
  • Config converters updated

@kalleep kalleep requested review from clayton-cornell and a team as code owners April 24, 2025 14:10
Copy link
Contributor

github-actions bot commented Apr 24, 2025

@clayton-cornell clayton-cornell added the type/docs Docs Squad label across all Grafana Labs repos label Apr 24, 2025
@kalleep kalleep requested a review from a team April 25, 2025 07:24
@kalleep kalleep requested a review from a team April 25, 2025 15:03
@clayton-cornell
Copy link
Contributor

There's a few other doc-related comments not yet applied. Do we need to discuss the suggestions? Or are they pending a commit?

@clayton-cornell clayton-cornell requested a review from a team April 28, 2025 18:18
@kalleep
Copy link
Contributor Author

kalleep commented Apr 29, 2025

@clayton-cornell no they are fine, just missed them and have been busy getting fixing the ci

kalleep and others added 21 commits April 29, 2025 15:39
@kalleep kalleep force-pushed the kalleep/feat-otel-splunkhecreceiver branch from 45e3488 to 8d3048c Compare April 29, 2025 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/docs Docs Squad label across all Grafana Labs repos
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Splunk HEC Receiver from OTEL Collector Contrib to Alloy
2 participants