<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Takayuki Konishi on Medium]]></title>
        <description><![CDATA[Stories by Takayuki Konishi on Medium]]></description>
        <link>https://medium.com/@t.konishi?source=rss-e660dad2aa4e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Takayuki Konishi on Medium</title>
            <link>https://medium.com/@t.konishi?source=rss-e660dad2aa4e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 18:45:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@t.konishi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to configure OpenShift Monitoring/Grafana to monitor 3scale]]></title>
            <link>https://medium.com/3scale-ninja-toolbook/how-to-configure-openshift-monitoring-grafana-to-monitor-3scale-f3492e1760de?source=rss-e660dad2aa4e------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3492e1760de</guid>
            <category><![CDATA[openshift-4]]></category>
            <category><![CDATA[3scale]]></category>
            <category><![CDATA[grafana]]></category>
            <dc:creator><![CDATA[Takayuki Konishi]]></dc:creator>
            <pubDate>Wed, 13 Jul 2022 06:52:19 GMT</pubDate>
            <atom:updated>2022-07-13T06:52:19.374Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>This document will walk you through how to configure OpenShift Monitoring/Grafana to monitor 3scale.</p><h3>Environment</h3><ul><li><a href="https://www.openshift.com/products/container-platform">Red Hat OpenShift Container Platform</a> 4.10</li><li><a href="https://www.redhat.com/en/technologies/jboss-middleware/3scale">Red Hat 3scale API Management</a> 2.12</li></ul><h3>Differences from <a href="https://access.redhat.com/documentation/en-us/red_hat_3scale_api_management/2.12/html/operating_3scale/monitoring-threescale">Operating 3scale document</a></h3><p>The document explains how to configure Prometheus via the community Prometheus operator. On the other hand, this article uses OpenShift Monitoring instead of the operator. OpenShift Monitoring includes Prometheus, and the Prometheus UI is integrated into the Monitoring page in the OpenShift console. Although Prometheus custom resource is mandatory when using the community operator, you don’t have to create that in this article.</p><h3>Procedure</h3><h4>Enable monitoring for user-defined projects on OpenShift</h4><ol><li>Create cluster-monitoring-config ConfigMap in openshift-monitoring namespace.</li></ol><pre>apiVersion: v1<br>kind: ConfigMap<br>metadata:<br>  name: cluster-monitoring-config<br>  namespace: openshift-monitoring<br>data:<br>  config.yaml: |<br>    enableUserWorkload: true</pre><p>2. Confirm these pods are running.</p><pre>$ oc get pod -n openshift-user-workload-monitoring<br>NAME                                  READY   STATUS    RESTARTS   AGE<br>prometheus-operator-c7bdc5c48-znvkh   2/2     Running   0          2m26s<br>prometheus-user-workload-0            6/6     Running   0          2m23s<br>thanos-ruler-user-workload-0          3/3     Running   0          2m20s </pre><p><strong>Note:</strong> You can only install either the prometheus-operator or the community one.</p><h4>Deploy Grafana</h4><ol><li>On Operator Hub, install Grafana Operator in the same project as 3scale.</li></ol><p><strong>Note:</strong> The grafana-oprator in OperatorHub can refer to GrafanaDashboard resources only in the same namespace as the grafana-operator for now (<a href="https://issues.redhat.com/browse/THREESCALE-7087?focusedCommentId=19301604&amp;page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-19301604">reference</a>).</p><p><strong>Disclaimer: Unsupported Procedure</strong> <em>The following information has been provided by Red Hat, but is outside the scope of the posted Service Level Agreements and support procedures. The information is provided as-is and unsupported by Red Hat. The intent of this article is to provide information to accomplish the system’s needs. Use of the information in this article at the user’s own risk</em></p><p>2. Create Grafana resource.</p><pre>apiVersion: integreatly.org/v1alpha1<br>kind: Grafana<br>metadata:<br>  name: grafana<br>spec:<br>  config:<br>    auth:<br>      disable_signout_menu: true<br>    auth.anonymous:<br>      enabled: true<br>    log:<br>      level: warn<br>      mode: console<br>    security:<br>      admin_password: secret<br>      admin_user: root<br>  dashboardLabelSelector:<br>    - matchExpressions:<br>        - key: app<br>          operator: In<br>          values:<br>            - 3scale-api-management<br>  ingress:<br>    enabled: true </pre><p>3. Confirm the thanos-querier route in openshift-monitoring.</p><p>$ oc get route -n openshift-monitoring</p><p>4. Add cluster-monitoring-view role to grafana-serviceaccount service account.</p><pre>$ oc project &lt;your 3scale project&gt;<br>$ oc adm policy add-cluster-role-to-user cluster-monitoring-view -z grafana-serviceaccount</pre><p>5. Get access token of grafana-serviceaccount.</p><pre>$ oc serviceaccounts get-token grafana-serviceaccount</pre><p>6. Create Grafana Datasource resource that refers to the thanos-querier service.</p><pre>apiVersion: integreatly.org/v1alpha1<br>kind: GrafanaDataSource<br>metadata:<br>  name: prometheus-grafanadatasource<br>  namespace:  &lt;your 3scale project&gt;<br>spec:<br>  datasources:<br>  - access: proxy<br>    editable: true<br>    isDefault: true<br>    jsonData:<br>      httpHeaderName1: &#39;Authorization&#39;<br>      timeInterval: 5s<br>      tlsSkipVerify: true<br>    name: Prometheus<br>    secureJsonData:<br>      httpHeaderValue1: &#39;Bearer &lt;ACCESS_TOKEN&gt;&#39;<br>    type: prometheus<br>    url: &#39;&lt;https://thanos-querier.openshift-monitoring.route&gt;&#39;<br>  name: prometheus-grafanadatasource.yaml</pre><p><strong>Note:</strong> If you get CORS error like this message, try to use http instead of https for testing purpose and investigate the cause once the connection is confirmed.</p><pre>Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://thanos-querier-openshift-... (Reason: CORS request did not succeed).</pre><h4>Configure monitoring option to APIManager</h4><ol><li>Add monitoring parameter to APIManager.</li></ol><pre>apiVersion: apps.3scale.net/v1alpha1<br>kind: APIManager<br>metadata:<br>  name: apimanager1<br>spec:<br>  wildcardDomain: &lt;apps.example.com&gt;<br>  monitoring:<br>    enabled: true</pre><h4>Confirm OpenShift Monitoring</h4><ol><li>In the Developer perspective, Open Observe → Metrics.</li><li>On the pulldown menu, select Custom Query.</li><li>Enter a PromQL that refers to a 3scale’s metric like this</li></ol><pre>rate(nginx_http_connections{container=&quot;apicast-production&quot;}[1m])</pre><p>4. Confirm the PromQL executed.</p><figure><img alt="PromQL result" src="https://cdn-images-1.medium.com/max/1024/1*nyqQ8ruoPaxLImajaSYMcA.png" /></figure><p>5. Open Alert tab.</p><p>6. Confirm 3scale alerts are listed.</p><figure><img alt="Alert list" src="https://cdn-images-1.medium.com/max/960/1*GxkFaonVFOxlbE4dU7zZtA.png" /></figure><p>7. Send requests to the production APIcast of an API that results in authentication failure.</p><p>8. Confirm ThreescaleApicastHttp4xxErrorRate alert is Pending state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*uKBnrVTLHEZRXRA1JSZVfQ.png" /></figure><p>For more details about alerts, refer to <a href="https://access.redhat.com/documentation/en-us/openshift_container_platform/4.10/html/monitoring/managing-alerts">the OpenShift document</a>.</p><h4>Confirm Grafana</h4><ol><li>Open https://grafana-route-3scale.apps.&lt;ocp base domain&gt;.</li><li>Open the Manage menu.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/217/0*ycC_GNHg9mUJekEq" /></figure><p>3. 3scale dashboards are listed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*ixGO0hXmE05g3Uq_RIysfw.png" /></figure><p>4. For example, click 3scale/ 3scale / Apicast. APIcast dashboard will be displayed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1pAxADHgn4co1vJisA6LQQ.png" /></figure><h3>References</h3><ul><li><a href="https://access.redhat.com/documentation/en-us/red_hat_3scale_api_management/2.12/html/operating_3scale/monitoring-threescale">Monitoring 3scale</a></li><li><a href="https://github.com/3scale/3scale-operator/blob/master/doc/operator-monitoring-resources.md">3scale-operator/operator-monitoring-resources.md</a></li><li><a href="https://access.redhat.com/documentation/en-us/openshift_container_platform/4.10/html/monitoring/enabling-monitoring-for-user-defined-projects">OpenShift Container Platform — Enabling monitoring for user-defined projects</a></li><li><a href="https://access.redhat.com/solutions/5335491">Custom Grafana Dashboard for custom metrics</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3492e1760de" width="1" height="1" alt=""><hr><p><a href="https://medium.com/3scale-ninja-toolbook/how-to-configure-openshift-monitoring-grafana-to-monitor-3scale-f3492e1760de">How to configure OpenShift Monitoring/Grafana to monitor 3scale</a> was originally published in <a href="https://medium.com/3scale-ninja-toolbook">3scale-ninja-toolbook</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>