discourse / prometheus_exporter

A framework for collecting and aggregating prometheus metrics
MIT License
525 stars 153 forks source link

Instrumenting Worker Process: undefined method `hostname' for PrometheusExporter:Module #282

Open FinnIckler opened 1 year ago

FinnIckler commented 1 year ago

Hi!

I've got a custom worker process that is running separately from my Rails API (just under ruby). When I try adding

PrometheusExporter::Instrumentation::Process.start(type: WORKER_NAME, labels: { process: PROCESS_NUMBER })

I get the error

ERROR -- : PrometheusExporter::Instrumentation::Process Prometheus Exporter Failed To Collect Stats undefined method 'hostname' for PrometheusExporter:Module

Does this mean I cannot use PrometheusExporter::Instrumentation::Process for processes that do not have a hostname attached to them? Custom metrics still work fine.

Thanks for the help, Finn