apm-server icon indicating copy to clipboard operation
apm-server copied to clipboard

Auth failure when running local Tilt Up

Open rubvs opened this issue 1 year ago • 1 comments

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)

rubvs avatar Aug 12 '24 22:08 rubvs

removing iteration, back to backlog

raultorrecilla avatar Jan 10 '25 21:01 raultorrecilla