open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
2.9k stars 2.27k forks source link

vcenter data collection is not happening #34958

Open vishnu-k1 opened 1 week ago

vishnu-k1 commented 1 week ago

Component(s)

No response

What happened?

Description

I used vcenter receiver to pull data from vcenter data for monitoring but it endsup with error and terminating the collector from running.

Steps to Reproduce

Expected Result

vcenter datacollection

Actual Result

panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0xe8 pc=0x382497e]

goroutine 95 [running]: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcenterreceiver.(vcenterMetricScraper).buildVMMetrics(0xc001da4660, 0x17f15d72807f6040, 0xc001e498c8, 0xc003206988, 0xc002397a60?) github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcenterreceiver@v0.108.0/processors.go:310 +0x1de github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcenterreceiver.(vcenterMetricScraper).processVMs(0xc001da4660, 0x17f15d72807f6040, 0xc001e498c8, 0xc002b80840, 0xc002397850, 0xc002397cd0) github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcenterreceiver@v0.108.0/processors.go:228 +0xfb github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcenterreceiver.(vcenterMetricScraper).processDatacenterData(0xc001da4660, 0xc001e498c8, 0xc002397cd0) github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcenterreceiver@v0.108.0/processors.go:41 +0x25d github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcenterreceiver.(vcenterMetricScraper).scrapeAndProcessAllMetrics(0xc001da4660, {0x56df948, 0xc001e133e0}, 0xc002397cd0)

Collector version

108

Environment information

Environment

OS: (e.g., "Ubuntu 20.04") Compiler(if manually compiled): (e.g., "go 14.2") RHEL 9.4 go 1.22

OpenTelemetry Collector configuration

receivers:

    vcenter:
      endpoint: 'https://kmga001.dryicelabs.com/'
      username: 'svc-vc-readonly'
      password: 'wwwww'
      collection_interval: 5m
      initial_delay: 1s
      tls:
        insecure: true
      metrics:
       vcenter.host.cpu.utilization:
        enabled: false

processors:
  metricstransform:
   transforms:
    include: ^system
    match_type: regexp
    action: update
    operations:
        - action: add_label
          new_label: host.name
          new_value: "SC009"
        - action: add_label
          new_label: os.type
          new_value: "RHEL"
        - action: add_label
          new_label: os.version
          new_value: "RHEL 9.4"
        - action: add_label
          new_label: host.ip
          new_value: "10.1.1.77"

  batch:
    send_batch_size: 3

exporters:
 otlp/data-prepper:
  endpoint: "http://10.1.180.221:21891"
  tls:
    insecure: true

 file:
  path: '/tmp/incoming_to_otel.json'
 debug:
  verbosity: detailed
service:
 pipelines:

   metrics/vc:
    receivers: [vcenter]
    exporters: [otlp/data-prepper]

Log output

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0xe8 pc=0x382497e]

goroutine 95 [running]:
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcenterreceiver.(*vcenterMetricScraper).buildVMMetrics(0xc001da4660, 0x17f15d72807f6040, 0xc001e498c8, 0xc003206988, 0xc002397a60?)
        github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcenterreceiver@v0.108.0/processors.go:310 +0x1de
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcenterreceiver.(*vcenterMetricScraper).processVMs(0xc001da4660, 0x17f15d72807f6040, 0xc001e498c8, 0xc002b80840, 0xc002397850, 0xc002397cd0)
        github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcenterreceiver@v0.108.0/processors.go:228 +0xfb
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcenterreceiver.(*vcenterMetricScraper).processDatacenterData(0xc001da4660, 0xc001e498c8, 0xc002397cd0)
        github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcenterreceiver@v0.108.0/processors.go:41 +0x25d
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcenterreceiver.(*vcenterMetricScraper).scrapeAndProcessAllMetrics(0xc001da4660, {0x56df948, 0xc001e133e0}, 0xc002397cd0)

Additional context

No response

Frapschen commented 1 week ago

Pinging code owners: @djaglowsk, @schmikei, @StefanKurek

github-actions[bot] commented 1 week ago

Pinging code owners for receiver/vcenter: @djaglowski @schmikei @StefanKurek. See Adding Labels via Comments if you do not have permissions to add labels yourself.

StefanKurek commented 1 week ago

Hello. This seems to imply that you weren't able to pull the config info for a VM which seems odd. Any reason that your user's permissions wouldn't allow this?