-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into migration-to-new-runtimedetails-approach
- Loading branch information
Showing
56 changed files
with
3,773 additions
and
2,174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package config | ||
|
||
import ( | ||
"github.com/odigos-io/odigos/common" | ||
) | ||
|
||
type BetterStack struct{} | ||
|
||
func (j *BetterStack) DestType() common.DestinationType { | ||
return common.BetterStackDestinationType | ||
} | ||
|
||
func (j *BetterStack) ModifyConfig(dest ExporterConfigurer, cfg *Config) error { | ||
uniqueUri := "betterstack-" + dest.GetID() | ||
|
||
processorName := "attributes/" + uniqueUri | ||
cfg.Processors[processorName] = GenericMap{ | ||
"actions": []GenericMap{ | ||
{ | ||
"key": "better_stack_source_token", | ||
"value": "${BETTERSTACK_TOKEN}", | ||
"action": "insert", | ||
}, | ||
}, | ||
} | ||
|
||
if isMetricsEnabled(dest) { | ||
exporterName := "prometheusremotewrite/" + uniqueUri | ||
cfg.Exporters[exporterName] = GenericMap{ | ||
"endpoint": "https://in-otel.logs.betterstack.com/metrics", | ||
} | ||
|
||
pipeName := "metrics/" + uniqueUri | ||
cfg.Service.Pipelines[pipeName] = Pipeline{ | ||
Processors: []string{processorName}, | ||
Exporters: []string{exporterName}, | ||
} | ||
} | ||
|
||
if isLoggingEnabled(dest) { | ||
exporterName := "otlp/" + uniqueUri | ||
cfg.Exporters[exporterName] = GenericMap{ | ||
"endpoint": "https://in-otel.logs.betterstack.com:443", | ||
} | ||
|
||
pipeName := "logs/" + uniqueUri | ||
cfg.Service.Pipelines[pipeName] = Pipeline{ | ||
Processors: []string{processorName}, | ||
Exporters: []string{exporterName}, | ||
} | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package config | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/odigos-io/odigos/common" | ||
) | ||
|
||
const ( | ||
Dash0Endpoint = "DASH0_ENDPOINT" | ||
) | ||
|
||
var ( | ||
ErrorDash0EndpointMissing = errors.New("Dash0 is missing a required field (\"DASH0_ENDPOINT\"), Dash0 will not be configured") | ||
) | ||
|
||
type Dash0 struct{} | ||
|
||
func (j *Dash0) DestType() common.DestinationType { | ||
return common.Dash0DestinationType | ||
} | ||
|
||
func (j *Dash0) ModifyConfig(dest ExporterConfigurer, currentConfig *Config) error { | ||
config := dest.GetConfig() | ||
uniqueUri := "dash0-" + dest.GetID() | ||
|
||
url, exists := config[Dash0Endpoint] | ||
if !exists { | ||
return ErrorDash0EndpointMissing | ||
} | ||
endpoint, err := parseOtlpGrpcUrl(url, true) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
exporterName := "otlp/" + uniqueUri | ||
exporterConfig := GenericMap{ | ||
"endpoint": endpoint, | ||
"headers": GenericMap{ | ||
"Authorization": "Bearer ${DASH0_TOKEN}", | ||
}, | ||
} | ||
|
||
currentConfig.Exporters[exporterName] = exporterConfig | ||
|
||
if isTracingEnabled(dest) { | ||
pipeName := "traces/" + uniqueUri | ||
currentConfig.Service.Pipelines[pipeName] = Pipeline{ | ||
Exporters: []string{exporterName}, | ||
} | ||
} | ||
|
||
if isMetricsEnabled(dest) { | ||
pipeName := "metrics/" + uniqueUri | ||
currentConfig.Service.Pipelines[pipeName] = Pipeline{ | ||
Exporters: []string{exporterName}, | ||
} | ||
} | ||
|
||
if isLoggingEnabled(dest) { | ||
pipeName := "logs/" + uniqueUri | ||
currentConfig.Service.Pipelines[pipeName] = Pipeline{ | ||
Exporters: []string{exporterName}, | ||
} | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package config | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/odigos-io/odigos/common" | ||
) | ||
|
||
const ( | ||
GroundcoverEndpoint = "GROUNDCOVER_ENDPOINT" | ||
GroundcoverApiKey = "GROUNDCOVER_API_KEY" | ||
) | ||
|
||
var ( | ||
ErrorGroundcoverEndpointMissing = errors.New("Groundcover is missing a required field (\"GROUNDCOVER_ENDPOINT\"), Groundcover will not be configured") | ||
ErrorGroundcoverApiKeyMissing = errors.New("Groundcover is missing a required field (\"GROUNDCOVER_API_KEY\"), Groundcover will not be configured") | ||
) | ||
|
||
type Groundcover struct{} | ||
|
||
func (j *Groundcover) DestType() common.DestinationType { | ||
return common.GroundcoverDestinationType | ||
} | ||
|
||
func (j *Groundcover) ModifyConfig(dest ExporterConfigurer, currentConfig *Config) error { | ||
config := dest.GetConfig() | ||
uniqueUri := "groundcover-" + dest.GetID() | ||
|
||
url, exists := config[GroundcoverEndpoint] | ||
if !exists { | ||
return ErrorGroundcoverEndpointMissing | ||
} | ||
|
||
endpoint, err := parseOtlpGrpcUrl(url, true) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
exporterName := "otlp/" + uniqueUri | ||
exporterConfig := GenericMap{ | ||
"endpoint": endpoint, | ||
"headers": GenericMap{ | ||
"apikey": "${GROUNDCOVER_API_KEY}", | ||
}, | ||
} | ||
|
||
currentConfig.Exporters[exporterName] = exporterConfig | ||
|
||
if isTracingEnabled(dest) { | ||
tracesPipelineName := "traces/" + uniqueUri | ||
currentConfig.Service.Pipelines[tracesPipelineName] = Pipeline{ | ||
Exporters: []string{exporterName}, | ||
} | ||
} | ||
|
||
if isMetricsEnabled(dest) { | ||
tracesPipelineName := "metrics/" + uniqueUri | ||
currentConfig.Service.Pipelines[tracesPipelineName] = Pipeline{ | ||
Exporters: []string{exporterName}, | ||
} | ||
} | ||
|
||
if isLoggingEnabled(dest) { | ||
tracesPipelineName := "logs/" + uniqueUri | ||
currentConfig.Service.Pipelines[tracesPipelineName] = Pipeline{ | ||
Exporters: []string{exporterName}, | ||
} | ||
} | ||
|
||
return nil | ||
} |
Oops, something went wrong.