[java-identity-provider] branch main updated: IDP-2272 Expose LDAP metrics
Rod Widdowson
rdw at steadingsoftware.com
Mon Mar 31 14:03:38 UTC 2025
This is an automated email from the git hooks/post-receive script.
rdw pushed a commit to branch main
in repository java-identity-provider.
View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=0ff071beeea9851a21d9fefe78de47cbe5caeb30
The following commit(s) were added to refs/heads/main by this push:
new 0ff071bee IDP-2272 Expose LDAP metrics
0ff071bee is described below
commit 0ff071beeea9851a21d9fefe78de47cbe5caeb30
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Mon Mar 31 15:01:47 2025 +0100
IDP-2272 Expose LDAP metrics
https://shibboleth.atlassian.net/browse/IDP-2272
Exbed metrics beans from admin-system into their own metrics-system file
---
.../net/shibboleth/idp/conf/admin-system.xml | 124 ------------------
.../net/shibboleth/idp/conf/global-system.xml | 1 +
.../net/shibboleth/idp/conf/metrics-system.xml | 141 +++++++++++++++++++++
3 files changed, 142 insertions(+), 124 deletions(-)
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/admin-system.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/admin-system.xml
index fb774b5e7..464d2347f 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/admin-system.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/admin-system.xml
@@ -13,7 +13,6 @@
default-destroy-method="destroy">
<import resource="conditional:${idp.home}/conf/admin/general-admin.xml" />
- <import resource="${idp.home}/conf/admin/metrics.xml" />
<import resource="conditional:${idp.home}/conf/admin/unlock-keys.xml" />
<!-- Management bean to collect and expose AdministrativeFlowDescriptors. -->
@@ -126,23 +125,6 @@
</property>
</bean>
- <bean parent="shibboleth.AdminFlow"
- c:id="http://shibboleth.net/ns/profiles/metrics"
- p:loggingId="%{idp.metrics.logging:Metrics}"
- p:policyNameLookupStrategy-ref="shibboleth.metrics.AccessPolicyStrategy"
- p:nonBrowserSupported="%{idp.metrics.nonBrowserSupported:false}"
- p:authenticated="%{idp.metrics.authenticated:false}"
- p:resolveAttributes="%{idp.metrics.resolveAttributes:false}">
- <property name="postAuthenticationFlows">
- <bean parent="shibboleth.CommaDelimStringArray"
- c:_0="#{'%{idp.metrics.postAuthenticationFlows:}'.trim()}" />
- </property>
- <property name="defaultAuthenticationMethodsByString">
- <bean parent="shibboleth.CommaDelimStringArray"
- c:_0="#{'%{idp.metrics.defaultAuthenticationMethods:}'.trim()}" />
- </property>
- </bean>
-
<bean parent="shibboleth.AdminFlow"
c:id="http://shibboleth.net/ns/profiles/hello"
p:loggingId="%{idp.hello.logging:Hello}"
@@ -242,112 +224,6 @@
p:issuer="%{idp.admin.entityID:%{idp.entityID}}"
p:nonBrowserSupported="false" />
- <!-- Function for returning custom access control policies for access to metrics. -->
-
- <bean id="shibboleth.metrics.AccessPolicyStrategy" parent="shibboleth.ContextFunctions.Expression"
- c:expression="#custom.get('policyMap').get(#input.getSubcontext(T(net.shibboleth.idp.profile.context.SpringRequestContext)).getRequestContext().getFlowScope().get('metricId')) ?: #custom.get('defaultPolicy')"
- c:outputType="#{T(java.lang.String)}">
- <property name="customObject">
- <map>
- <entry key="policyMap" value-ref="shibboleth.metrics.AccessPolicyMap" />
- <entry key="defaultPolicy" value-ref="shibboleth.metrics.DefaultAccessPolicy" />
- </map>
- </property>
- </bean>
-
- <!-- MetricRegistry we can control with logging categories. -->
- <bean id="shibboleth.metrics.MetricRegistry"
- class="org.opensaml.core.metrics.impl.FilteredMetricRegistry"
- p:metricFilter-ref="shibboleth.metrics.LoggerDrivenMetricFilter" />
-
- <bean id="shibboleth.metrics.LoggerDrivenMetricFilter"
- class="org.opensaml.core.metrics.LoggerDrivenMetricFilter"
- c:_0="metrics."
- c:_1="#{getObject('shibboleth.metrics.MetricLevelMap')}" />
-
- <!-- Parent beans for registering MetricSets and Metrics. -->
-
- <bean id="shibboleth.metrics.RegisterMetricSets" abstract="true"
- class="org.springframework.beans.factory.config.MethodInvokingBean"
- p:targetObject-ref="shibboleth.metrics.MetricRegistry"
- p:targetMethod="registerMultiple" />
-
- <bean id="shibboleth.metrics.RegisterMetric" abstract="true"
- class="org.springframework.beans.factory.config.MethodInvokingBean"
- p:targetObject-ref="shibboleth.metrics.MetricRegistry"
- p:targetMethod="register" />
-
- <bean id="shibboleth.metrics.HTTPReporter" abstract="true" destroy-method="stop"
- class="org.opensaml.core.metrics.impl.HTTPReporter"
- c:registry-ref="shibboleth.metrics.MetricRegistry"
- c:filter="#{null}"
- p:httpClient-ref="shibboleth.InternalHttpClient" />
-
- <!-- Some predefined metric sets, only created if installed by user. -->
-
- <bean id="shibboleth.metrics.CoreGaugeSet" class="org.opensaml.core.metrics.impl.CoreGaugeSet" lazy-init="true" />
-
- <bean id="shibboleth.metrics.ModuleGaugeSet" class="net.shibboleth.idp.module.impl.ModuleGaugeSet" lazy-init="true" />
-
- <bean id="shibboleth.metrics.IdPGaugeSet" class="net.shibboleth.idp.metrics.impl.IdPGaugeSet" lazy-init="true"
- p:exposedProperties="#{getObject('shibboleth.metrics.ExposedProperties')}" />
-
- <bean id="shibboleth.metrics.InstallableComponents"
- class="net.shibboleth.idp.admin.impl.InstallableComponentGaugeSet" lazy-init="true"
- p:idpUpdateUrls-ref="%{idp.updateCheck.urls:shibboleth.IdPUpdateCheckUrls}"
- p:httpClient-ref="%{idp.updateCheck.httpClient:shibboleth.InternalHttpClient}"
- p:securityParams="#{ environment.containsProperty('idp.updateCheck.httpSecurityParameters') ? getObject('idp.updateCheck.httpSecurityParameters') :null}"/>
-
- <bean id="shibboleth.metrics.LoggingGaugeSet"
- class="net.shibboleth.shared.service.ReloadableServiceGaugeSet" lazy-init="true"
- c:metricName="net.shibboleth.idp.logging"
- p:service-ref="shibboleth.LoggingService" />
-
- <bean id="shibboleth.metrics.AccessControlGaugeSet"
- class="net.shibboleth.shared.service.ReloadableServiceGaugeSet" lazy-init="true"
- c:metricName="net.shibboleth.idp.accesscontrol"
- p:service-ref="shibboleth.ReloadableAccessControlService" />
-
- <bean id="shibboleth.metrics.MetadataGaugeSet"
- class="net.shibboleth.idp.saml.metadata.impl.MetadataResolverServiceGaugeSet" lazy-init="true"
- c:metricName="net.shibboleth.idp.metadata"
- p:service-ref="shibboleth.MetadataResolverService" />
-
- <bean id="shibboleth.metrics.RelyingPartyGaugeSet"
- class="net.shibboleth.shared.service.ReloadableServiceGaugeSet" lazy-init="true"
- c:metricName="net.shibboleth.idp.relyingparty"
- p:service-ref="shibboleth.RelyingPartyResolverService" />
-
- <bean id="shibboleth.metrics.NameIdentifierGaugeSet"
- class="net.shibboleth.shared.service.ReloadableServiceGaugeSet" lazy-init="true"
- c:metricName="net.shibboleth.idp.nameid"
- p:service-ref="shibboleth.NameIdentifierGenerationService" />
-
- <bean id="shibboleth.metrics.AttributeRegistryGaugeSet"
- class="net.shibboleth.shared.service.ReloadableServiceGaugeSet" lazy-init="true"
- c:metricName="net.shibboleth.idp.attribute.registry"
- p:service-ref="shibboleth.AttributeRegistryService" />
-
- <bean id="shibboleth.metrics.AttributeResolverGaugeSet"
- class="net.shibboleth.idp.attribute.resolver.impl.AttributeResolverServiceGaugeSet" lazy-init="true"
- c:metricName="net.shibboleth.idp.attribute.resolver"
- p:service-ref="shibboleth.AttributeResolverService" />
-
- <bean id="shibboleth.metrics.AttributeFilterGaugeSet"
- class="net.shibboleth.shared.service.ReloadableServiceGaugeSet" lazy-init="true"
- c:metricName="net.shibboleth.idp.attribute.filter"
- p:service-ref="shibboleth.AttributeFilterService" />
-
- <bean id="shibboleth.metrics.CASServiceRegistryGaugeSet"
- class="net.shibboleth.shared.service.ReloadableServiceGaugeSet" lazy-init="true"
- c:metricName="net.shibboleth.idp.cas.registry"
- p:service-ref="shibboleth.ReloadableCASServiceRegistry" />
-
- <bean id="shibboleth.metrics.ManagedBeanGaugeSet"
- class="net.shibboleth.shared.service.ReloadableServiceGaugeSet" lazy-init="true"
- c:metricName="net.shibboleth.idp.managedbean"
- p:service-ref="shibboleth.ManagedBeanService" />
-
<util:list id="shibboleth.IdPUpdateCheckUrls">
<value>https://shibboleth.net/downloads/identity-provider/plugins/idp-versions.properties</value>
<value>http://plugins.shibboleth.net/idp-versions.properties</value>
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/global-system.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/global-system.xml
index bcf526d91..4b093f63b 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/global-system.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/global-system.xml
@@ -168,6 +168,7 @@
<import resource="subject-c14n-system.xml" />
<import resource="profile-intercept-system.xml" />
<import resource="cas-protocol-system.xml" />
+ <import resource="metrics-system.xml" />
<import resource="admin-system.xml" />
<import resource="primitives.xml" />
<import resource="conditions.xml" />
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/metrics-system.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/metrics-system.xml
new file mode 100644
index 000000000..791652301
--- /dev/null
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/metrics-system.xml
@@ -0,0 +1,141 @@
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:util="http://www.springframework.org/schema/util"
+ xmlns:p="http://www.springframework.org/schema/p"
+ xmlns:c="http://www.springframework.org/schema/c"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
+ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"
+
+ default-init-method="initialize"
+ default-destroy-method="destroy">
+
+ <import resource="${idp.home}/conf/admin/metrics.xml" />
+
+ <bean parent="shibboleth.AdminFlow"
+ c:id="http://shibboleth.net/ns/profiles/metrics"
+ p:loggingId="%{idp.metrics.logging:Metrics}"
+ p:policyNameLookupStrategy-ref="shibboleth.metrics.AccessPolicyStrategy"
+ p:nonBrowserSupported="%{idp.metrics.nonBrowserSupported:false}"
+ p:authenticated="%{idp.metrics.authenticated:false}"
+ p:resolveAttributes="%{idp.metrics.resolveAttributes:false}">
+ <property name="postAuthenticationFlows">
+ <bean parent="shibboleth.CommaDelimStringArray"
+ c:_0="#{'%{idp.metrics.postAuthenticationFlows:}'.trim()}" />
+ </property>
+ <property name="defaultAuthenticationMethodsByString">
+ <bean parent="shibboleth.CommaDelimStringArray"
+ c:_0="#{'%{idp.metrics.defaultAuthenticationMethods:}'.trim()}" />
+ </property>
+ </bean>
+
+ <!-- Function for returning custom access control policies for access to metrics. -->
+
+ <bean id="shibboleth.metrics.AccessPolicyStrategy" parent="shibboleth.ContextFunctions.Expression"
+ c:expression="#custom.get('policyMap').get(#input.getSubcontext(T(net.shibboleth.idp.profile.context.SpringRequestContext)).getRequestContext().getFlowScope().get('metricId')) ?: #custom.get('defaultPolicy')"
+ c:outputType="#{T(java.lang.String)}">
+ <property name="customObject">
+ <map>
+ <entry key="policyMap" value-ref="shibboleth.metrics.AccessPolicyMap" />
+ <entry key="defaultPolicy" value-ref="shibboleth.metrics.DefaultAccessPolicy" />
+ </map>
+ </property>
+ </bean>
+
+ <!-- MetricRegistry we can control with logging categories. -->
+ <bean id="shibboleth.metrics.MetricRegistry"
+ class="org.opensaml.core.metrics.impl.FilteredMetricRegistry"
+ p:metricFilter-ref="shibboleth.metrics.LoggerDrivenMetricFilter" />
+
+ <bean id="shibboleth.metrics.LoggerDrivenMetricFilter"
+ class="org.opensaml.core.metrics.LoggerDrivenMetricFilter"
+ c:_0="metrics."
+ c:_1="#{getObject('shibboleth.metrics.MetricLevelMap')}" />
+
+ <!-- Parent beans for registering MetricSets and Metrics. -->
+
+ <bean id="shibboleth.metrics.RegisterMetricSets" abstract="true"
+ class="org.springframework.beans.factory.config.MethodInvokingBean"
+ p:targetObject-ref="shibboleth.metrics.MetricRegistry"
+ p:targetMethod="registerMultiple" />
+
+ <bean id="shibboleth.metrics.RegisterMetric" abstract="true"
+ class="org.springframework.beans.factory.config.MethodInvokingBean"
+ p:targetObject-ref="shibboleth.metrics.MetricRegistry"
+ p:targetMethod="register" />
+
+ <bean id="shibboleth.metrics.HTTPReporter" abstract="true" destroy-method="stop"
+ class="org.opensaml.core.metrics.impl.HTTPReporter"
+ c:registry-ref="shibboleth.metrics.MetricRegistry"
+ c:filter="#{null}"
+ p:httpClient-ref="shibboleth.InternalHttpClient" />
+
+ <!-- Some predefined metric sets, only created if installed by user. -->
+
+ <bean id="shibboleth.metrics.CoreGaugeSet" class="org.opensaml.core.metrics.impl.CoreGaugeSet" lazy-init="true" />
+
+ <bean id="shibboleth.metrics.ModuleGaugeSet" class="net.shibboleth.idp.module.impl.ModuleGaugeSet" lazy-init="true" />
+
+ <bean id="shibboleth.metrics.LdapAccumulator" class="net.shibboleth.shared.metrics.LDAPMetricAccumulator" lazy-init="true" />
+
+ <bean id="shibboleth.metrics.IdPGaugeSet" class="net.shibboleth.idp.metrics.impl.IdPGaugeSet" lazy-init="true"
+ p:exposedProperties="#{getObject('shibboleth.metrics.ExposedProperties')}" />
+
+ <bean id="shibboleth.metrics.InstallableComponents"
+ class="net.shibboleth.idp.admin.impl.InstallableComponentGaugeSet" lazy-init="true"
+ p:idpUpdateUrls-ref="%{idp.updateCheck.urls:shibboleth.IdPUpdateCheckUrls}"
+ p:httpClient-ref="%{idp.updateCheck.httpClient:shibboleth.InternalHttpClient}"
+ p:securityParams="#{ environment.containsProperty('idp.updateCheck.httpSecurityParameters') ? getObject('idp.updateCheck.httpSecurityParameters') :null}"/>
+
+ <bean id="shibboleth.metrics.LoggingGaugeSet"
+ class="net.shibboleth.shared.service.ReloadableServiceGaugeSet" lazy-init="true"
+ c:metricName="net.shibboleth.idp.logging"
+ p:service-ref="shibboleth.LoggingService" />
+
+ <bean id="shibboleth.metrics.AccessControlGaugeSet"
+ class="net.shibboleth.shared.service.ReloadableServiceGaugeSet" lazy-init="true"
+ c:metricName="net.shibboleth.idp.accesscontrol"
+ p:service-ref="shibboleth.ReloadableAccessControlService" />
+
+ <bean id="shibboleth.metrics.MetadataGaugeSet"
+ class="net.shibboleth.idp.saml.metadata.impl.MetadataResolverServiceGaugeSet" lazy-init="true"
+ c:metricName="net.shibboleth.idp.metadata"
+ p:service-ref="shibboleth.MetadataResolverService" />
+
+ <bean id="shibboleth.metrics.RelyingPartyGaugeSet"
+ class="net.shibboleth.shared.service.ReloadableServiceGaugeSet" lazy-init="true"
+ c:metricName="net.shibboleth.idp.relyingparty"
+ p:service-ref="shibboleth.RelyingPartyResolverService" />
+
+ <bean id="shibboleth.metrics.NameIdentifierGaugeSet"
+ class="net.shibboleth.shared.service.ReloadableServiceGaugeSet" lazy-init="true"
+ c:metricName="net.shibboleth.idp.nameid"
+ p:service-ref="shibboleth.NameIdentifierGenerationService" />
+
+ <bean id="shibboleth.metrics.AttributeRegistryGaugeSet"
+ class="net.shibboleth.shared.service.ReloadableServiceGaugeSet" lazy-init="true"
+ c:metricName="net.shibboleth.idp.attribute.registry"
+ p:service-ref="shibboleth.AttributeRegistryService" />
+
+ <bean id="shibboleth.metrics.AttributeResolverGaugeSet"
+ class="net.shibboleth.idp.attribute.resolver.impl.AttributeResolverServiceGaugeSet" lazy-init="true"
+ c:metricName="net.shibboleth.idp.attribute.resolver"
+ p:service-ref="shibboleth.AttributeResolverService" />
+
+ <bean id="shibboleth.metrics.AttributeFilterGaugeSet"
+ class="net.shibboleth.shared.service.ReloadableServiceGaugeSet" lazy-init="true"
+ c:metricName="net.shibboleth.idp.attribute.filter"
+ p:service-ref="shibboleth.AttributeFilterService" />
+
+ <bean id="shibboleth.metrics.CASServiceRegistryGaugeSet"
+ class="net.shibboleth.shared.service.ReloadableServiceGaugeSet" lazy-init="true"
+ c:metricName="net.shibboleth.idp.cas.registry"
+ p:service-ref="shibboleth.ReloadableCASServiceRegistry" />
+
+ <bean id="shibboleth.metrics.ManagedBeanGaugeSet"
+ class="net.shibboleth.shared.service.ReloadableServiceGaugeSet" lazy-init="true"
+ c:metricName="net.shibboleth.idp.managedbean"
+ p:service-ref="shibboleth.ManagedBeanService" />
+
+</beans>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list