Skip to content

Commit

Permalink
Add distro README
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Dec 20, 2021
1 parent 20aa968 commit 2dcfee8
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Table of Contents:

This Splunk distribution comes with the following defaults:

- [B3 context propagation](https://github.com/openzipkin/b3-propagation).
- [W3C tracecontext propagation](https://www.w3.org/TR/trace-context/).
- [Jaeger Thrift over HTTP
exporter](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/jaeger)
configured to send spans to a locally running [Splunk OpenTelemetry Connector](https://github.com/signalfx/splunk-otel-collector)
Expand Down Expand Up @@ -93,6 +93,8 @@ As well as in Go code before executing `distro.Run()`:
os.Setenv("OTEL_RESOURCE_ATTRIBUTES", "service.name=my-app,service.version=1.2.3,deployment.environment=development")
```
For advanced configuration options, refer to the [`distro` package documentation](./distro/README.md#Configuration).
## Library Instrumentation
Supported libraries are listed
Expand Down
73 changes: 73 additions & 0 deletions distro/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Package `github.com/signalfx/splunk-otel-go/distro`

This package provides a Splunk distributed of the OpenTelemetry Go SDK. It is
designed to provide an SDK properly configured to be used with the Splunk
platform out-of-the-box.

## Getting Started

The main entry point for the package is the [`Run`][] function. Use this
function to create an SDK that is ready to be used with OpenTelemetry and
forward all telemetry to Splunk. See [`example_test.go`](./example_test.go) for
a complete example.

## Configuration

The [`SDK`][] is configured with the following options.

| Option Name | Default Value | Environment Variable |
| ---| --- | --- |
| `WithAccessToken` | `""` | `SPLUNK_ACCESS_TOKEN` |
| `WithEndpoint` | `"localhost:4317"` or `"http://127.0.0.1:9080/v1/trace"`(1) | none |
| `WithPropagator` | `tracecontext,baggage` | `OTEL_PROPAGATORS` |

(1): The default value depends on the exporter used. See the
[`WithEndpoint`](#withendpoint) section for more details.

Environment variable can be used to set related option values, but the value
set in code will take precedence. This is the same behavior the default
OpenTelemetry SDK has.

The following sections contain specific information for each option.

### `WithAccessToken`

`WithAccessToken` configures the authentication token used to authenticate
telemetry delivery requests to a Splunk back-end.

- Default value: empty (i.e. `""`)
- Environment variable: `SPLUNK_ACCESS_TOKEN`

### `WithEndpoint`

`WithEndpoint` configures the Splunk endpoint that telemetry is sent to.

- Default value: depends on the exporter used.
- For the `otlp` over gRPC exporter: `"localhost:4317"`
- For the `jaeger-thrift-splunk` exporter: `"http://127.0.0.1:9080/v1/trace"`

### `WithPropagator`

`WithPropagator` configures the OpenTelemetry `TextMapPropagator` set as the
global `TextMapPropagator`. Setting to `nil` will prevent any global
`TextMapPropagator` from being set.

- Default value: A W3C tracecontext and baggage `TextMapPropagator`
- Environment variable: `OTEL_PROPAGATORS`

The environment variable values are restricted to the following.

- `"tracecontext"`: W3C tracecontext
- `"baggage"`: W3C baggage
- `"b3"`: B3 single-header format
- `"b3multi"`: B3 multi-header format
- `"jaeger"`: Jaeger
- `"xray"`: AWS X-Ray
- `"ottrace"`: OpenTracing
- `"none"`: None, explicitly do not set a global propagator

Values can be joined with a comma (`","`) to produce a composite
`TextMapPropagator`.

[`Run`]: https://pkg.go.dev/github.com/signalfx/splunk-otel-go/distro#Run
[`SDK`]: https://pkg.go.dev/github.com/signalfx/splunk-otel-go/distro#SDK
4 changes: 2 additions & 2 deletions distro/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ var propagators = map[string]func() propagation.TextMapPropagator{
"b3": func() propagation.TextMapPropagator {
return b3.New(b3.WithInjectEncoding(b3.B3SingleHeader))
},
// B3 Multi
// B3 Multi
"b3multi": func() propagation.TextMapPropagator {
return b3.New(b3.WithInjectEncoding(b3.B3MultipleHeader))
},
Expand All @@ -106,7 +106,7 @@ var propagators = map[string]func() propagation.TextMapPropagator{
"xray": func() propagation.TextMapPropagator {
return xray.Propagator{}
},
// OpenTracing Trace
// OpenTracing Trace
"ottrace": func() propagation.TextMapPropagator {
return ot.OT{}
},
Expand Down

0 comments on commit 2dcfee8

Please sign in to comment.