ricoberger/script_exporter

Not displayed any output of python script on Windows

ldrahnik opened this issue · 1 comments

I have a problem seeing any output, trying on Windows:

executing like

$ ./script_exporter-windows-amd64.exe
ts=2024-03-18T20:05:21.736Z caller=exporter.go:136 level=info msg="Starting scrpt_exporter" version="(version=v2.18.0, branch=HEAD, revision=ebeaf9415eb13c14db809cfbe8ff06e7465b0bd)"
ts=2024-03-18T20:05:21.736Z caller=exporter.go:137 level=info msg="Build contex" build_context="(go=go1.21.6, user=runner, date=20240210-12:39:39)"
ts=2024-03-18T20:05:21.736Z caller=exporter.go:138 level=info msg="Listening on:9469"

config

scripts:
  - name: hokus
    script: python C:\Users\..\script.py

script.py

#!/usr/bin/env python

print("i am printing nothing")
# HELP script_success Script exit status (0 = error, 1 = success).
# TYPE script_success gauge
script_success{script="hokus"} 1
# HELP script_duration_seconds Script execution time, in seconds.
# TYPE script_duration_seconds gauge
script_duration_seconds{script="firebird"} 0.548011
# HELP script_exit_code The exit code of the script.
# TYPE script_exit_code gauge
script_exit_code{script="hokus"} 0

What I do wrong?

#!/usr/bin/env python

print("metric_without_timestamp_and_labels 12.47")

does work.