opentelemetry-collector icon indicating copy to clipboard operation
opentelemetry-collector copied to clipboard

Need help in collecting server metrics - Disk/CPU #6197

Open Godwinmoses93 opened this issue 3 years ago • 11 comments
trafficstars

Hi All,

I am new to open-telemtry, I am trying to collect a Linux machines metrics such as CPU/Disk/Memory to display in cloudwatch. I have installed open-telemetry collector in my Linux AWS instance and tried to run the docker container provided in the example. I was able to see application metrics pulled in, someone please help me how to collect the Infrastructure metrics, if there is any example config.yaml that would be helpful. Or is there any API commands for open-telemetry like AWS command line, where I can create custom metrics using putmetricdata ! Thanks in advance.

Godwinmoses93 avatar Jun 21 '22 18:06 Godwinmoses93

The target you want to collect cpu metric is linux AWS machine or the container running on the machine?

fatsheep9146 avatar Jun 22 '22 04:06 fatsheep9146

@fatsheep9146 , In the linux machine. Can I use open-telemetry as a agent to collect these metrics ! If I get some example Yaml or API command, I will create for others.

Godwinmoses93 avatar Jun 22 '22 07:06 Godwinmoses93

Look at this https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/hostmetricsreceiver

bogdandrutu avatar Jun 22 '22 08:06 bogdandrutu

@bogdandrutu Post creating the Yaml, do we need to create any script to trigger the yaml ? or once the config.yaml edited we will be able to see in cloudwatch ?

Godwinmoses93 avatar Jun 22 '22 08:06 Godwinmoses93

@Godwinmoses93 I think you should use hostmetrics receiver in your collector configuration, and awscloudwatch exporter to export metric to cloudwatch. something like

receivers:
  hostmetrics:
    collection_interval: 30s
    scrapers:
      cpu:
      memory:
exporters:
    awsemf:
        region: 'us-west-2'
        resource_to_telemetry_conversion:
            enabled: true

service:
  pipelines:
    metrics:
      receivers: [hostmetrics]
      exporters: [awsemf]
      

fatsheep9146 avatar Jun 22 '22 09:06 fatsheep9146

@fatsheep9146 , Thanks for the heads up man, I have created a Yaml file using this https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/hostmetricsreceiver but I am unable to see the metrics in the cloudwatch. Is there anything I need to trigger other than sudo /opt/aws/aws-otel-collector/bin/aws-otel-collector-ctl -c </path/config.yaml> -a start ?

Godwinmoses93 avatar Jun 22 '22 09:06 Godwinmoses93

@mhausenblas, @bogdandrutu, @fatsheep9146 Looks like this component isn't on the ADOT distribution yet: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/hostmetricsreceiver

Can someone confirm me on this, That would be a great help !!

Reference - https://github.com/aws-observability/aws-otel-collector/issues/740 https://github.com/aws-observability/aws-otel-collector/issues/1287

@alolita - Did you find any other way to get the hostmetric !!

Thanks in advance.

Godwinmoses93 avatar Jun 22 '22 20:06 Godwinmoses93

@mhausenblas or any - I am trying to collect Infrastructure/Application/Services metrics using ADOT, Please suggest me how I can collect it and display in cloudwatch ! I am trying to collect it from EC2 instance either from a windows or any linux flavors.

Godwinmoses93 avatar Jun 22 '22 20:06 Godwinmoses93

Could you provide the logs of your collector?

fatsheep9146 avatar Jun 22 '22 22:06 fatsheep9146

@Aneurysm9?

bogdandrutu avatar Jun 29 '22 13:06 bogdandrutu

I am trying to collect Infrastructure/Application/Services metrics using ADOT

ADOT PM here. I did comment on https://github.com/aws-observability/aws-otel-collector/issues/1287 some 6 days ago concerning where we are in ADOT and what else you can use. Unsure what else the ask is, for ADOT.

mhausenblas avatar Jun 29 '22 13:06 mhausenblas