Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting enabling omit_hostname for statsd but disabled for collectd,disk and mem #1388

Open
rpatidar opened this issue Oct 12, 2024 · 1 comment

Comments

@rpatidar
Copy link

rpatidar commented Oct 12, 2024

Is your feature request related to a problem? Please describe.
As of now its looks like omit_hostname is a global config and it causes the host metrics to be removed from all other fields as well.

  1. My simple requirements is to use statsd in the orignal form without adding any new dimension of host
  2. I want to generate adittional metrics which are published by collectd and disk but also aggregated by some dimension of aws asg group , instance types.

as of now doing both together does not work well for me.

Describe the solution you'd like
Support the configuration at child level ?

Describe alternatives you've considered
Moving to telegraf probably

Additional context

Here is my configuration that does not work well

{
  "agent": {
    "metrics_collection_interval": 10,
    "run_as_user": "root",
    "omit_hostname" : true
  },
  "metrics": {
    "metrics_collected": {
      "statsd":{
        "service_address":":8125",
        "metrics_collection_interval":10,
        "metrics_aggregation_interval":60
      },
      "collectd": {
        "metrics_aggregation_interval": 10
      },
      "disk": {
        "measurement": [
          "used_percent"
        ],
        "metrics_collection_interval": 10,
        "resources": [
          "/"
        ]
      },
      "mem": {
        "measurement": [
          "mem_used_percent"
        ],
        "metrics_collection_interval": 10
      }
    }
  },
  "logs": {
    "logs_collected": {
      "files": {
        "collect_list": [
          {
            "file_path": "/home/ubuntu/logs/app.log",
            "log_group_name": "/aws/ec2/application",
            "log_stream_name": "{instance_id}"
          }
        ]
      }
    }
  }
}

@rpatidar rpatidar changed the title Supporting omit_hostname only for statsd but keeping it for collectd,disk and mem Supporting disabling omit_hostname for statsd but enabled for collectd,disk and mem Oct 12, 2024
@rpatidar rpatidar changed the title Supporting disabling omit_hostname for statsd but enabled for collectd,disk and mem Supporting enabling omit_hostname for statsd but disabled for collectd,disk and mem Oct 12, 2024
@rpatidar
Copy link
Author

rpatidar commented Oct 12, 2024

Below workarounds is solving most of the problem i had , added following dimension and also add a Sed command to replace the tokens

      "disk": {
        "append_dimensions": {
          "AutoScalingGroupName" : "AUTOSCALING_GROUP_NAME",
          "InstanceType" : "INSTANCE_TYPE",
          "InstanceId": "INSTANCE_ID"
        },
        "measurement": [
          "used_percent"
        ],
        "metrics_collection_interval": 10,
        "resources": [
          "/"
        ]
      },

and

sudo sed -i "s/INSTANCE_ID/${INSTANCE_ID}/g;s/AUTOSCALING_GROUP_NAME/${AUTOSCALING_GROUP_NAME}/g;s/INSTANCE_TYPE/${INSTANCE_TYPE}/g;" /home/ubuntu/config.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant