You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let it collect data from an inputs.ping test config.
See it log the error: status code: 403. body: {"message":"Missing Authentication Token"}
Expected behavior
Our configuration is:
Telegraf -> AWS API Gateway -> AWS Python Lambda
If this was working, I would expect to see it logged that outputs.http successfully POSTed data to the configured URL and be able to verify receipt of the JSON payload in the CloudWatch logs associated with the AWS Lambda.
FYI, I have seen this work without the API Gateway configured to require IAM Role authentication, with just the access_key, secret_key, and token configured for outputs.http.
I should also mention, in our environment, we do have Telegraf successfully using both outputs.cloudwatch and outputs.timestream working with only the role_arn specified.
Actual behavior
Telegraf logs: status code: 403. body: {"message":"Missing Authentication Token"}
Additional info
The AWS API Gateway that I must point outputs.http towards requires HTTPS - it doesn't even allow for temporary configuration of simple HTTP testing/sniffing purposes.
In a sloppy attempt at being able to sniff the traffic to see what was being sent, I changed the outputs.http URL to an HTTP target where I ran tcpdump. What I discovered was that Telegraf did not appear to be attempting to send any authentication headers:
From tcpdump on the HTTP server:
12:41:13.181258 IP (tos 0x0, ttl 43, id 60206, offset 0, flags [DF], proto TCP (6), length 60)
ec2-52-229.compute-1.amazonaws.com.46784 > foobar.example.com.http: Flags [S], cksum 0x7f34 (correct), seq 3789377456, win 62727, options [mss 1460,sackOK,TS val 980443550 ecr 0,nop,wscale 6], length 0
12:41:13.181318 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 60)
foobar.example.com.http > ec2-52-229.compute-1.amazonaws.com.46784: Flags [S.], cksum 0x2fa0 (correct), seq 125446129, ack 3789377457, win 65535, options [mss 1460,nop,wscale 6,sackOK,TS val 3018285368 ecr 980443550], length 0
12:41:13.194684 IP (tos 0x0, ttl 43, id 60207, offset 0, flags [DF], proto TCP (6), length 52)
ec2-52-229.compute-1.amazonaws.com.46784 > foobar.example.com.http: Flags [.], cksum 0x5a89 (correct), seq 1, ack 1, win 981, options [nop,nop,TS val 980443563 ecr 3018285368], length 0
12:41:13.194902 IP (tos 0x0, ttl 43, id 60208, offset 0, flags [DF], proto TCP (6), length 1500)
ec2-52-229.compute-1.amazonaws.com.46784 > foobar.example.com.http: Flags [.], cksum 0xd0c8 (correct), seq 1:1449, ack 1, win 981, options [nop,nop,TS val 980443563 ecr 3018285368], length 1448: HTTP, length: 1448
POST / HTTP/1.1
Host: www.example.com
User-Agent: Telegraf/1.26.0 Go/1.20.2
Content-Length: 2741
Content-Type: application/json
Accept-Encoding: gzip
Okay, so I tried just sticking aws_service = "yes" under the outputs.http section and it changed the error. To an actual STS IAM Role error. . . stand by while I troubleshoot this further.
Relevant telegraf.conf
Logs from Telegraf
System info
Telegraf 1.26.0 | Debian 11 (bullseye) | Linux telegraf 5.10.0-21-cloud-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 GNU/Linux
Docker
No response
Steps to reproduce
Expected behavior
Our configuration is:
Telegraf -> AWS API Gateway -> AWS Python Lambda
If this was working, I would expect to see it logged that outputs.http successfully POSTed data to the configured URL and be able to verify receipt of the JSON payload in the CloudWatch logs associated with the AWS Lambda.
FYI, I have seen this work without the API Gateway configured to require IAM Role authentication, with just the access_key, secret_key, and token configured for outputs.http.
I should also mention, in our environment, we do have Telegraf successfully using both outputs.cloudwatch and outputs.timestream working with only the role_arn specified.
Actual behavior
Telegraf logs: status code: 403. body: {"message":"Missing Authentication Token"}
Additional info
The AWS API Gateway that I must point outputs.http towards requires HTTPS - it doesn't even allow for temporary configuration of simple HTTP testing/sniffing purposes.
In a sloppy attempt at being able to sniff the traffic to see what was being sent, I changed the outputs.http URL to an HTTP target where I ran tcpdump. What I discovered was that Telegraf did not appear to be attempting to send any authentication headers:
From tcpdump on the HTTP server:
12:41:13.181258 IP (tos 0x0, ttl 43, id 60206, offset 0, flags [DF], proto TCP (6), length 60)
ec2-52-229.compute-1.amazonaws.com.46784 > foobar.example.com.http: Flags [S], cksum 0x7f34 (correct), seq 3789377456, win 62727, options [mss 1460,sackOK,TS val 980443550 ecr 0,nop,wscale 6], length 0
12:41:13.181318 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 60)
foobar.example.com.http > ec2-52-229.compute-1.amazonaws.com.46784: Flags [S.], cksum 0x2fa0 (correct), seq 125446129, ack 3789377457, win 65535, options [mss 1460,nop,wscale 6,sackOK,TS val 3018285368 ecr 980443550], length 0
12:41:13.194684 IP (tos 0x0, ttl 43, id 60207, offset 0, flags [DF], proto TCP (6), length 52)
ec2-52-229.compute-1.amazonaws.com.46784 > foobar.example.com.http: Flags [.], cksum 0x5a89 (correct), seq 1, ack 1, win 981, options [nop,nop,TS val 980443563 ecr 3018285368], length 0
12:41:13.194902 IP (tos 0x0, ttl 43, id 60208, offset 0, flags [DF], proto TCP (6), length 1500)
ec2-52-229.compute-1.amazonaws.com.46784 > foobar.example.com.http: Flags [.], cksum 0xd0c8 (correct), seq 1:1449, ack 1, win 981, options [nop,nop,TS val 980443563 ecr 3018285368], length 1448: HTTP, length: 1448
POST / HTTP/1.1
Host: www.example.com
User-Agent: Telegraf/1.26.0 Go/1.20.2
Content-Length: 2741
Content-Type: application/json
Accept-Encoding: gzip
The text was updated successfully, but these errors were encountered: