(ctx context.Context, apiKey string)
| 137 | } |
| 138 | |
| 139 | func HoneycombExporter(ctx context.Context, apiKey string) (*otlptrace.Exporter, error) { |
| 140 | opts := []otlptracegrpc.Option{ |
| 141 | otlptracegrpc.WithEndpoint("api.honeycomb.io:443"), |
| 142 | otlptracegrpc.WithHeaders(map[string]string{ |
| 143 | "x-honeycomb-team": apiKey, |
| 144 | }), |
| 145 | otlptracegrpc.WithTLSCredentials(credentials.NewClientTLSFromCert(nil, "")), |
| 146 | } |
| 147 | |
| 148 | exporter, err := otlptrace.New(ctx, otlptracegrpc.NewClient(opts...)) |
| 149 | if err != nil { |
| 150 | return nil, xerrors.Errorf("create otlp exporter: %w", err) |
| 151 | } |
| 152 | |
| 153 | return exporter, nil |
| 154 | } |
no test coverage detected