Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .chloggen/support_sending_via_hec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the component, or a single word describing the area of concern, (e.g. crosslink)
component: config

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Use a tarunner.yaml file as config file

# One or more tracking issues related to the change
issues: [72]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext: |
The tarunner.yaml file is expected to be located at the root of the TA folder.
The program now takes a single argument, the base folder path.

The tarunner.yaml file consists of 3 fields:
* `type`: the type of exporter to use. `otlp_http` will use the OTLP HTTP exporter (default value). Any other value is interpreted as sending over Splunk HEC.
* `endpoint`: the endpoint to which to send the data. `http://localhost:4318` is the default value.
* `token`: the token to set if sending over HEC.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,24 @@ This program exports all data over the OpenTelemetry Protocol (OTLP). It can be
* Download the binary from the [latest release](https://github.com/splunk/tarunner/releases)
* Run the binary with the following arguments:

`> tarunner <basedir> <otlp-endpoint>`
`> tarunner <basedir>`

`basedir`: the location of the technical addon, uncompressed.

`otlp-endpoint`: the OTLP gRPC endpoint to target with the runner. Example: `http://localhost:4317`
The tarunner expects a tarunner.yaml file located at the root of the TA folder.

The tarunner.yaml file consists of 3 fields:
* `type`: the type of exporter to use. `otlp_http` will use the OTLP HTTP exporter (default value). Any other value is interpreted as sending over Splunk HEC.
* `endpoint`: the endpoint to which to send the data. `http://localhost:4318` is the default value.
* `token`: the token to set if sending over HEC.

## Using Docker

Build the Docker image:
* `> docker build -t tarunner .`

Run the image:
* `> docker run --rm -v $(pwd)/ta:/ta /ta http://endpoint:4317`
* `> docker run --rm -v $(pwd)/ta:/ta /ta`

See also under the `integration` folder a `docker-compose.yml` example.

Expand Down
18 changes: 14 additions & 4 deletions cmd/tarunner/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,29 @@ import (
"log"
"os"
"os/signal"
"path/filepath"
"syscall"

"github.com/splunk/tarunner/internal/config"

"github.com/splunk/tarunner/internal/collector"
)

func main() {
if len(os.Args) < 3 {
log.Fatalf("usage: %s <basedir> <otlp-endpoint>", os.Args[0])
if len(os.Args) < 2 {
log.Fatalf("usage: %s <basedir>", os.Args[0])
}
basedir := os.Args[1]
otlpEndpoint := os.Args[2]
configFile := filepath.Join(basedir, "tarunner.yaml")
if _, err := os.Stat(configFile); os.IsNotExist(err) {
log.Fatalf("config file %q does not exist", configFile)
}
cfg, err := config.LoadConfig(configFile)
if err != nil {
log.Fatalf("failed to load config: %v", err)
}

shutdownFunc, err := collector.Run(basedir, otlpEndpoint)
shutdownFunc, err := collector.Run(basedir, cfg)
if err != nil {
log.Fatal(err)
}
Expand Down
14 changes: 11 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ module github.com/splunk/tarunner
go 1.25.7

require (
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/splunkhecexporter v0.149.0
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.149.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/splunkhecreceiver v0.149.0
go.opentelemetry.io/collector/component v1.55.0
go.opentelemetry.io/collector/component/componenttest v0.149.0
go.opentelemetry.io/collector/config/configopaque v1.55.0
go.opentelemetry.io/collector/confmap v1.55.0
go.opentelemetry.io/collector/consumer v1.55.0
go.opentelemetry.io/collector/consumer/consumertest v0.149.0
go.opentelemetry.io/collector/exporter v1.55.0
Expand All @@ -18,6 +22,7 @@ require (
go.opentelemetry.io/otel/trace v1.42.0
go.uber.org/goleak v1.3.0
go.uber.org/zap v1.27.1
go.yaml.in/yaml/v3 v3.0.4
gopkg.in/ini.v1 v1.67.1
)

Expand All @@ -39,6 +44,7 @@ require (
github.com/golang/snappy v1.0.0 // indirect
github.com/google/go-tpm v0.9.9-0.20260124013517-8f8f42cba0de // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/hashicorp/go-version v1.8.0 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/jonboulle/clockwork v0.5.0 // indirect
Expand All @@ -56,7 +62,12 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
github.com/mostynb/go-grpc-compression v1.2.3 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/extension/ackextension v0.149.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.149.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.149.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk v0.149.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchperresourceattr v0.149.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/splunk v0.149.0 // indirect
github.com/pierrec/lz4/v4 v4.1.26 // indirect
github.com/rs/cors v1.11.1 // indirect
github.com/stretchr/objx v0.5.3 // indirect
Expand All @@ -71,11 +82,9 @@ require (
go.opentelemetry.io/collector/config/confighttp v0.149.0 // indirect
go.opentelemetry.io/collector/config/configmiddleware v1.55.0 // indirect
go.opentelemetry.io/collector/config/confignet v1.55.0 // indirect
go.opentelemetry.io/collector/config/configopaque v1.55.0 // indirect
go.opentelemetry.io/collector/config/configoptional v1.55.0 // indirect
go.opentelemetry.io/collector/config/configretry v1.55.0 // indirect
go.opentelemetry.io/collector/config/configtls v1.55.0 // indirect
go.opentelemetry.io/collector/confmap v1.55.0 // indirect
go.opentelemetry.io/collector/confmap/xconfmap v0.149.0 // indirect
go.opentelemetry.io/collector/consumer/consumererror v0.149.0 // indirect
go.opentelemetry.io/collector/consumer/consumererror/xconsumererror v0.149.0 // indirect
Expand All @@ -102,7 +111,6 @@ require (
go.opentelemetry.io/otel v1.42.0 // indirect
go.opentelemetry.io/otel/sdk v1.42.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.42.0 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/crypto v0.49.0 // indirect
golang.org/x/net v0.52.0 // indirect
golang.org/x/sys v0.42.0 // indirect
Expand Down
Loading
Loading