Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new destination: axiom #656

Merged
merged 4 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ For more details,see our [quickstart guide](https://docs.odigos.io/intro).
| Splunk | ✅ | | |
| Lightstep | ✅ | | |
| Sentry | ✅ | | |
| Axiom | ✅ | | ✅ |

### Open Source

Expand Down
51 changes: 51 additions & 0 deletions autoscaler/controllers/gateway/config/axiom.go
Original file line number Diff line number Diff line change
@@ -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"},
}
}
}
2 changes: 1 addition & 1 deletion autoscaler/controllers/gateway/config/elasticapm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion autoscaler/controllers/gateway/config/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion common/dests.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ const (
AzureBlobDestinationType DestinationType = "azureblob"
DynatraceDestinationType DestinationType = "dynatrace"
ChronosphereDestinationType DestinationType = "chronosphere"
ElasticAPM DestinationType = "elasticapm"
ElasticAPMDestinationType DestinationType = "elasticapm"
AxiomDestinationType DestinationType = "axiom"
)
27 changes: 27 additions & 0 deletions destinations/data/axiom.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion destinations/data/elasticapm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Destination
metadata:
type: elasticapm
displayName: Elastic APM
category: self hosted
category: managed
spec:
image: elasticapm.svg
signals:
Expand Down
31 changes: 31 additions & 0 deletions destinations/data/elasticsearch.yaml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions destinations/logos/axiom.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.