Coder Social home page Coder Social logo

Comments (7)

gjasny avatar gjasny commented on September 27, 2024

Hello,

Iā€˜m puzzled because we explicitly write HTTP 1.1 versioned responses. Which Ubuntu version do you use?

Thanks,
Gregor

from prometheus-cpp.

gjasny avatar gjasny commented on September 27, 2024

Could you please run curl with -v and copy the headers of the failed request and response here?

from prometheus-cpp.

InfiniteLife avatar InfiniteLife commented on September 27, 2024

Ubuntu 22.04.4 LTS.

curl -v http://127.0.0.1:9090/metrics
*   Trying 127.0.0.1:9090...
* Connected to 127.0.0.1 (127.0.0.1) port 9090 (#0)
> GET /metrics HTTP/1.1
> Host: 127.0.0.1:9090
> User-Agent: curl/7.81.0
> Accept: */*
> 
* Received HTTP/0.9 when not allowed
* Closing connection 0
curl: (1) Received HTTP/0.9 when not allowed
curl -v --http0.9  http://127.0.0.1:9090/metrics
*   Trying 127.0.0.1:9090...
* Connected to 127.0.0.1 (127.0.0.1) port 9090 (#0)
> GET /metrics HTTP/1.1
> Host: 127.0.0.1:9090
> User-Agent: curl/7.81.0
> Accept: */*
> 
# HELP exposer_transferred_bytes_total Transferred bytes to metrics services
# TYPE exposer_transferred_bytes_total counter
exposer_transferred_bytes_total 1612
# HELP exposer_scrapes_total Number of times metrics were scraped
# TYPE exposer_scrapes_total counter
exposer_scrapes_total 2
# HELP exposer_request_latencies Latencies of serving scrape requests, in microseconds
# TYPE exposer_request_latencies summary
exposer_request_latencies_count 2
exposer_request_latencies_sum 694
exposer_request_latencies{quantile="0.5"} 338
exposer_request_latencies{quantile="0.9"} 338
exposer_request_latencies{quantile="0.99"} 338

from prometheus-cpp.

InfiniteLife avatar InfiniteLife commented on September 27, 2024

Could be related, I have also running mongoose webserver on different port in the same app. When I make curl request mongoose seems to be logging some stuff I dont understand:

57660acf 1 mongoose.c:2840:mg_iobuf_res 0->39041252766682
57660acf 1 mongoose.c:2840:mg_iobuf_res 0->39041252766682

Here is function in mongoose.c:

int mg_iobuf_resize(struct mg_iobuf *io, size_t new_size) {
  int ok = 1;
  new_size = roundup(new_size, io->align);
  if (new_size == 0) {
    mg_bzero(io->buf, io->size);
    free(io->buf);
    io->buf = NULL;
    io->len = io->size = 0;
  } else if (new_size != io->size) {
    // NOTE(lsm): do not use realloc here. Use calloc/free only, to ease the
    // porting to some obscure platforms like FreeRTOS
    void *p = calloc(1, new_size);
    if (p != NULL) {
      size_t len = new_size < io->len ? new_size : io->len;
      if (len > 0 && io->buf != NULL) memmove(p, io->buf, len);
      mg_bzero(io->buf, io->size);
      free(io->buf);
      io->buf = (unsigned char *) p;
      io->size = new_size;
    } else {
      ok = 0;
      MG_ERROR(("%lld->%lld", (uint64_t) io->size, (uint64_t) new_size)); // 2840 line here
    }
  }
  return ok;
}

from prometheus-cpp.

InfiniteLife avatar InfiniteLife commented on September 27, 2024

I rebuilded my app without creating web server with mongoose, but still am having same log output from mongoose. This gave me suspicion that something smelly goes on in linking, so I completely removed mongoose dependency files from building process. And viola, curl works as it supposed to:


curl -v http://127.0.0.1:9090/metrics
*   Trying 127.0.0.1:9090...
* Connected to 127.0.0.1 (127.0.0.1) port 9090 (#0)
> GET /metrics HTTP/1.1
> Host: 127.0.0.1:9090
> User-Agent: curl/7.81.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Type: text/plain; charset=utf-8
< Content-Length: 804
< 

So its definetely linking. But I need that web server on other port too..

from prometheus-cpp.

gjasny avatar gjasny commented on September 27, 2024

I believe civetweb is a fork of mongoose. They share the same symbols and must not be mixed within a process.

from prometheus-cpp.

InfiniteLife avatar InfiniteLife commented on September 27, 2024

I see. Is there any docs/example on how to make Exposer use different web server? Like mongoose in this case.

from prometheus-cpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.