Metrics in Keycloak x

280 views
Skip to first unread message

Bursuc Andrei

unread,
Feb 1, 2021, 4:23:41 PM2/1/21
to Keycloak User
Hello,

I know that Keycloak.X is still in preview but just wanted to ask if is possible right now to enable metrics using `kc.sh config --metrics-enabled=true` or using an environment variable?
 I tried both ways and it did not work, but I was able to enable them through the "keycloak.properties" file (I added the property `metrics.enabled=true` in the config).

Thank you,
Andrei

Pedro Igor Craveiro e Silva

unread,
Feb 1, 2021, 7:56:07 PM2/1/21
to Bursuc Andrei, Keycloak User
Hi,

Yes. It should be possible. Could you please file a JIRA. I'm going to look at another issue related to metrics and I can take the opportunity and look at this one too.

Any property you define via properties should have its corresponding CLI argument (respecting the format defined in the design document).

Regards.
Pedro Igor

--
You received this message because you are subscribed to the Google Groups "Keycloak User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keycloak-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/keycloak-user/f3ce85e9-0534-41c4-8782-abb91b0a1df6n%40googlegroups.com.

Bursuc Andrei

unread,
Feb 2, 2021, 5:18:31 AM2/2/21
to Keycloak User

Hello,


Thank you,
Andrei

Meissa M'baye Sakho

unread,
Mar 12, 2021, 4:41:42 AM3/12/21
to Bursuc Andrei, Keycloak User
Hi Bursuc,
I've tested it successfully with the config option.
1) First configure it via config command to enable the metrics
./kc.sh config --db=postgres  --http-enabled=true --metrics-enabled=true
2) start the server
./kc.sh

It works fine that way.
Here are the environment variables I've defined prior to starting the server:
#!/bin/bash
export KC_DB_URL=jdbc:postgresql://localhost:5432/keycloak
export KC_DB_USERNAME=keycloak
export KC_DB_PASSWORD=keycloak
export KC_HTTP_ENABLED=true
#export KC_METRICS_ENABLED=true
export KEYCLOAK_ADMIN=admin
export KEYCLOAK_ADMIN_PASSWORD=admin



-
Meissa SakhoRHCA

Senior Architect

Red Hat EMEA

msa...@redhat.com   
M: +33-6-9559-7778    




Reply all
Reply to author
Forward
0 new messages