Comments (7)
Hello,
Iām puzzled because we explicitly write HTTP 1.1 versioned responses. Which Ubuntu version do you use?
Thanks,
Gregor
from prometheus-cpp.
Could you please run curl with -v
and copy the headers of the failed request and response here?
from prometheus-cpp.
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.
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.
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.
I believe civetweb is a fork of mongoose. They share the same symbols and must not be mixed within a process.
from prometheus-cpp.
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)
- Bazel workspace integration example does not seem to be viable HOT 1
- about Registry::Add some question HOT 2
- [Notice]: the CMake version need to be higher than 3.19 HOT 2
- CheckMetricName HOT 2
- build error `bin/prometheus_push_internal_test` with ubuntu 20.04 and 22.04 HOT 5
- benchmark missing `UseManualTime` HOT 1
- Native support for sidecar container process HOT 1
- Observing Segmentation fault during counter metric collection. HOT 5
- Compilation issue on CentOS HOT 2
- linker error while compiling example cpp program HOT 18
- grafana cannot validate data source HOT 1
- Use with boost::beast Webserver HOT 2
- bzlmod issue HOT 1
- How to turn of the output? HOT 1
- Add async/callback mode to instruments? HOT 3
- Installing on ubuntu 22.04 HOT 5
- Publish to BCR ? HOT 3
- Use civetweb module
- bazel build sample error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prometheus-cpp.