influxdata / influxdata/telegraf

Output Cloudwatch Logs not using Region

Open
#11,963 23 comments 0 reactions 0 assignees View on GitHub
upstream
Dominant language
Go
Stars
17.8k
Forks
5.8k
Avg merge
1d 20h
Merged PRs (30d)
161

Description

I have a telegraf config setup on a node without the AWS CLI installed. Below is the config:

`# Generic, basic /usr/local/etc/telegraf.conf file for FreeBSD
# Gathers some basic metrics and transmits them to cloudwatch
# Be sure to set the region below

[agent]
interval = "10s"
round_interval = true
metric_batch_size = 1000
metric_buffer_limit = 10000
collection_jitter = "0s"
flush_interval = "10s"
flush_jitter = "0s"
precision = ""
debug = false
quiet = false
logfile = "/var/log/telegraf/telegraf.log"
hostname = ""
omit_hostname = false

[[processors.aws_ec2]]
imds_tags = ["instanceId"]

[[inputs.tail]]
name_override = "app_logs"
files = ["/var/log/app/*.log"]
data_format = "grok"
grok_patterns = ['%{GREEDYDATA:message}']

[[outputs.cloudwatch_logs]]
region = "us-east-2"
log_group = "/namespace/env/app"
log_stream = "tag:instanceId"
log_data_metric_name = "app_logs"
log_data_source = "field:message"`

I am getting the following errors:

`2022-10-07T17:16:36Z E! [telegraf] Error running agent: connecting output outputs.cloudwatch_logs: Error connecting to output "outputs.cloudwatch_logs": operation error CloudWatch Logs: DescribeLogGroups, failed to resolve service endpoint, an AWS region is required, but was not found
2022-10-07T17:16:37Z E! [agent] Failed to connect to [outputs.cloudwatch_logs], retrying in 15s, error was 'operation error CloudWatch Logs: DescribeLogGroups, failed to resolve service endpoint, an AWS region is required, but was not found'`

Contributor guide

Open the contributing guide

Research direction

The payload names no repository file or test. Start at the outputs.cloudwatch_logs connection path and the DescribeLogGroups error, then trace how region = us-east-2 is handed to the AWS client; done means the configured region is honored on a node without the AWS CLI, with focused coverage for this configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, go
Domain
cloud, observability-sre
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.