@@ -18,6 +18,7 @@ import (
18
18
"context"
19
19
"fmt"
20
20
"os"
21
+ "strings"
21
22
"time"
22
23
23
24
"github.com/pkg/errors"
@@ -32,11 +33,14 @@ import (
32
33
)
33
34
34
35
const (
35
- metricSubmissionTimeout = time .Second * 5
36
- jitterFactor = 0.1
37
- configFilePath = "/etc/oci/config.yaml"
38
- telemetryIngestionServiceName = "telemetry-ingestion"
39
- configFileName = "config.yaml"
36
+ metricSubmissionTimeout = time .Second * 5
37
+ jitterFactor = 0.1
38
+ configFilePath = "/etc/oci/config.yaml"
39
+ telemetryIngestionServiceName = "telemetry-ingestion"
40
+ telemetryIngestionServiceNameDualStack = "ds.telemetry-ingestion"
41
+ configFileName = "config.yaml"
42
+ Ipv6Stack = "IPv6"
43
+ ClusterIpFamilyEnv = "CLUSTER_IP_FAMILY"
40
44
)
41
45
42
46
// MonitoringClient is wrapper interface over the oci golang monitoring client
@@ -101,13 +105,19 @@ func NewMetricPusher(logger *zap.SugaredLogger) (*MetricPusher, error) {
101
105
return nil , nil
102
106
}
103
107
108
+ telemetryEndpoint := common .StringToRegion (cfg .RegionKey ).Endpoint (telemetryIngestionServiceName )
109
+ // dual stack endpoint to be called in case of SingleStack IPv6 only
110
+ clusterIpFamily , ok := os .LookupEnv (ClusterIpFamilyEnv )
111
+ if ok && strings .EqualFold (clusterIpFamily , Ipv6Stack ) {
112
+ telemetryEndpoint = common .StringToRegion (cfg .RegionKey ).Endpoint (telemetryIngestionServiceNameDualStack )
113
+ }
114
+
104
115
cp , err := auth .InstancePrincipalConfigurationProvider ()
105
116
if err != nil {
106
117
logger .With ("error" , err ).Error ("error occurred while creating auth provider" )
107
118
return nil , err
108
119
}
109
120
110
- telemetryEndpoint := common .StringToRegion (cfg .RegionKey ).Endpoint (telemetryIngestionServiceName )
111
121
client , err := monitoring .NewMonitoringClientWithConfigurationProvider (cp )
112
122
if err != nil {
113
123
logger .With (err ).Error ("error occurred while creating monitoring client" )
0 commit comments