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
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -669,3 +669,14 @@ updates:
commit-message:
prefix: "deps"
include: "scope"
- package-ecosystem: "gomod"
directory: "/version"
schedule:
interval: "weekly"
ignore:
# Opentelemetry updates will be done manually
- dependency-name: "github.com/open-telemetry/opentelemetry-collector*"
- dependency-name: "go.opentelemetry.io/*"
commit-message:
prefix: "deps"
include: "scope"
6 changes: 3 additions & 3 deletions .goreleaser-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ builds:
- amd64
ldflags:
- -s -w
- -X github.com/observiq/bindplane-otel-collector/internal/version.version=v{{ .Version }}
- -X github.com/observiq/bindplane-otel-collector/internal/version.gitHash={{ .FullCommit }}
- -X github.com/observiq/bindplane-otel-collector/internal/version.date={{ .Date }}
- -X github.com/observiq/bindplane-otel-collector/version.version=v{{ .Version }}
- -X github.com/observiq/bindplane-otel-collector/version.gitHash={{ .FullCommit }}
- -X github.com/observiq/bindplane-otel-collector/version.date={{ .Date }}
no_unique_dist_dir: false
- id: updater
binary: updater
Expand Down
6 changes: 3 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ builds:
goarch: ppc64le
ldflags:
- -s -w
- -X github.com/observiq/bindplane-otel-collector/internal/version.version=v{{ .Version }}
- -X github.com/observiq/bindplane-otel-collector/internal/version.gitHash={{ .FullCommit }}
- -X github.com/observiq/bindplane-otel-collector/internal/version.date={{ .Date }}
- -X github.com/observiq/bindplane-otel-collector/version.version=v{{ .Version }}
- -X github.com/observiq/bindplane-otel-collector/version.gitHash={{ .FullCommit }}
- -X github.com/observiq/bindplane-otel-collector/version.date={{ .Date }}
no_unique_dist_dir: false
- id: updater
binary: updater
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ version:
# Builds just the agent for current GOOS/GOARCH pair
.PHONY: agent
agent:
go build -ldflags "-s -w -X github.com/observiq/bindplane-otel-collector/internal/version.version=$(VERSION)" -tags bindplane -o $(OUTDIR)/collector_$(GOOS)_$(GOARCH)$(EXT) ./cmd/collector
go build -ldflags "-s -w -X github.com/observiq/bindplane-otel-collector/version.version=$(VERSION)" -tags bindplane -o $(OUTDIR)/collector_$(GOOS)_$(GOARCH)$(EXT) ./cmd/collector

# Builds just the updater for current GOOS/GOARCH pair
.PHONY: updater
updater:
cd ./updater/; go build -ldflags "-s -w -X github.com/observiq/bindplane-otel-collector/internal/version.version=$(VERSION)" -o ../$(OUTDIR)/updater_$(GOOS)_$(GOARCH)$(EXT) ./cmd/updater
cd ./updater/; go build -ldflags "-s -w -X github.com/observiq/bindplane-otel-collector/version.version=$(VERSION)" -o ../$(OUTDIR)/updater_$(GOOS)_$(GOARCH)$(EXT) ./cmd/updater

# Builds the updater + agent for current GOOS/GOARCH pair
.PHONY: build-binaries
Expand Down
2 changes: 1 addition & 1 deletion cmd/collector/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (
"github.com/observiq/bindplane-otel-collector/collector"
"github.com/observiq/bindplane-otel-collector/internal/logging"
"github.com/observiq/bindplane-otel-collector/internal/service"
"github.com/observiq/bindplane-otel-collector/internal/version"
"github.com/observiq/bindplane-otel-collector/opamp"
"github.com/observiq/bindplane-otel-collector/version"
"github.com/spf13/pflag"
"go.uber.org/zap"
"gopkg.in/yaml.v3"
Expand Down
10 changes: 10 additions & 0 deletions exporter/googlecloudexporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,13 @@ When trace data is received by the Google Cloud Exporter, it is processed in the
## Metric Labels

Unlike the official Google Cloud Exporter, this extension transforms all resource attributes into metric labels by default. Users may still use the `resource_filters` field in the metric config to overwrite this behavior.

## OCB

This component relies on the `github.com/observiq/bindplane-otel-collector/version` package to get a version value. This version is used to construct a User-Agent header value.

When using this component with the OpenTelemetry Collector Builder (OCB), use the `--ldflags` CLI argument to set the version value at build time. For example:

```sh
builder --config "manifest.yaml" --ldflags "-s -w -X github.com/observiq/bindplane-otel-collector/version.version=v1.2.3"
```
14 changes: 7 additions & 7 deletions exporter/googlecloudexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"path/filepath"

"github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/collector"
"github.com/observiq/bindplane-otel-collector/version"
gcp "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlecloudexporter"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/processor/batchprocessor"
Expand Down Expand Up @@ -118,13 +119,12 @@ func (c *Config) updateProjectFromFile(fileName string) error {
}

// createDefaultConfig creates the default config for the exporter
func createDefaultConfig(collectorVersion string) func() component.Config {
return func() component.Config {
return &Config{
GCPConfig: createDefaultGCPConfig(collectorVersion),
BatchConfig: createDefaultBatchConfig(),
AppendHost: true,
}
func createDefaultConfig() component.Config {
collectorVersion := version.Version()
return &Config{
GCPConfig: createDefaultGCPConfig(collectorVersion),
BatchConfig: createDefaultBatchConfig(),
AppendHost: true,
}
}

Expand Down
5 changes: 3 additions & 2 deletions exporter/googlecloudexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ import (
"testing"

"github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/collector"
"github.com/observiq/bindplane-otel-collector/version"
"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlecloudexporter"
"github.com/stretchr/testify/require"
"google.golang.org/api/option"
)

func TestCreateDefaultConfig(t *testing.T) {
collectorVersion := "v1.2.3"
collectorVersion := version.Version()

cfg := createDefaultConfig(collectorVersion)()
cfg := createDefaultConfig()
googleCfg, ok := cfg.(*Config)
require.True(t, ok)

Expand Down
4 changes: 2 additions & 2 deletions exporter/googlecloudexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ const (
)

// NewFactory creates a factory for the googlecloud exporter
func NewFactory(collectorVersion string) exporter.Factory {
func NewFactory() exporter.Factory {
return exporter.NewFactory(
componentType,
createDefaultConfig(collectorVersion),
createDefaultConfig,
exporter.WithMetrics(createMetricsExporter, stability),
exporter.WithLogs(createLogsExporter, stability),
exporter.WithTraces(createTracesExporter, stability),
Expand Down
24 changes: 8 additions & 16 deletions exporter/googlecloudexporter/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ func TestCreateMetricExporterSuccess(t *testing.T) {
gcpFactory = gcp.NewFactory()
}()

collectorVersion := "v1.2.3"

factory := NewFactory(collectorVersion)
cfg := createDefaultConfig(collectorVersion)()
factory := NewFactory()
cfg := createDefaultConfig()
ctx := context.Background()
set := exportertest.NewNopSettings(typ)

Expand All @@ -70,10 +68,8 @@ func TestCreateLogsExporterSuccess(t *testing.T) {
gcpFactory = gcp.NewFactory()
}()

collectorVersion := "v1.2.3"

factory := NewFactory(collectorVersion)
cfg := createDefaultConfig(collectorVersion)()
factory := NewFactory()
cfg := createDefaultConfig()
ctx := context.Background()
set := exportertest.NewNopSettings(typ)

Expand All @@ -99,10 +95,8 @@ func TestCreateTracesExporterSuccess(t *testing.T) {
gcpFactory = gcp.NewFactory()
}()

collectorVersion := "v1.2.3"

factory := NewFactory(collectorVersion)
cfg := createDefaultConfig(collectorVersion)()
factory := NewFactory()
cfg := createDefaultConfig()
ctx := context.Background()
set := exportertest.NewNopSettings(typ)

Expand All @@ -123,10 +117,8 @@ func TestCreateExporterFailure(t *testing.T) {
gcpFactory = gcp.NewFactory()
}()

collectorVersion := "v1.2.3"

factory := NewFactory(collectorVersion)
cfg := createDefaultConfig(collectorVersion)()
factory := NewFactory()
cfg := createDefaultConfig()
ctx := context.Background()
set := exportertest.NewNopSettings(typ)

Expand Down
3 changes: 3 additions & 0 deletions exporter/googlecloudexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ go 1.24.11

require (
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/collector v0.55.0
github.com/observiq/bindplane-otel-collector/version v1.93.0
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlecloudexporter v0.145.0
github.com/stretchr/testify v1.11.1
go.opentelemetry.io/collector/component v1.51.0
Expand Down Expand Up @@ -106,3 +107,5 @@ require (
google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260203192932-546029d2fa20 // indirect
)

replace github.com/observiq/bindplane-otel-collector/version => ../../version
10 changes: 10 additions & 0 deletions exporter/googlemanagedprometheusexporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,13 @@ service:
processors: [resource, batch]
exporters: [googlemanagedprometheus]
```

## OCB

This component relies on the `github.com/observiq/bindplane-otel-collector/version` package to get a version value. This version is used to construct a User-Agent header value.

When using this component with the OpenTelemetry Collector Builder (OCB), use the `--ldflags` CLI argument to set the version value at build time. For example:

```sh
builder --config "manifest.yaml" --ldflags "-s -w -X github.com/observiq/bindplane-otel-collector/version.version=v1.2.3"
```
10 changes: 5 additions & 5 deletions exporter/googlemanagedprometheusexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"os"
"path/filepath"

"github.com/observiq/bindplane-otel-collector/version"
gmp "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlemanagedprometheusexporter"
"go.opentelemetry.io/collector/component"
"google.golang.org/api/option"
Expand Down Expand Up @@ -107,11 +108,10 @@ func (c *Config) updateProjectFromFile(fileName string) error {
}

// createDefaultConfig creates the default config for the exporter
func createDefaultConfig(collectorVersion string) func() component.Config {
return func() component.Config {
return &Config{
GMPConfig: createDefaultGCPConfig(collectorVersion),
}
func createDefaultConfig() component.Config {
collectorVersion := version.Version()
return &Config{
GMPConfig: createDefaultGCPConfig(collectorVersion),
}
}

Expand Down
5 changes: 3 additions & 2 deletions exporter/googlemanagedprometheusexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ import (
"fmt"
"testing"

"github.com/observiq/bindplane-otel-collector/version"
gmp "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlemanagedprometheusexporter"
"github.com/stretchr/testify/require"
"google.golang.org/api/option"
)

func TestCreateDefaultConfig(t *testing.T) {
collectorVersion := "v1.2.3"
collectorVersion := version.Version()

cfg := createDefaultConfig(collectorVersion)()
cfg := createDefaultConfig()
googleCfg, ok := cfg.(*Config)
require.True(t, ok)

Expand Down
4 changes: 2 additions & 2 deletions exporter/googlemanagedprometheusexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ const (
)

// NewFactory creates a factory for the googlecloud exporter
func NewFactory(collectorVersion string) exporter.Factory {
func NewFactory() exporter.Factory {
return exporter.NewFactory(
componentType,
createDefaultConfig(collectorVersion),
createDefaultConfig,
exporter.WithMetrics(createMetricsExporter, stability),
)
}
Expand Down
12 changes: 4 additions & 8 deletions exporter/googlemanagedprometheusexporter/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,8 @@ func TestCreateMetricExporterSuccess(t *testing.T) {
gmpFactory = gmp.NewFactory()
}()

collectorVersion := "v1.2.3"

factory := NewFactory(collectorVersion)
cfg := createDefaultConfig(collectorVersion)()
factory := NewFactory()
cfg := createDefaultConfig()
ctx := context.Background()
set := exportertest.NewNopSettings(typ)

Expand All @@ -68,10 +66,8 @@ func TestCreateExporterFailure(t *testing.T) {
gmpFactory = gmp.NewFactory()
}()

collectorVersion := "v1.2.3"

factory := NewFactory(collectorVersion)
cfg := createDefaultConfig(collectorVersion)()
factory := NewFactory()
cfg := createDefaultConfig()
ctx := context.Background()
set := exportertest.NewNopSettings(typ)

Expand Down
3 changes: 3 additions & 0 deletions exporter/googlemanagedprometheusexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/observiq/bindplane-otel-collector/exporter/googlemanagedpromet
go 1.24.11

require (
github.com/observiq/bindplane-otel-collector/version v1.93.0
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlemanagedprometheusexporter v0.145.0
github.com/stretchr/testify v1.11.1
go.opentelemetry.io/collector/component v1.51.0
Expand Down Expand Up @@ -145,3 +146,5 @@ require (
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect
)

replace github.com/observiq/bindplane-otel-collector/version => ../../version
10 changes: 10 additions & 0 deletions exporter/webhookexporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,13 @@ exporters:
cert_file: /path/to/cert.pem
key_file: /path/to/key.pem
```

## OCB

This component relies on the `github.com/observiq/bindplane-otel-collector/version` package to get a version value. This version is used to construct a User-Agent header value.

When using this component with the OpenTelemetry Collector Builder (OCB), use the `--ldflags` CLI argument to set the version value at build time. For example:

```sh
builder --config "manifest.yaml" --ldflags "-s -w -X github.com/observiq/bindplane-otel-collector/version.version=v1.2.3"
```
46 changes: 20 additions & 26 deletions exporter/webhookexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"time"

"github.com/observiq/bindplane-otel-collector/exporter/webhookexporter/internal/metadata"
"github.com/observiq/bindplane-otel-collector/version"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/confighttp"
"go.opentelemetry.io/collector/config/configopaque"
Expand All @@ -37,41 +38,34 @@ const (
defaultUserAgent = "bindplane-otel-collector"
)

// NewFactoryWithVersion creates a new Webhook exporter factory
func NewFactoryWithVersion(collectorVersion string) exporter.Factory {
// NewFactory creates a new Webhook exporter factory
func NewFactory() exporter.Factory {
return exporter.NewFactory(
metadata.Type,
createDefaultConfig(collectorVersion),
createDefaultConfig,
exporter.WithLogs(createLogsExporter, metadata.LogsStability),
)
}

// NewFactory creates a new Webhook exporter factory with default version for generated tests
func NewFactory() exporter.Factory {
return NewFactoryWithVersion("test-version")
}

func createDefaultConfig(collectorVersion string) func() component.Config {
userAgent := fmt.Sprintf("%s/%s", defaultUserAgent, collectorVersion)
return func() component.Config {
return &Config{
LogsConfig: &SignalConfig{
ClientConfig: confighttp.ClientConfig{
Endpoint: "https://localhost",
Timeout: 30 * time.Second,
Headers: configopaque.MapList{
{
Name: "User-Agent",
Value: configopaque.String(userAgent),
},
func createDefaultConfig() component.Config {
userAgent := fmt.Sprintf("%s/%s", defaultUserAgent, version.Version())
return &Config{
LogsConfig: &SignalConfig{
ClientConfig: confighttp.ClientConfig{
Endpoint: "https://localhost",
Timeout: 30 * time.Second,
Headers: configopaque.MapList{
{
Name: "User-Agent",
Value: configopaque.String(userAgent),
},
},
Verb: POST,
ContentType: "application/json",
QueueBatchConfig: configoptional.Some(exporterhelper.NewDefaultQueueConfig()),
BackOffConfig: configretry.NewDefaultBackOffConfig(),
},
}
Verb: POST,
ContentType: "application/json",
QueueBatchConfig: configoptional.Some(exporterhelper.NewDefaultQueueConfig()),
BackOffConfig: configretry.NewDefaultBackOffConfig(),
},
}
}

Expand Down
Loading