<?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 Rey Rahadian on Medium]]></title>
        <description><![CDATA[Stories by Rey Rahadian on Medium]]></description>
        <link>https://medium.com/@rahadianrey?source=rss-d26a530c3e0f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*d8ZAtxOUSNWGnYF9rWRv-A.jpeg</url>
            <title>Stories by Rey Rahadian on Medium</title>
            <link>https://medium.com/@rahadianrey?source=rss-d26a530c3e0f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 13:45:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rahadianrey/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[Sitecore Managed Cloud — How to integrate an observability platform]]></title>
            <link>https://medium.com/@rahadianrey/sitecore-managed-cloud-how-to-integrate-an-observability-platform-eebbbade4c9a?source=rss-d26a530c3e0f------2</link>
            <guid isPermaLink="false">https://medium.com/p/eebbbade4c9a</guid>
            <dc:creator><![CDATA[Rey Rahadian]]></dc:creator>
            <pubDate>Tue, 12 Apr 2022 04:20:24 GMT</pubDate>
            <atom:updated>2022-04-12T04:20:24.321Z</atom:updated>
            <content:encoded><![CDATA[<p>There are several options available to you when you are planning to enable monitoring for Sitecore XM applications that have been deployed to AKS</p><p>- Enable container insights integration in Azure and use Azure Portal to monitor your infrastructure and application health<br><br>- Deploy Prometheus and Grafana to the AKS cluster and manage it yourself<br><br>- Use the monitoring suite provided by Sitecore Managed Cloud (SMC)</p><p>There’s an excellent <a href="https://alessandrofaniuolo.com/2022/03/15/monitoring-sitecore-on-aks-initial-overview/">monitoring series</a> done by Alessandro which I’d recommend for you to check out to better understand the limitation and challenges involved with going with options 1 and 2.</p><p>This post, instead, explores if you go ahead with option 3 and decided that you want to use your existing observability platform to visualize the metrics that SMC provides. The observability platform that I’m using here is DataDog.</p><p>SMC monitoring suite utilizes Prometheus and Grafana, similar to option 2 above, however, Sitecore has done the heavy lifting for you — with the tradeoff of limited customization when you want to have additional metrics supported.</p><p>At a high level, you will need to perform the following to complete the integration</p><p>- Identify observability platform metrics collection process<br><br>- Identify the metrics that you want to push to the observability platform</p><h4>DataDog custom metrics collection process</h4><p>The official DataDog documentation on collecting metrics from Kubernetes can be found at <a href="https://docs.datadoghq.com/agent/kubernetes/?tab=daemonset">https://docs.datadoghq.com/agent/kubernetes/?tab=daemonset</a></p><p>In your SMC application repository, you will need to update the deployment tasks in the main.yaml file in order to include a custom step to deploy the DataDog agents to your AKS cluster.</p><h4>How to identify the metrics that I want to push out?</h4><p>The easiest way to identify these is by checking out the different dashboards in Grafana that SMC has provided. In the example below, I want to push the ingress containers metrics to DataDog so we can notify the team when the application health is affected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/0*PQEzxLjrtiAtCrSh.png" /></figure><p>Once you have identified which dashboard contains the metrics, the next step would be to identify the metric names so that you can leverage DataDog auto-discovery approach for the DataDog agents to pick up the metrics.</p><p>You can do so by inspecting the configuration values of the dashboard itself. For example, for the Ingress overview dashboard above, you can find the configuration value in the “{env}-grafana-dashboard-kubernetes-network” ConfigMap in the monitoring namespace</p><p>{<br><br>“annotations”: {<br><br> “list”: <br><br>},<br><br>“description”: “Dashboard to view multiple servers”,<br><br>“editable”: true,<br><br>“gnetId”: 1856,<br><br>“graphTooltip”: 2,<br><br>“id”: 18,<br><br>“iteration”: 1611921250405,<br><br>“links”: ,<br><br>“panels”: ,<br><br> “spaceLength”: 10,<br><br> “stack”: false,<br><br> “steppedLine”: false,<br><br> “targets”: )) by (le))”,<br><br> “interval”: “”,<br><br> “legendFormat”: “Response Time”,<br><br> “refId”: “A”<br><br> }<br><br> ],<br><br> …<br><br>},<br><br>…<br><br>},<br><br>“timezone”: “browser”,<br><br>“title”: “Ingress Overview”,<br><br>“uid”: “8RXlcDYMk”,<br><br>“version”: 10<br><br>}</p><p>Once we identify the metric names, then we want to include those metrics to be included by DataDog collection agents. See below for an example where I needed to update the annotation of an existing ingress deployment to support DataDog auto-discovery.</p><p>- name: Update Ingress Annotatinons<br><br> k8s: <br><br> state: present<br><br> kind: Deployment<br><br> name: nginx-ingress<br><br> namespace: nginx<br><br> definition: <br><br> spec:<br><br> selector:<br><br> matchLabels:<br><br> app: nginx-ingress<br><br> template:<br><br> metadata:<br><br> labels:<br><br> app: nginx-ingress <br><br> annotations: <br><br> ad.datadoghq.com/nginx-ingress.check_names: |<br><br> <br><br> ad.datadoghq.com/nginx-ingress.init_configs: |<br><br> <br><br> ad.datadoghq.com/nginx-ingress.instances: |<br><br> <br><br> }<br><br> ]</p><p>Within a few minutes, you should be able to confirm that DataDog receives the metrics and you can start visualizing those metrics in DataDog</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/0*IRLHM8EUkG7AssVz.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eebbbade4c9a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Revisiting SonarQube integration 6 months later]]></title>
            <link>https://medium.com/@rahadianrey/revisiting-sonarqube-integration-6-months-later-d4d4ae5638a0?source=rss-d26a530c3e0f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4d4ae5638a0</guid>
            <category><![CDATA[sonarqube]]></category>
            <dc:creator><![CDATA[Rey Rahadian]]></dc:creator>
            <pubDate>Tue, 23 Oct 2018 11:18:08 GMT</pubDate>
            <atom:updated>2018-11-27T10:40:46.864Z</atom:updated>
            <content:encoded><![CDATA[<p>From my previous post on <a href="http://reyrahadian.com/2017/11/01/maintaining-code-quality-with-sonarqube/">SonarQube </a>it’s been more than 6 months and with a few down time here and there since then it’s given me enough time to think about and try out different integration scenarios with our current development workflow.</p><p>There are 2 main integration scenarios that I will recommend for you to try out</p><h4>Continuous Code Quality Monitoring</h4><p>In this integration scenario you run code analysis on your integration/release branch regularly to get feedback on every merged PRs to be able to identify early if there’s a detrimental effect to the current health of your code base.</p><p>I find the following metrics that I set as my Quality Gate in SonarQube to be particularly useful:</p><ul><li>How much code coverage does this repository have? and what’s the minimum threshold should I set?</li><li>Some separation of concern layer is more valuable than others (hint: your Business Logic layer)</li><li>How much code coverage is provided on new codes?</li><li>I find this is helpful in more of a culture and habit situation where you want to nurture good habits and have a culture of striving for a good code quality from your development team</li><li>Set a threshold on the number of major and blocker issues in your project.</li></ul><p>In some cases (I’m thinking of a startup environment or a product focused team) where the team actually considers these metrics to be one of the criterias if the code can be released, they will hook it up with a rotating red lights if the Quality Gate didn’t pass — pretty sure someone did this already :)</p><h4>Automated Bitbucket PR review comments</h4><p>I find this a killer feature depending on the complexity of the software you’re developing. If you’re working with multiple teams and multiple timezones, I find it very crucial to invest on implementing standard and convention through the means of documentation and regular catch up between the key members of the team to ensure architecture consistency and todo technical improvements.</p><p>Now imagine that through the use of static code analysis, you have the power to help enforce the standard through every new PRs that are raised with automated PR review comments from SonarQube.</p><p>SonarQube comes with a decent amount of out-of-the-box code rules which you can leverage and start using for your repository but when it truly shines is when you start building your own custom code analyzer and <strong>turn it into a SonarQube plugin</strong>.</p><p>With the custom code analyzer in place, every time one of your team members in the other side of the earth violates the agreed-upon coding standard, the custom code analyzer can pick it up and warn them, also provide them with either: a description of why it’s considered a violation or a link to your coding standard documentation page.</p><p>The PR reviewer will also have the assurance that SonarQube will run static code analysis to pick up the industry standard practices violation and also your project specific coding standard so you can focus on other areas in the PR</p><p>Think of the following custom code analyzers:</p><ul><li>Sitecore common pitfall analyzers</li><li>Don’t use Sitecore fast query</li><li>Use Sitecore ID instead of field name to get field values</li><li>Don’t use Sitecore axes/descendant API</li><li>etc</li><li>Sitecore Helix architecture analyzers</li><li>Project cannot depend on another project</li><li>Feature cannot depend on another feature</li><li>Foundation cannot depend on Feature</li><li>etc</li><li>Client specific/project specific/repo specific code analyzers</li><li>Stop using “x” pattern in the codebase and instead use “y”</li><li>Define custom analyzer once and distribute it through SonarQube so every developers in your team are aware of it.</li></ul><p>useful links:</p><ul><li><a href="https://github.com/mibexsoftware/sonar-bitbucket-plugin">https://github.com/mibexsoftware/sonar-bitbucket-plugin</a></li><li><a href="https://github.com/SonarSource/sonarqube-roslyn-sdk">https://github.com/SonarSource/sonarqube-roslyn-sdk</a></li><li><a href="https://github.com/Wintellect/Wintellect.Analyzers">https://github.com/Wintellect/Wintellect.Analyzers</a></li><li><a href="https://github.com/reyrahadian/sitecore-code-analyzer">https://github.com/reyrahadian/sitecore-code-analyzer</a></li></ul><h4>Key takeaway</h4><p>A few key takeaway from my musing on SonarQube and code quality.</p><ul><li>The code quality metrics that SonarQube dashboard provided is a great metrics to use as a milestone to drive technical improvements</li><li>The code quality profile in SonarQube for a particular project needs to be regularly reviewed otherwise it’s just noises in the metrics which will never get resolved.</li><li>Custom code analyzer integrated with automated Bitbucket PR review comments are awesome</li><li>It’s a great automated way to enforce standard and make PR review process easier</li></ul><p><em>Originally published at </em><a href="http://reyrahadian.com/2018/10/23/revisiting-sonarqube-integration-6-months-later/"><em>Rey Rahadian</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4d4ae5638a0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sitecore 8 — Create a custom personalization rule]]></title>
            <link>https://medium.com/sitecore-learnings/sitecore-8-create-a-custom-personalization-rule-d3422d4c63ae?source=rss-d26a530c3e0f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3422d4c63ae</guid>
            <category><![CDATA[sitecore]]></category>
            <category><![CDATA[sitecore-content-editor]]></category>
            <category><![CDATA[sitecore-rule-engine]]></category>
            <category><![CDATA[sitecore-how-to]]></category>
            <dc:creator><![CDATA[Rey Rahadian]]></dc:creator>
            <pubDate>Sun, 03 Jul 2016 10:32:11 GMT</pubDate>
            <atom:updated>2018-11-09T10:06:10.822Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3BCn0JxSyZxdnEh7.png" /></figure><p>Sitecore OOTB comes with tons of personalization rules that we can use, however there might be times where we need to create a custom rule condition that fits to the client business requirements.</p><p>Luckily with Sitecore framework that’s known easy to extend, we can easily achieve this.</p><p>Here’s the steps to create a custom personalization rule:</p><p><strong>1.Register the tag</strong></p><p>First of all we need to create a new tag item under /sitecore/system/Settings/Rules/Definitions/Tags</p><figure><img alt="create-custom-personalization-rule-create-tag" src="https://cdn-images-1.medium.com/max/260/0*VGYffjoTTvgZYszG.png" /></figure><p><strong>2. Register a new rule element</strong></p><p>Create a new element folder in /sitecore/system/Settings/Rules/Definitions/Elements</p><figure><img alt="create-custom-personalization-rule-create-element-folder" src="https://cdn-images-1.medium.com/max/300/0*GTym5Z0D9aWX_MFi.png" /></figure><p><strong>3. Create a new personalization condition rule</strong></p><figure><img alt="create-custom-personalization-rule-create-personalization-rule" src="https://cdn-images-1.medium.com/max/300/0*QZNUccJYWsp7cQJm.png" /></figure><p>Here I’m creating a new rule and calling it “Specific Template Name” which will do what exactly that, checking if the current context item is based on a specific template name — not really useful in real world scenario but this post is about how to setup a custom personalization rule :)</p><p>In the newly created rule we need to set the Text and Type fields</p><p>Text field contains the text that we’re going to present to the content author, here’s the following text that I use</p><pre>where the current template name [OperatorId, StringOperator,,compares to] [Value,,,specific value]</pre><p>the [TemplateName, StringOperator,,compares to] represents the format of input that we want to get from the content author. It follows the following format</p><ul><li><strong>OperatorId</strong>, defines the public property of the class where we want to assign the value coming from the content author input</li><li><strong>StringOperator</strong>, the built-in macro that we want to use to get the input from the user. In this case this will be a string comparation operation</li><li><strong>blank</strong>, this parameter will depend on the type of macro that we use, this could be a default text value if we are using the default macro, it could be a default start path if we’re using the Tree macro — think of it like setting a field source when we’re building a template in Sitecore. A full list of macros can be found in /sitecore/system/Settings/Rules/Definitions/Macros</li><li><strong>compares to</strong>, the last parameter is the text representation that we want to show to the content author, this value is clickable and when clicked Sitecore will display the appropriate input control based on the macro that we set on the second parameter</li></ul><p>The Type field is the full assembly name of the custom class that we want to use to perform the logic behind this personalization rule</p><p><strong>4. Assign our custom element default tag definition to our custom tag</strong></p><figure><img alt="create-custom-personalization-rule-assign-element-tag-definition-to-tag" src="https://cdn-images-1.medium.com/max/300/0*sL5YMAdKKnoV0krW.png" /></figure><p>Of course we can assign our custom element tag definition to one of the existing tag under /sitecore/system/Settings/Rules/Definitions/Tags so that it will automatically appear on the content author personalization rule window however if you want to make it obvious which one is your custom ones then I recommend creating your own custom tag and assign it to that</p><p><strong>5. Assign the tag to Conditional Rendering</strong></p><p>The last step to make the rule visible for the content author to choose from is to assign our custom tag to one of default Rules Context folder</p><figure><img alt="create-custom-personalization-rule-assign-tag" src="https://cdn-images-1.medium.com/max/300/0*mfNKVSuB9zTITJPH.png" /></figure><p>From the picture we’re setting the tag to the Conditional Rendering rules context which will appear when the user want to personalize a certain component, but you can also some other Rules Context folders such as FXM ones.</p><p>After we assign the tag, we can verify that the custom personalization rule is available for the content author to choose from</p><figure><img alt="create-custom-personalization-rule-verifying-the-custom-rule-appears" src="https://cdn-images-1.medium.com/max/300/0*IGjwMlTjZGZOcG_A.png" /></figure><p>Here’s the class that’s responsible to evaluate the custom rule condition</p><pre>using Sitecore.Analytics;<br>using Sitecore.Diagnostics;<br>using Sitecore.Rules;<br>using Sitecore.Rules.Conditions;<br><br>namespace Sitecore.Poc.Rules.Conditions<br>{<br>  public class TemplateNameCondition&lt;T&gt; : StringOperatorCondition&lt;T&gt; where T : RuleContext<br>  {<br>    public string Value { get; set; }<br><br>    protected override bool Execute(T ruleContext)<br>    {<br>      Assert.ArgumentNotNull(ruleContext, &quot;ruleContext&quot;);<br>      Assert.IsNotNull(Tracker.Current, &quot;Tracker.Current is not initialized&quot;);<br>      Assert.IsNotNull(Tracker.Current.Session, &quot;Tracker.Current.Session is not initialized&quot;);<br>      Assert.IsNotNull(Tracker.Current.Session.Interaction, &quot;Tracker.Current.Session.Interaction is not initialized&quot;);<br><br>      var currrentItemTemplateName = ruleContext.Item.TemplateName;<br><br>      return Compare(currrentItemTemplateName, Value);<br>    }<br>  }<br>}</pre><p>The class logic is simple and not doing much for the purposes of the tutorial. In a real world scenario you can make a rule that reads from a custom database, read a configuration file, call an external API (be careful with this as it will increase page load time).</p><p>This may sound like a lot of work at first compared to just creating a custom code in the rendering or similar approach. But when we consider that we’re enabling the content author/marketers to do it by themselves and removing/minimizing the dependency towards IT, it would lessen time to market and open up more possibilities for the marketers of what they can do using the platform.</p><p><em>Originally published at </em><a href="http://reyrahadian.com/2016/07/03/sitecore-8-create-a-custom-personalization-rule/"><em>Rey Rahadian</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3422d4c63ae" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sitecore-learnings/sitecore-8-create-a-custom-personalization-rule-d3422d4c63ae">Sitecore 8 — Create a custom personalization rule</a> was originally published in <a href="https://medium.com/sitecore-learnings">Sitecore Learnings</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>