Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows - pushin a metric - Error #722

Open
kenderipa opened this issue Jan 22, 2025 · 1 comment
Open

Windows - pushin a metric - Error #722

kenderipa opened this issue Jan 22, 2025 · 1 comment

Comments

@kenderipa
Copy link

Hello,

we're trying to push a sample metric into pushgateway on Windows. We're trying it with three different commands and get three different errors:

Command 1: echo "some_metric_a 200" | Invoke-WebRequest -Uri http://localhost:9091/metrics/job/some_job/instance/some_instance -Method POST

Error 1: Invoke-WebRequest : text format parsing error in line 1: unexpected end of input stream
At line:1 char:28

  • ... ic_a 200" | Invoke-WebRequest -Uri http://localhost:9091/metrics/job/ ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
    • FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

Command 2: curl --data-binary "some_metric 200" http://localhost:9091/metrics/job/some_job

Error 2:Invoke-WebRequest : A positional parameter cannot be found that accepts argument 'some_metric 200'.
At line:1 char:1

  • curl --data-binary "some_metric 200" http://localhost:9091/metrics/jo ...
  •   + CategoryInfo          : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
      + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
    
    
    

Command 3: curl.exe --data-binary "some_metric 200" http://localhost:9091/metrics/job/some_job

Error 3: text format parsing error in line 1: unexpected end of input stream

Could somebody take a look? Thsnk!

@kenderipa kenderipa changed the title Windows - pushin a metric - Windows - pushin a metric - Error Jan 22, 2025
@DimitarTachev
Copy link

In my case, the issue was that the body should end with a new line ('\n').

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants