Skip to content
Open
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
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ go 1.26.0

godebug x509negativeserial=1

replace github.com/influxdata/influxdb-observability/influx2otel => github.com/mchrome/influxdb-observability/influx2otel v0.0.0-20260819083430-6ad72fb9f7e8

require (
cloud.google.com/go/auth v0.23.1
cloud.google.com/go/bigquery v1.80.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1694,8 +1694,6 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/influxdata/influxdb-observability/common v0.5.12 h1:4YwZ+vsodz6VfoiX+ZqVotmnyCa9vCCPksSBK/WLjBs=
github.com/influxdata/influxdb-observability/common v0.5.12/go.mod h1:u+CABnGO/F1IK51pDlZQroh4+igJNo695XrbLGDBhVc=
github.com/influxdata/influxdb-observability/influx2otel v0.5.12 h1:u0lNE3+63rILk4mtmCYsNyczH/1wEXnM+1aBzBe5akk=
github.com/influxdata/influxdb-observability/influx2otel v0.5.12/go.mod h1:bM407XIJYnrJYJ9Q3q2ytDSOyFhiYmGm0Sz1Qf48RPk=
github.com/influxdata/influxdb-observability/otel2influx v0.5.12 h1:t9gmVOOHbZyEAvIYSoO97Tde1KArVtiYdM0/0Dhmuio=
github.com/influxdata/influxdb-observability/otel2influx v0.5.12/go.mod h1:YGsb8xYfjHvcr2y0+Nj7kOHMTw7fWDbAA4g/qJKkvaU=
github.com/influxdata/line-protocol-corpus v0.0.0-20210519164801-ca6fa5da0184/go.mod h1:03nmhxzZ7Xk2pdG+lmMd7mHDfeVOYFyhOgwO61qWU98=
Expand Down Expand Up @@ -1901,6 +1899,8 @@ github.com/mattn/go-runewidth v0.0.24 h1:cpokDiIn0MGnhdHwuWnJBITySJ20QyNGnY2kR/a
github.com/mattn/go-runewidth v0.0.24/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs=
github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/mchrome/influxdb-observability/influx2otel v0.0.0-20260819083430-6ad72fb9f7e8 h1:JdtBnUdaofSXdMth3CTg0UOL5YTX7W+r/gFPSD2/K2w=
github.com/mchrome/influxdb-observability/influx2otel v0.0.0-20260819083430-6ad72fb9f7e8/go.mod h1:YgNF+ESSKXizCNRvkIAFMS8rWaP8t/86GLuycJ7vOTw=
github.com/mdlayher/apcupsd v0.0.0-20220319200143-473c7b5f3c6a h1:JOlLsLUQnokTyWWwEvOVoKH3XUl6oDMP8jisO54l6J8=
github.com/mdlayher/apcupsd v0.0.0-20220319200143-473c7b5f3c6a/go.mod h1:960H6oqSawdujauTeLX9BOx+ZdYX0TdG9xE9br5bino=
github.com/mdlayher/ethtool v0.0.0-20210210192532-2b88debcdd43/go.mod h1:+t7E0lkKfbBsebllff1xdTmyJt8lH37niI6kwFk9OTo=
Expand Down
3 changes: 3 additions & 0 deletions plugins/outputs/opentelemetry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ plugin ordering. See [CONFIGURATION.md][CONFIGURATION.md] for more details.
## Supports: "gzip", "none"
# compression = "gzip"

## Characters for separating LineProtocol's metric name and field when converting to OpenTelemetry's metric name
# name_separator = "_"

## Optional proxy settings for HTTP endpoints (service_address starts with http:// or https://)
# use_system_proxy = false
# http_proxy_url = ""
Expand Down
21 changes: 14 additions & 7 deletions plugins/outputs/opentelemetry/opentelemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ type OpenTelemetry struct {
EncodingType string `toml:"encoding_type"`

tls.ClientConfig
Timeout config.Duration `toml:"timeout"`
Compression string `toml:"compression"`
Token config.Secret `toml:"token"`
Headers map[string]string `toml:"headers"`
Attributes map[string]string `toml:"attributes"`
Coralogix *CoralogixConfig `toml:"coralogix"`
Timeout config.Duration `toml:"timeout"`
Compression string `toml:"compression"`
NameSeparator string `toml:"name_separator"`
Token config.Secret `toml:"token"`
Headers map[string]string `toml:"headers"`
Attributes map[string]string `toml:"attributes"`
Coralogix *CoralogixConfig `toml:"coralogix"`
proxy.HTTPProxy
proxy.TCPProxy

Expand Down Expand Up @@ -96,6 +97,9 @@ func (o *OpenTelemetry) Connect() error {
if o.Compression == "" {
o.Compression = defaultCompression
}
if o.NameSeparator == "" {
o.NameSeparator = defaultNameSeparator
}
if o.Coralogix != nil {
if o.Headers == nil {
o.Headers = make(map[string]string)
Expand All @@ -105,7 +109,8 @@ func (o *OpenTelemetry) Connect() error {
o.Headers["Authorization"] = "Bearer " + o.Coralogix.PrivateKey
}

metricsConverter, err := influx2otel.NewLineProtocolToOtelMetrics(logger)
converterConfig := &influx2otel.LineProtocolToOtelMetricsConfig{Logger: logger, NameSeparator: o.NameSeparator}
metricsConverter, err := influx2otel.NewLineProtocolToOtelMetrics(converterConfig)
if err != nil {
return err
}
Expand Down Expand Up @@ -235,6 +240,7 @@ const (
defaultServiceAddress = "localhost:4317"
defaultTimeout = config.Duration(5 * time.Second)
defaultCompression = "gzip"
defaultNameSeparator = "_"
)

func init() {
Expand All @@ -243,6 +249,7 @@ func init() {
ServiceAddress: defaultServiceAddress,
Timeout: defaultTimeout,
Compression: defaultCompression,
NameSeparator: defaultNameSeparator,
}
})
}
Loading
Loading