Issue in getting Open telemetry Host Metrics data in local Grafana server's dashboard

What happened?
*Option 1 *While using opentelemetry (Hostmetrics receiver), local prometheus server (as exporter) and Grafana, I am not getting the metrics.

*Option 2 *But while using opentelemetry (Hostmetrics receiver),Grafana lab inbuilt prometheus server (as exporter) and Grafana, I am able to see the metrics.

What was expected to happen?
We should be able to see the metrics in Grafana using option 1

Version numbers :
prometheus-2.40.3.windows-amd64
OPTEL version: v0.66.0

Challenge:
Can’t use Grafana lab, instead have to use local grafana server for this POC so using local prometheus server as the exporter

Optel Config

receivers:

hostmetrics:
collection_interval: 20s
scrapers:
cpu:
metrics:
system.cpu.utilization:
enabled: true
'# system.cpu.time:
'# enabled: true
'# load:
'# memory:
'# metrics:
'# system.memory.utilization:
'# enabled: true
'# system.memory.usage:
'# enabled: true
'# paging:
'# metrics:
'# system.paging.utilization:
'# enabled: true
'# system.paging.usage:
'# enabled: true
'# system.paging.faults:
'# enabled: true
'# system.paging.operations:
'# enabled: true
'# filesystem:
'# metrics:
'# system.filesystem.utilization:
'# enabled: true
'# system.filesystem.usage:
'# enabled: true
'# disk:
'# metrics:
'# system.disk.io:
'# enabled: true
'# system.disk.operations:
'# enabled: true
'# system.disk.io_time:
'# enabled: true
'# system.disk.operation_time:
'# enabled: true
'# system.disk.merged:
'# enabled: true
'# network:
'# metrics:
'# system.network.dropped:
'# enabled: true
'# system.network.packets:
'# enabled: true
'# system.network.errors:
'# enabled: true
'# system.network.io:
'# enabled: true
'# system.network.connections:
'# enabled: true
'# processes:
'# metrics:
'# system.processes.count:
'# enabled: true
'# system.processes.created:
'# enabled: true

processors:
'# batch:
'# send_batch_size: 50
'# timeout: 5s
'# memory_limiter:
'# check_interval: 2s
'# limit_mib: 1800
metricstransform:
’ # transforms is a list of transformations with each element transforming a metric selected by metric name
transforms:
- include: system.cpu.utilization
action: update
new_name: system_cpu_utilization

exporters:
file:
path: C:/Users/oatazureuser/Exportlogfile.json

prometheus:
'# endpoint: ******/api/prom/push
endpoint: “localhost:9090”
namespace: test-space
send_timestamps: true
resource_to_telemetry_conversion:
enabled: true

service:
pipelines:
metrics:
receivers: [hostmetrics]
processors: [metricstransform]
exporters: [file,prometheus]

Prometheus Config
'# my global config
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
’ # scrape_timeout is set to the global default (10s).

'# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
'# - alertmanager:9093

'# Load rules once and periodically evaluate them according to the global ‘evaluation_interval’.
rule_files:
’ # - “first_rules.yml”
’ # - “second_rules.yml”

'# A scrape configuration containing exactly one endpoint to scrape:
'# Here it’s Prometheus itself.
scrape_configs:
’ # The job name is added as a label job=<job_name> to any timeseries scraped from this config.

  • job_name: “Optel”

’ # metrics_path defaults to ‘/metrics’
’ # scheme defaults to ‘http’.

’ static_configs:
- targets: [“168.62.62.198:8888”]