Auth failure when running local Tilt Up
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
- Running with an empty API Key fails.
- Running with a Kibana generated API Key a also fails.
- However, pulling the Secret Key from k8s and piping it to
sendotlpdoes 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)
removing iteration, back to backlog