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

Actuator prometheus endpoint always returns zero appCrashes #536

Open
adambondarzewski opened this issue Nov 7, 2024 · 3 comments
Open
Labels

Comments

@adambondarzewski
Copy link

adambondarzewski commented Nov 7, 2024

I've configured Shinyproxy actuator endpoint, to get Usage Statistics following the official readme.

Then I've checked localhost:9090/actuator/prometheus and I've noticed that appCrash_total counter continues to show 0.0 even though I delibaretely crashed the app several times to check the setup. The crashes resulted in greying the app and stopping the app container. In the same time, other statistics like absolute_users_logged_in or startFailed_total are correct:

# HELP appCrashes_total  
# TYPE appCrashes_total counter
appCrashes_total{shinyproxy_instance="5f79677a427ad7226f7a97995600a89a528e9906",shinyproxy_realm="",spec_id="myapp",} 0.0
# HELP startFailed_total  
# TYPE startFailed_total counter
startFailed_total{shinyproxy_instance="5f79677a427ad7226f7a97995600a89a528e9906",shinyproxy_realm="",spec_id="myapp",} 5.0

Am I missing something obvious?

My application.yaml:

proxy:
  title:
  favicon-path: favicon.png
  landing-page: /app/myapp
  heartbeat-rate: 1000000
  heartbeat-timeout: 6000000
  container-wait-time: 240000
  port: 8080
  hide-navbar: true
  authentication: openid
  openid:
  ...
  docker:
    internal-networking: true
  specs:
      ...
      container-cmd:
        [
          "R",
          "-s",
          "-e",
          "library(shiny); library(shinyjs); library(shinydashboard); library(readr); library(magrittr); library(dplyr); myApp::start(options=list(host='0.0.0.0', port = 3838L))",
        ]
  usage-stats-url: micrometer
server:
  servlet.session.timeout: 0
  servlet.context-path: ${CONTEXT_PATH:-/}
  forward-headers-strategy: native
  secureCookies: ${SECURE_COOKIE}
management:
  prometheus:
    metrics:
      export:
        enabled: true
@LEDfan
Copy link
Member

LEDfan commented Nov 12, 2024

Hi, the appCrash_total metric will only be increased if ShinyProxy is aware of the crash. In this case, ShinyProxy shows the following screen:

image

and also logs this message:

Proxy unreachable/crashed, stopping it now, failed request: GET ...

Can you confirm whether you see this behavior?

@adambondarzewski
Copy link
Author

adambondarzewski commented Nov 12, 2024

Thanks for the response! Indeed I don't see this screen. Just greying the app and error message in the app container logs.

@adambondarzewski
Copy link
Author

I've double checked and I can confirm that I don't see the "This app has crashed..." screen nor any indication in shinyproxy logs. Last log is something like

2024-11-13T11:27:42.608Z  INFO 9 --- [ProxyService-15] e.o.containerproxy.service.ProxyService  : [[email protected] proxyId=35bd385c-7b08-4921-bafe-13759239adef specId=myapp] Proxy activated

Could you please advice how to make shinyproxy aware of the crashes? I'm using a setup with docker (one container per user, without preinitialization). The container is still up after the crash. I just see error message in the app container logs.

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

No branches or pull requests

2 participants