<!--
  ~ Copyright The WildFly Authors
  ~ SPDX-License-Identifier: Apache-2.0
  -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           targetNamespace="urn:wildfly:micrometer:community:2.0"
           xmlns="urn:wildfly:micrometer:community:2.0"
           elementFormDefault="qualified"
           version="2.0">

    <!-- The subsystem root element -->
    <xs:element name="subsystem">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="otlp-registry" minOccurs="0">
                    <xs:complexType>
                        <xs:attribute name="endpoint" type="xs:string">
                            <xs:annotation>
                                <xs:documentation>
                                    The URL of the OTLP collector to which metrics will be published.
                                </xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="step" type="xs:int" default="60">
                            <xs:annotation>
                                <xs:documentation>
                                    The step size (reporting frequency) to use in seconds.
                                </xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                    </xs:complexType>
                </xs:element>
                <xs:element name="prometheus-registry" minOccurs="0">
                    <xs:complexType>
                        <xs:attribute name="context" type="xs:string">
                            <xs:annotation>
                                <xs:documentation>
                                    The context root from which to serve Prometheus metrics (e.g., "/metrics" or "/prometheus")
                                </xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="security-enabled" type="xs:boolean" default="false">
                            <xs:annotation>
                                <xs:documentation>
                                    Whether the context should be secured
                                </xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>

            <xs:attribute name="exposed-subsystems" type="xs:string" default="[&quot;*&quot;]">
                <xs:annotation>
                    <xs:documentation>
                        The names of the WildFly subsystems that exposes their metrics (or '*' to expose any subsystem metrics).
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>
    </xs:element>
</xs:schema>
