*got "101\r"*

suggests that you're sending a Windows newline (.....\r\n) instead of a 
Unix newline (.....\n), and that pushgateway isn't happy with that.

I don't know if Windows supports some mechanism for inserting explicit 
control sequences, such as
-Body 'metricname1 101\n'
or
echo -ne 'metricname1 101\n'

On Tuesday 5 March 2024 at 05:29:05 UTC Leen Tux wrote:

> I got this error :
> Invoke-WebRequest -Uri '
> http://192.168.1.111:9091/metrics/job/jobname1/instance/instancename1' 
> -Method Post -Body 'metricname1 101' -ContentType 'application/octet-stream'
> *Invoke-WebRequest : text format parsing error in line 1: unexpected end 
> of input stream*
>
> I am facing the same issue here:
>
> https://stackoverflow.com/questions/68818211/send-metrics-with-pushgateway-prometheus-using-windows-console
> But the solution mentioned did not work for me. 
>
> echo "metricname1 101
> " | Invoke-WebRequest -Uri http://192.168.1.111:9091/metrics/job/jobname1 
> -Method POST 
> *Invoke-WebRequest : text format parsing error in line 1: expected float 
> as value,  got "101\r"*
>
> On Monday, March 4, 2024 at 4:21:22 PM UTC+3 Brian Candler wrote:
>
>> https://superuser.com/questions/344927/powershell-equivalent-of-curl
>>
>> On Monday 4 March 2024 at 07:10:18 UTC Leen Tux wrote:
>>
>>> Hi
>>> What is the powershell command equivalent to:
>>> *$ echo 'metricname1 101' | curl --data-binary @- 
>>> http://localhost:9091/metrics/job/jobname1/instance/instancename1 
>>> <http://localhost:9091/metrics/job/jobname1/instance/instancename1>*
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/848609dd-0db9-48a7-b796-6d441371d98cn%40googlegroups.com.

Reply via email to