0

I am trying to run the opentelemetry exporter remote write example on this site: https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/exporter/opentelemetry-exporter-prometheus-remote-write/example/sampleapp.py

I have replaced the endpoint="http://cortex:9009/api/prom/push" with localhost address: http://localhost:9009

I am getting the below error while running the code:

ERROR:opentelemetry.exporter.prometheus_remote_write:Export POST request failed with reason: HTTPConnectionPool(host='localhost', port=9009): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000025E86679A90>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))

I have not started the prometheus server with prometheus.yml config which looks something like this:

global:
  scrape_interval: 1s
  evaluation_interval: 1s
scrape_configs:
  - job_name: "otel"
    static_configs:
      - targets: ["localhost:9009"]

I also tried by starting the server then running but again same error. Can anyone solve the error and also tell me if starting the server is required to run the program (I have tried both but getting same error) I am using Windows 10 machine

0 Answers0