Auth failure when running local Tilt Up
- Dominant language
- Go
- Stars
- 1.3k
- Forks
- 543
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 109
Description
## Context
Running a local `tilt up` and sending data via `sendotlp` generates with following error:
`2024-08-12T17:57:28-04:00 FATAL sendotlp/main.go:114 error sending data {"error": "rpc error: code = Unauthenticated desc = authentication failed: missing or improperly formatted Authorization header: expected 'Authorization: Bearer secret_token' or 'Authorization: ApiKey base64(API key ID:API key)'\nerror shutting down meter provider: failed to upload metrics: rpc error: code = Unauthenticated desc = authentication failed: missing or improperly formatted Authorization header: expected 'Authorization: Bearer secret_token' or 'Authorization: ApiKey base64(API key ID:API key)'"}`
## Methods Tried
1. Running with an empty API Key fails.
2. Running with a Kibana generated API Key a also fails.
3. However, pulling the Secret Key from k8s and piping it to `sendotlp` does work:
```
> TOKEN=$(kubectl get secrets apm-server-apm-token -o json | jq '. | {name: .metadata.name,data: .data|map_values(@base64d)}.data."secret-token"' | tr -d '"') && go run main.go -insecure=true -secret-token="$TOKEN" -endpoint=http://localhost:8200
2024-08-12T18:03:51-04:00 INFO sendotlp/main.go:155 sending OTLP data to http://localhost:8200 (grpc)
```
Contributor guide
Assessment
This issue has not been assessed yet.