open-telemetry / opentelemetry-collector

OpenTelemetry Collector

Home Page:https://opentelemetry.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Godwinmoses93 opened this issue · comments

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.

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

@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.

@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 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 , 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 ?

@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 - aws-observability/aws-otel-collector#740
aws-observability/aws-otel-collector#1287

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

Thanks in advance.

@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.

Could you provide the logs of your collector?

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

ADOT PM here. I did comment on aws-observability/aws-otel-collector#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.