diff --git a/README.md b/README.md index 103ec12d6..960f1c0cc 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,7 @@ For more details,see our [quickstart guide](https://docs.odigos.io/intro). | Splunk | ✅ | | | | Lightstep | ✅ | | | | Sentry | ✅ | | | +| Axiom | ✅ | | ✅ | ### Open Source diff --git a/autoscaler/controllers/gateway/config/axiom.go b/autoscaler/controllers/gateway/config/axiom.go new file mode 100644 index 000000000..d37d8e2c7 --- /dev/null +++ b/autoscaler/controllers/gateway/config/axiom.go @@ -0,0 +1,51 @@ +package config + +import ( + odigosv1 "github.com/keyval-dev/odigos/api/odigos/v1alpha1" + commonconf "github.com/keyval-dev/odigos/autoscaler/controllers/common" + "github.com/keyval-dev/odigos/common" + ctrl "sigs.k8s.io/controller-runtime" +) + +const ( + axiomDatasetKey = "AXIOM_DATASET" +) + +type Axiom struct{} + +func (a *Axiom) DestType() common.DestinationType { + return common.AxiomDestinationType +} + +func (a *Axiom) ModifyConfig(dest *odigosv1.Destination, currentConfig *commonconf.Config) { + dataset, exists := dest.Spec.Data[axiomDatasetKey] + if !exists { + dataset = "default" + ctrl.Log.V(0).Info("Axiom dataset not specified, using default") + } + + currentConfig.Exporters["otlphttp/axiom"] = commonconf.GenericMap{ + "compression": "gzip", + "endpoint": "https://api.axiom.co", + "headers": commonconf.GenericMap{ + "authorization": "Bearer ${AXIOM_API_TOKEN}", + "x-axiom-dataset": dataset, + }, + } + + if isTracingEnabled(dest) { + currentConfig.Service.Pipelines["traces/axiom"] = commonconf.Pipeline{ + Receivers: []string{"otlp"}, + Processors: []string{"batch"}, + Exporters: []string{"otlphttp/axiom"}, + } + } + + if isLoggingEnabled(dest) { + currentConfig.Service.Pipelines["logs/axiom"] = commonconf.Pipeline{ + Receivers: []string{"otlp"}, + Processors: []string{"batch"}, + Exporters: []string{"otlphttp/axiom"}, + } + } +} diff --git a/autoscaler/controllers/gateway/config/elasticapm.go b/autoscaler/controllers/gateway/config/elasticapm.go index e6b5debca..b726679fe 100644 --- a/autoscaler/controllers/gateway/config/elasticapm.go +++ b/autoscaler/controllers/gateway/config/elasticapm.go @@ -19,7 +19,7 @@ const ( type ElasticAPM struct{} func (e *ElasticAPM) DestType() common.DestinationType { - return common.ElasticAPM + return common.ElasticAPMDestinationType } func (e *ElasticAPM) ModifyConfig(dest *odigosv1.Destination, currentConfig *commonconf.Config) { diff --git a/autoscaler/controllers/gateway/config/root.go b/autoscaler/controllers/gateway/config/root.go index 16d92169a..0ef2bee21 100644 --- a/autoscaler/controllers/gateway/config/root.go +++ b/autoscaler/controllers/gateway/config/root.go @@ -13,7 +13,7 @@ import ( var availableConfigers = []Configer{&Middleware{}, &Honeycomb{}, &Grafana{}, &Datadog{}, &NewRelic{}, &Logzio{}, &Prometheus{}, &Tempo{}, &Loki{}, &Jaeger{}, &GenericOTLP{}, &Elasticsearch{}, &Signoz{}, &Qryn{}, &OpsVerse{}, &Splunk{}, &Lightstep{}, &GoogleCloud{}, &GoogleCloudStorage{}, &Sentry{}, &AzureBlobStorage{}, - &AWSS3{}, &Dynatrace{}, &Chronosphere{}, &ElasticAPM{}} + &AWSS3{}, &Dynatrace{}, &Chronosphere{}, &ElasticAPM{}, &Axiom{}} type Configer interface { DestType() common.DestinationType diff --git a/common/dests.go b/common/dests.go index 94dac5919..0c655c306 100644 --- a/common/dests.go +++ b/common/dests.go @@ -27,5 +27,6 @@ const ( AzureBlobDestinationType DestinationType = "azureblob" DynatraceDestinationType DestinationType = "dynatrace" ChronosphereDestinationType DestinationType = "chronosphere" - ElasticAPM DestinationType = "elasticapm" + ElasticAPMDestinationType DestinationType = "elasticapm" + AxiomDestinationType DestinationType = "axiom" ) diff --git a/destinations/data/axiom.yaml b/destinations/data/axiom.yaml new file mode 100644 index 000000000..00d68508b --- /dev/null +++ b/destinations/data/axiom.yaml @@ -0,0 +1,27 @@ +apiVersion: internal.odigos.io/v1beta1 +kind: Destination +metadata: + type: axiom + displayName: Axiom + category: managed +spec: + image: axiom.svg + signals: + traces: + supported: true + metrics: + supported: false + logs: + supported: true + fields: + - name: AXIOM_DATASET + displayName: Dataset + componentType: input + componentProps: + type: text + - name: AXIOM_API_TOKEN + displayName: Axiom API token + componentType: input + componentProps: + type: password + secret: true \ No newline at end of file diff --git a/destinations/data/elasticapm.yaml b/destinations/data/elasticapm.yaml index 6f3ea8ad0..9454b47c2 100644 --- a/destinations/data/elasticapm.yaml +++ b/destinations/data/elasticapm.yaml @@ -3,7 +3,7 @@ kind: Destination metadata: type: elasticapm displayName: Elastic APM - category: self hosted + category: managed spec: image: elasticapm.svg signals: diff --git a/destinations/data/elasticsearch.yaml b/destinations/data/elasticsearch.yaml new file mode 100644 index 000000000..ad6f9dee4 --- /dev/null +++ b/destinations/data/elasticsearch.yaml @@ -0,0 +1,31 @@ +apiVersion: internal.odigos.io/v1beta1 +kind: Destination +metadata: + type: elasticsearch + displayName: Elasticsearch + category: self hosted +spec: + image: elasticsearch.svg + signals: + traces: + supported: true + metrics: + supported: false + logs: + supported: true + fields: + - name: ELASTICSEARCH_URL + displayName: Elasticsearch URL + componentType: input + componentProps: + type: text + - name: ES_TRACES_INDEX + displayName: Traces Index + componentType: input + componentProps: + type: text + - name: ES_LOGS_INDEX + displayName: Logs Index + componentType: input + componentProps: + type: text \ No newline at end of file diff --git a/destinations/logos/axiom.svg b/destinations/logos/axiom.svg new file mode 100644 index 000000000..8b85a73aa --- /dev/null +++ b/destinations/logos/axiom.svg @@ -0,0 +1,3 @@ + + +