[Solace-prometheus-exporter] Monitor mqtt broker status

Didy7
Didy7 Member Posts: 7

Hi everyone !

First of all, sorry for my english. I started to use Solace prometheus exporter from solacecommunity. I'am a beginner with all of these things (Solace included).

We use docker-compose to start Solace-broker:
solace-broker:
image: solace/solace-pubsub-standard:9.9.0.23
container_name: solace-broker
# For details about default configuration, see:
# https://docs.solace.com/Configuring-and-Managing/SW-Broker-Specific-Config/SW-Broker-Configuration-Defaults.htm
environment:
- username_admin_globalaccesslevel=xxx
- username_admin_password=xxx
ports:
- 55555:55555 # Solace Message Format (SMF)
- 1883:1883 # MQTT ('default' VPN)
- 8883:8883 # MQTT TLS / SSL('default' VPN)

I just downloaded exporter from here https://github.com/solacecommunity/solace-prometheus-exporter and trying to run it from docker with env.txt file.

This line should help me to link exporter with my broker SOLACE_SCRAPE_URI=http://[ip-of-my-broker]:1883 (here for MQTT ('default' VPN)).

My questions are: why there is 3 ports ? What's the difference ? How could I set SOLACE_SCRAPE_URI for all these ports ?

Because here is my issue:

I have solace_up{error=""} 1for solace-vpn-det but solace_up{error="Get \"http://[ip-of-my-broker]:1883/SEMP\": EOF"} 0 for others (like solace-broker-std).
Well maybe because i set 1883 for SOLACE_SCRAPE_URI

Our purpose is to monitor MQTT broker status.

I know this question may be so stupid, but I would like to improve on these things.

Thank you a lot and happy new year !

Tagged:

Answers

  • uherbst
    uherbst Member, Employee Posts: 129 Solace Employee

    Hi @Didy7,

    Your first question: Why are there so many ports ?
    Solace PubSub+ can handle many protocols at the same time - you can even publish with protocal 1 and subscribe with protocol 2... and all that protocols need different ports.
    For example: You can publish with SMF on port 55555 and consume your messages with MQTT over TLS on port 8883.

    55555 is the default port for the Solace specific messaging format (called SMF). On our homepage there are client-libraries for different programming languages available for SMF.

    1883 is the standard port for plain text MQTT.
    8883 is the standard port for MQTT over TLS.

    Your 2nd question: What does the error from the Solace prometheus exporter mean ?

    Solace brokers have an option to configure and monitor things inside the broker. For this, protocols named "SEMP" and "SEMPv2" are used. Both protocols are HTTP based, both protocols are not used for messaging, but only for managing (conifguring and monitoring) the broker.
    For that you need a different service inside the broker, most often available on port 80 (http plaintext) or 1943 (https). If you set this as your scrape URI that will work.

    Feel free to ask if you have any additional questions.

    Uli

  • Didy7
    Didy7 Member Posts: 7
    edited December 2021 #3

    Hey.

    Thank you for your answer. Wish all the best for the next year !

    Here was I did :

    solace-broker:
    image: solace/solace-pubsub-standard:9.9.0.23
    container_name: solace-broker
    environment:

    • username_admin_globalaccesslevel=xxx
    • username_admin_password=xxx
      ports:

    • 55555:55555 # Solace Message Format (SMF)

    • 1883:1883 # MQTT ('default' VPN)
    • 8883:8883 # MQTT TLS / SSL('default' VPN)
    • 8080:80 # SEMP http

    SOLACE_SCRAPE_URI=http://[broker-ip]:8080

    Result :

    solace_up{error="Get \"http://[broker-ip]:8080/SEMP\": read tcp 172.17.0.2:57812->[broker-ip]:8080: read: connection reset by peer"} 0

    Did i do something wrong ?

    Thank you !

  • uherbst
    uherbst Member, Employee Posts: 129 Solace Employee

    hi @Didy7,

    Let's check:
    Can you access (with curl or wget or browser) http://[broker-ip]:8080 ?

    If not, please try:

    docker exec -it solace cli
    (inside cli): show service
    
    

    There are all services and ports inside the container listed and we expect something like:

    ...
    Service    TP  S C R VRF   MsgVpn          Port  A O Failed Reason
    ---------- --- ----- ----- --------------- ----- --- --------------------------
    SEMP       TCP N - - Mgmt                   8080 U U
    SEMP       TCP Y - - Mgmt                   1943 U U
    
    

    Import here:
    There is "U U" in the line with "SEMP" and "TCP" and "N" (N= no TLS).
    What is port number listed here ?

    Please ensure that you have some port mapping in the docker run command to that port.

    Uli

  • Didy7
    Didy7 Member Posts: 7
    edited January 2022 #5

    Hi @uherbst,

    Thank you for your reply and your patience.

    EDIT: I can access to my broker-ip:8080. They ask for identification.
    I was using the wrong ip address...

    I have the same port number as you.

    SEMP TCP N - - Mgmt 8080 U U
    SEMP TCP Y - - Mgmt 1943 U D No Cert
    ---Press any key to continue, or `q' to quit---

    I'll try with the correct ip.
    I think i need to improve eheh !

    For my solace-broker I use a docker-compose file. 8080 is mapped to 8080 right ?

    55555:55555 # Solace Message Format (SMF)
    1883:1883 # MQTT ('default' VPN)
    8883:8883 # MQTT TLS / SSL('default' VPN)
    8080:8080 # SEMP http

    I have this on my exporter.
    http://0.0.0.0:9628/solace-broker-std

    solace_up{error="Get \"http://[solace-broker]:8080/SEMP\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)"} 0

  • Didy7
    Didy7 Member Posts: 7
    edited January 2022 #6

    I was using the wrong ip for solace-broker. Sorry about that.

    I have the same port :
    SEMP TCP N - - Mgmt 8080 U U
    SEMP TCP Y - - Mgmt 1943 U D No Cert

    This is my docker-compose.yml for my solace-broker.

    55555:55555 # Solace Message Format (SMF)
    1883:1883 # MQTT ('default' VPN)
    8883:8883 # MQTT TLS / SSL('default' VPN)
    8080:8080 # SEMP http

    8080 is mapped on 8080 right ? So my SOLACE_SCRAPE_URI=http://[solace-broker]:8080 should be ok ?

    Now I have this on http://0.0.0.0:9628/solace-broker-std

    solace_up{error="Get \"http://[solace-broker]:8080/SEMP\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)"} 0

    Thank you for your help and for your patience !

  • uherbst
    uherbst Member, Employee Posts: 129 Solace Employee

    Your port mapping looks ok, your SEMP service on 8080 looks ok.

    Have you tried something like:

    curl -v http://[solace-broker]:8080/
    
    

    Any results ?

    Uli

  • Didy7
    Didy7 Member Posts: 7
    edited January 2022 #8

    Here what i have. Hope you can read it. The curl seems working.

    Trying [solace-broker]:8080...
    TCP_NODELAY set
    Connected to [solace-broker] ([solace-broker]) port 8080 (#0)
    GET / HTTP/1.1
    Host: [solace-broker]:8080
    User-Agent: curl/7.68.0
    Accept: /

  • uherbst
    uherbst Member, Employee Posts: 129 Solace Employee

    Hi @Didy7,

    we're getting results :-)

    Obviously:

    • your port mapping in docker is correct
    • your SEMP port is on 8080.

    Just checked the prometheus-exporter....

    your definition should be:

    scrapeUri=http://[solace-broker]:8080/

    (Without trailing "SEMP").

    Uli

  • Didy7
    Didy7 Member Posts: 7
    edited January 2022 #10

    Hi !

    You means the scrapeuri set by my env.txt on solace exporter ?
    Because I have: SOLACE_SCRAPE_URI=http://[solace-broker]:8080
    There is no SEMP there.

    Or maybe are you talking about other thing ?
    To be honest on the solace_up result of my exporter I don't know why there is /SEMP..

  • Didy7
    Didy7 Member Posts: 7

    Hi everybody,

    Is it possible to use the exporter with docker-compose ? How can I do it ?

  • uherbst
    uherbst Member, Employee Posts: 129 Solace Employee

    You can ask those questions directly to the solace-prometheus-community: https://github.com/solacecommunity/solace-prometheus-exporter