Skip to content

Commit

Permalink
go fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
okankoAMZ committed Nov 12, 2024
1 parent b683196 commit b5428a3
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 30 deletions.
20 changes: 10 additions & 10 deletions internal/config/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
)

const (
defaultCollectorConfigMapEntry = "cwagentconfig.json"
defaultOtelCollectorConfigMapEntry = "cwagentotelconfig.yaml"
defaultTargetAllocatorConfigMapEntry = "targetallocator.yaml"
defaultPrometheusConfigMapEntry = "prometheus.yaml"
defaultCollectorConfigMapEntry = "cwagentconfig.json"
defaultOtelCollectorConfigMapEntry = "cwagentotelconfig.yaml"
defaultTargetAllocatorConfigMapEntry = "targetallocator.yaml"
defaultPrometheusConfigMapEntry = "prometheus.yaml"
)

// Config holds the static configuration for this operator.
Expand Down Expand Up @@ -43,12 +43,12 @@ type Config struct {
func New(opts ...Option) Config {
// initialize with the default values
o := options{
collectorConfigMapEntry: defaultCollectorConfigMapEntry,
otelCollectorConfigMapEntry: defaultOtelCollectorConfigMapEntry,
targetAllocatorConfigMapEntry: defaultTargetAllocatorConfigMapEntry,
prometheusConfigMapEntry: defaultPrometheusConfigMapEntry,
logger: logf.Log.WithName("config"),
version: version.Get(),
collectorConfigMapEntry: defaultCollectorConfigMapEntry,
otelCollectorConfigMapEntry: defaultOtelCollectorConfigMapEntry,
targetAllocatorConfigMapEntry: defaultTargetAllocatorConfigMapEntry,
prometheusConfigMapEntry: defaultPrometheusConfigMapEntry,
logger: logf.Log.WithName("config"),
version: version.Get(),
}
for _, opt := range opts {
opt(&o)
Expand Down
3 changes: 2 additions & 1 deletion internal/manifests/collector/config_replace.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ import (
_ "github.com/prometheus/prometheus/discovery/install" // Package install has the side-effect of registering all builtin.
"gopkg.in/yaml.v2"

"go.opentelemetry.io/collector/confmap"

"github.com/aws/amazon-cloudwatch-agent-operator/apis/v1alpha1"
"github.com/aws/amazon-cloudwatch-agent-operator/internal/manifests/collector/adapters"
ta "github.com/aws/amazon-cloudwatch-agent-operator/internal/manifests/targetallocator/adapters"
"github.com/aws/amazon-cloudwatch-agent-operator/internal/naming"
"github.com/aws/amazon-cloudwatch-agent-operator/pkg/featuregate"
"go.opentelemetry.io/collector/confmap"
)

type targetAllocator struct {
Expand Down
34 changes: 17 additions & 17 deletions internal/manifests/collector/ports.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ import (
)

const (
StatsD = "statsd"
CollectD = "collectd"
XrayProxy = "aws-proxy"
XrayTraces = "aws-traces"
OtlpGrpc = "otlp-grpc"
OtlpHttp = "otlp-http"
AppSignalsGrpc = "appsig-grpc"
AppSignalsHttp = "appsig-http"
AppSignalsProxy = "appsig-xray"
AppSignalsGrpcSA = ":4315"
AppSignalsHttpSA = ":4316"
AppSignalsProxySA = ":2000"
StatsD = "statsd"
CollectD = "collectd"
XrayProxy = "aws-proxy"
XrayTraces = "aws-traces"
OtlpGrpc = "otlp-grpc"
OtlpHttp = "otlp-http"
AppSignalsGrpc = "appsig-grpc"
AppSignalsHttp = "appsig-http"
AppSignalsProxy = "appsig-xray"
AppSignalsGrpcSA = ":4315"
AppSignalsHttpSA = ":4316"
AppSignalsProxySA = ":2000"
AppSignalsServerSA = ":4311"
EMF = "emf"
EMFTcp = "emf-tcp"
EMFUdp = "emf-udp"
CWA = "cwa-"
JmxHttp = "jmx-http"
EMF = "emf"
EMFTcp = "emf-tcp"
EMFUdp = "emf-udp"
CWA = "cwa-"
JmxHttp = "jmx-http"
Server = "server"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/instrumentation/defaultinstrumentation.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func getJavaEnvs(isAppSignalsEnabled bool, cloudwatchAgentServiceEndpoint, expor
if isAppSignalsEnabled {
isJavaRuntimeEnabled, ok := os.LookupEnv("AUTO_INSTRUMENTATION_JAVA_RUNTIME_ENABLED")
if !ok {
isJavaRuntimeEnabled = "true";
isJavaRuntimeEnabled = "true"
}
appSignalsEnvs := []corev1.EnvVar{
{Name: "OTEL_AWS_APP_SIGNALS_ENABLED", Value: "true"}, //TODO: remove in favor of new name once safe
Expand Down Expand Up @@ -185,7 +185,7 @@ func getPythonEnvs(isAppSignalsEnabled bool, cloudwatchAgentServiceEndpoint, exp
if isAppSignalsEnabled {
isPythonRuntimeEnabled, ok := os.LookupEnv("AUTO_INSTRUMENTATION_PYTHON_RUNTIME_ENABLED")
if !ok {
isPythonRuntimeEnabled = "true";
isPythonRuntimeEnabled = "true"
}
envs = []corev1.EnvVar{
{Name: "OTEL_AWS_APP_SIGNALS_ENABLED", Value: "true"}, //TODO: remove in favor of new name once safe
Expand Down

0 comments on commit b5428a3

Please sign in to comment.