Giter Site home page Giter Site logo

Comments (8)

jukkar avatar jukkar commented on September 26, 2024 1

Thanks, I fixed it before I saw your offer. Anyway, please try the PR and see if it works for you.

from zephyr.

github-actions avatar github-actions commented on September 26, 2024

Hi @mustafaabdullahk! We appreciate you submitting your first issue for our open-source project. 🌟

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙

from zephyr.

jukkar avatar jukkar commented on September 26, 2024

@mustafaabdullahk Is there an easy way to replicate the issue? To me it looks like we might run out of network buffers at some point. Are you running plain http_sample as you seem to have the prometheus support enabled. What does your prj.conf file look like?

from zephyr.

mustafaabdullahk avatar mustafaabdullahk commented on September 26, 2024

@jukkar Can be used mustafaabdullahk:mustafaabdullahk/prometheus-library branch directly. I did use samples/net/sockets/http_server prj.conf just one diff. I did add just CONFIG_PROMETHEUS.

# General config
CONFIG_MAIN_STACK_SIZE=3072
CONFIG_SHELL=y
CONFIG_LOG=y
CONFIG_ENTROPY_GENERATOR=y
CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_INIT_STACKS=y
CONFIG_POSIX_MAX_FDS=32
CONFIG_POSIX_API=y
CONFIG_FDTABLE=y
CONFIG_NET_SOCKETS_POLL_MAX=32
CONFIG_REQUIRES_FULL_LIBC=y
CONFIG_HEAP_MEM_POOL_SIZE=2048

# Prometheus
CONFIG_PROMETHEUS=y

# Eventfd
CONFIG_EVENTFD=y

# Networking config
CONFIG_NETWORKING=y
CONFIG_NET_IPV4=y
CONFIG_NET_IPV6=y
CONFIG_NET_TCP=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_CONNECTION_MANAGER=y
CONFIG_NET_SHELL=y
CONFIG_NET_LOG=y
CONFIG_NET_DHCPV4=y

# JSON
CONFIG_JSON_LIBRARY=y

# HTTP parser
CONFIG_HTTP_PARSER_URL=y
CONFIG_HTTP_PARSER=y
CONFIG_HTTP_SERVER=y
CONFIG_HTTP_SERVER_WEBSOCKET=y
CONFIG_HTTP_SERVER_MAX_CONTENT_TYPE_LENGTH=128

# Network buffers
CONFIG_NET_PKT_RX_COUNT=16
CONFIG_NET_PKT_TX_COUNT=16
CONFIG_NET_BUF_RX_COUNT=128
CONFIG_NET_BUF_TX_COUNT=128
CONFIG_NET_CONTEXT_NET_PKT_POOL=y

# IP address options
CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT=3
CONFIG_NET_IF_MCAST_IPV6_ADDR_COUNT=4
CONFIG_NET_MAX_CONTEXTS=32
CONFIG_NET_MAX_CONN=32

# Network address config
CONFIG_NET_CONFIG_SETTINGS=y
CONFIG_NET_CONFIG_NEED_IPV4=y
CONFIG_NET_CONFIG_NEED_IPV6=y
CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.0.2.1"
CONFIG_NET_CONFIG_PEER_IPV4_ADDR="192.0.2.2"
CONFIG_NET_CONFIG_MY_IPV4_GW="192.0.2.2"
CONFIG_NET_CONFIG_MY_IPV6_ADDR="2001:db8::1"
CONFIG_NET_CONFIG_PEER_IPV6_ADDR="2001:db8::2"

# TLS configuration
CONFIG_MBEDTLS=y
CONFIG_MBEDTLS_BUILTIN=y
CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_HEAP_SIZE=60000
CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=2048
CONFIG_NET_SOCKETS_SOCKOPT_TLS=y
CONFIG_NET_SOCKETS_TLS_MAX_CONTEXTS=6
CONFIG_TLS_CREDENTIALS=y
CONFIG_TLS_MAX_CREDENTIALS_NUMBER=5

# Networking tweaks
# Required to handle large number of consecutive connections,
# e.g. when testing with ApacheBench.
CONFIG_NET_TCP_TIME_WAIT_DELAY=0

from zephyr.

jukkar avatar jukkar commented on September 26, 2024

I took your branch and I am assuming you mean the samples/net/prometheus sample application, and not the http-server one, as the latter does not have /metrics resource handler in it?
By using the prometheus sample, I can connect to /metrics but it seems to work just fine with simple curl -o /tmp/file.out http://192.0.2.1/metrics command. How are you querying the data from the server?

from zephyr.

mustafaabdullahk avatar mustafaabdullahk commented on September 26, 2024

Yes i missed point, mean samples/net/prometheus. Can you see following content:

image

my curl output:

image

excepted output:

http_request_counter{http_request="request_count"} 6

wireshark packet detail:

image

last git activities:

image

from zephyr.

jukkar avatar jukkar commented on September 26, 2024

Thanks, I could replicate the issue, investigating...

from zephyr.

mustafaabdullahk avatar mustafaabdullahk commented on September 26, 2024

Your welcome, i apply some patch for solve issue and working. If you want to i create pull request for that, I can.

from zephyr.

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.