Skip to content

Commit

Permalink
add constants and ports
Browse files Browse the repository at this point in the history
  • Loading branch information
andriisoldatenko committed Feb 5, 2025
1 parent d62e644 commit e08d421
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
17 changes: 17 additions & 0 deletions pkg/otelcgen/consts.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package otelcgen

const (
OtlpGrpcPort = 4317
OtlpHTTPPort = 4317

JaegerGrpcPort = 14250
JaegerThriftBinaryPort = 6832
JaegerThriftComactPort = 6831
JaegerThriftHTTPPort = 14268

ZipkinPort = 9411

StatsdPort = 8125

ExtensionsHealthCeckPort = 13133
)
2 changes: 1 addition & 1 deletion pkg/otelcgen/exporters.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var (
func (c *Config) buildExporters() map[component.ID]component.Config {
return map[component.ID]component.Config{
otlphttp: &ServerConfig{
Endpoint: "test",
Endpoint: c.buildEndpointWithoutPort(),
// if in-cluster AG
TLSSetting: &TLSSetting{
CAFile: "/run/opensignals/cacerts/certs",
Expand Down
1 change: 1 addition & 0 deletions pkg/otelcgen/exporters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

func TestNewConfigWithExporters(t *testing.T) {
cfg, err := NewConfig(
WithPodIP("test"),
WithExporters(),
)
require.NoError(t, err)
Expand Down
8 changes: 8 additions & 0 deletions pkg/otelcgen/otelcgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@ func (c *Config) buildTLSSetting() *TLSSetting {
return tls
}

func (c *Config) buildEndpoint(port uint) string {
return fmt.Sprintf("%s:%d", c.podIP, port)
}

func (c *Config) buildEndpointWithoutPort() string {
return c.podIP
}

// func
// receivers
func (c *Config) buildReceiverComponent(componentID component.ID) component.Config {
Expand Down

0 comments on commit e08d421

Please sign in to comment.