Skip to content

Commit

Permalink
Merge pull request #2200 from syedriko/syedriko-log-4589
Browse files Browse the repository at this point in the history
LOG-4589: vector fails to start on a node with IPv6 disabled
  • Loading branch information
openshift-ci[bot] committed Oct 12, 2023
2 parents 5c201a9 + 39c90c0 commit 78a1e1a
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion internal/generator/vector/metrics.go
@@ -1,13 +1,28 @@
package vector

import (
"golang.org/x/sys/unix"
)

const (
InternalMetricsSourceName = "internal_metrics"
PrometheusOutputSinkName = "prometheus_output"
PrometheusExporterAddress = "[::]:24231"

AddNodenameToMetricTransformName = "add_nodename_to_metric"
)

var PrometheusExporterAddress string

func init() {
if fd, err := unix.Socket(unix.AF_INET6, unix.SOCK_STREAM, unix.IPPROTO_IP); err != nil {
PrometheusExporterAddress = `0.0.0.0`
} else {
unix.Close(fd)
PrometheusExporterAddress = `[::]`
}
PrometheusExporterAddress += `:24231`
}

type InternalMetrics struct {
ID string
ScrapeIntervalSec int
Expand Down

0 comments on commit 78a1e1a

Please sign in to comment.