Jaskier
A fun side project, writing a column-oriented datastore to store and query
tracing data using the OTLP format.
Running the service
You can either run the service locally directly with go run, or use the
buildable Docker image.
From within the project's main directory:
go run main.go --config config.yml
docker build -t jaskier .
docker run -p 2021:2021 --name jaskier -d \
--mount type=bind,source="$(pwd)"/config.yml,target=/root/config.yml \
jaskier sh -c "/root/jaskier --config /root/config.yml"
The server will listen on port 2021 by default.
Configuration
The binary accepts a configuration file for configuring the behavior of the
application.
The format of the configuration is available in cli/config.go.
Here is a sample config file:
otlp:
endpoint: api.honeycomb.io:443
headers:
x-honeycomb-team: <MY SECRET KEY>
x-honeycomb-dataset: jaskier
sample_ratio: 0.5
Sending traces
You can send traces by setting up an OTLP exporter within your OpenTelemetry
application. For example, in Go:
import (
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
)
exp, _ = otlptracegrpc.New(context.Background(),
otlptracegrpc.WithEndpoint("localhost:2021"),
otlptracegrpc.WithInsecure(),
otlptracegrpc.WithHeaders(map[string]string{
"dataset": "my_dataset",
}),
)
tp := sdktrace.NewTracerProvider(sdktrace.WithBatcher(exp))
otel.SetTracerProvider(tp)
You can then use tracing as you would normally do with any OpenTelemetry project:
_, span := otel.Tracer("").Start(context.Background(), "test_span")
defer span.End()
Querying
TODO