-
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.
[GEN-1947]: add Better Stack destination support and documentation (#…
…2083) This pull request introduces the integration of Better Stack as a new destination for observability data in Odigos, along with various documentation updates and improvements. The most important changes include the addition of Better Stack configuration, updates to the `README.md` and documentation files, and modifications to the configuration files to support Better Stack. ### Better Stack Integration: * [`common/config/betterstack.go`](diffhunk://#diff-e2cb05f7239c534951032ae960ad08a1d28b964515441d8bee53a26dfe95b71bR1-R55): Added new configuration for Better Stack, including methods to modify the configuration and set up exporters and pipelines. * [`common/config/root.go`](diffhunk://#diff-35f076c473aa76e7717e17ac33041f73ec6b16e26fe8a1ab50bf5963cb7fcd8eL18-R23): Included `BetterStack` in the list of available configers. * [`common/dests.go`](diffhunk://#diff-e0ef4d5cecfc896240ae7392424f227db50784f83d0ddc0c317db59066f8757bR10): Added `BetterStackDestinationType` to the list of destination types. * [`destinations/data/betterstack.yaml`](diffhunk://#diff-e43499f72266edee911975be8073bdf84dc091e2fbb5b571b84fad773367ec11R1-R23): Created a new YAML file for Better Stack destination configuration, specifying supported signals and required fields. ### Documentation Updates: * [`docs/backends/betterstack.mdx`](diffhunk://#diff-a37c129f12237e3b2bc3c543bc80c3440805bef299e2f27834df2e65935a0950R1-R59): Added a new documentation page for configuring Better Stack as a backend in Odigos. * [`docs/backends-overview.mdx`](diffhunk://#diff-26115b197a8b9dd8ee351f05b2cade47da5acd788d74b9f962a325d3e1b919a2R13): Updated the overview to include Better Stack as a managed destination. * [`docs/mint.json`](diffhunk://#diff-c91a604899dfef4b2494c317f4fd39a7f22b79986095f580399347293d534debL73-R73): Updated the documentation structure to include Better Stack and reformatted several sections for consistency. [[1]](diffhunk://#diff-c91a604899dfef4b2494c317f4fd39a7f22b79986095f580399347293d534debL73-R73) [[2]](diffhunk://#diff-c91a604899dfef4b2494c317f4fd39a7f22b79986095f580399347293d534debL102-R114) [[3]](diffhunk://#diff-c91a604899dfef4b2494c317f4fd39a7f22b79986095f580399347293d534debL153-R134) [[4]](diffhunk://#diff-c91a604899dfef4b2494c317f4fd39a7f22b79986095f580399347293d534debL192-R170) [[5]](diffhunk://#diff-c91a604899dfef4b2494c317f4fd39a7f22b79986095f580399347293d534debR185) [[6]](diffhunk://#diff-c91a604899dfef4b2494c317f4fd39a7f22b79986095f580399347293d534debL251-R223) [[7]](diffhunk://#diff-c91a604899dfef4b2494c317f4fd39a7f22b79986095f580399347293d534debL285-R258) * [`docs/quickstart/next-steps.mdx`](diffhunk://#diff-25ae422c52600166452821f8cc42d670b6b530e5f32a1b3aae657b05adb74ed7R24): Added Better Stack to the list of backends in the quickstart guide. ### README Updates: * [`README.md`](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L29-R35): Minor formatting changes to the key features section and updated the list of managed destinations to include Better Stack. [[1]](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L29-R35) [[2]](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L88-R94) [[3]](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L116-R117)
- Loading branch information
1 parent
709f273
commit e8fb532
Showing
10 changed files
with
151 additions
and
1 deletion.
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
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
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,23 @@ | ||
apiVersion: internal.odigos.io/v1beta1 | ||
kind: Destination | ||
metadata: | ||
type: betterstack | ||
displayName: Better Stack | ||
category: managed | ||
spec: | ||
image: betterstack.svg | ||
signals: | ||
traces: | ||
supported: false | ||
metrics: | ||
supported: true | ||
logs: | ||
supported: true | ||
fields: | ||
- name: BETTERSTACK_TOKEN | ||
displayName: Better Stack Source Token | ||
componentType: input | ||
secret: true | ||
componentProps: | ||
type: password | ||
required: true |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,60 @@ | ||
--- | ||
title: 'Better Stack' | ||
--- | ||
|
||
## Configuring Backend | ||
|
||
- **BETTERSTACK_TOKEN** - Source Token, generated from Better Stack UI. | ||
|
||
**Note:** | ||
We handle the endpoint internally, so you don't need to provide it. | ||
- The endpoint for metrics is `https://in-otel.logs.betterstack.com/metrics`. | ||
- The endpoint for logs is `https://in-otel.logs.betterstack.com:443`. | ||
|
||
## Adding a Destination to Odigos | ||
|
||
Odigos makes it simple to add and configure destinations, allowing you to select the specific signals [traces/logs/metrics] that you want to send to each destination. There are two primary methods for configuring destinations in Odigos: | ||
|
||
1. **Using the UI** | ||
|
||
Use the [Odigos CLI](https://docs.odigos.io/cli/odigos_ui) to access the UI: | ||
|
||
```bash | ||
odigos ui | ||
``` | ||
|
||
2. **Using kubernetes manifests** | ||
|
||
Save the YAML below to a file (e.g., `destination.yaml`) and apply it using `kubectl`: | ||
|
||
```bash | ||
kubectl apply -f destination.yaml | ||
``` | ||
|
||
|
||
```yaml | ||
apiVersion: odigos.io/v1alpha1 | ||
kind: Destination | ||
metadata: | ||
name: betterstack-example | ||
namespace: odigos-system | ||
spec: | ||
data: {} | ||
destinationName: betterstack | ||
secretRef: | ||
name: betterstack-secret | ||
signals: | ||
- METRICS | ||
- LOGS | ||
type: betterstack | ||
|
||
--- | ||
apiVersion: v1 | ||
data: | ||
BETTERSTACK_TOKEN: <base64 Better Stack Source Token> | ||
kind: Secret | ||
metadata: | ||
name: betterstack-secret | ||
namespace: odigos-system | ||
type: Opaque | ||
``` |
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