Welcome to the CNCF's online program. Today's on-demand webinar is how to start with Prometheus using Prometheus I.O. I am Jesús Amitier, Senior Software Engineer at Cystic. Thank you for joining me today. In this video, you'll learn how to start monitoring your applications in Kubernetes with Prometheus and Prometheus I.O. PromCAD is an open-source online catalog that offers a curated list of Prometheus resources, dashboards and alerts, so you can start monitoring your applications in Kubernetes in no time. Prometheus has become the de facto standard for monitoring cloud-native applications. In fact, Kubernetes exposes its own metrics in Prometheus format. So it's like a no-brainer when choosing the right application to monitor your cloud-native applications. The thing is, where does Prometheus get its metrics from? I know everyone here is aware of what's Prometheus and everything, but let's do a quick catch-up. Prometheus doesn't get the metrics like other more traditional monitoring solutions. Instead of sending metrics to the Prometheus server, the Prometheus server scripts the metrics directly from the applications, from all the containers running the different applications. So every application needs to expose its metrics so Prometheus can go to those metrics and ingest them. That's the main difference between Prometheus and other more traditional solutions. The first thing you need to search when starting your journey with Prometheus is you might think you need an exporter, but what if you don't? Prometheus has its own SDK so every developer can instrument their applications to expose metrics in the Prometheus format. So maybe the application you're trying to monitor is already exposing these metrics and you don't need an exporter. For those applications that aren't instrumented yet, you can use an exporter. What's an exporter? An exporter is an application that runs in conjunction with the main application that you want to monitor. It gets the information from the application and then exposes that information in Prometheus metrics. How should we choose the right exporter? Let's do for example a quick search. Let's see we need to monitor MongoDB. MongoDB has several exporters. All of them are open source and available for free on the Internet. But what's the right exporter? For deciding which one is the right option for you, you should download all the exporters, try them out, etc. Once you find the right exporter, you need to see how you're going to run it.  What if it's Docker? Do you trust that image? And most importantly, is that image going to be forever on that registry? What if someone removes it from the registry? Then you might find an image pool error in your Kubernetes cluster and that's a mess. That's why we created Promcat. Promcat is an online resource that you can use for finding the right configuration for your applications to monitor them with Prometheus. All the integrations that we have here are curated, they are well tested, and they are maintained by Cystic. So you can trust that once you pick an exporter from promcat.io, it won't be removed from our registry. Let's for example search MongoDB. You can see how promcat looks like. You can see the description, you can see the Docker image that you need to use, the container, the image you need to use to run this exporter, also the setup guide. You can also download some cool dashboards to import them in Grafana and start monitoring. And also some alerts, these are a curated list of alerts that can help you to start monitoring. Okay, so let's see how we can use promcat in a real case scenario. Okay, let me show you. Let me do this a little bit bigger. Okay, so in this covered cluster, I have an NGINX namespace with an example application that is generating traffic. So NGINX is constantly serving traffic, okay? So there are three NGINX bots, and inside of those bots, there are only one container, the NGINX container. So what if I want to monitor this application? This is an NGINX, so I can go back to promcat.io and then I can search for NGINX. And then I go to the setup guide and it's okay. So there are a few prerequisites. I need to enable this stuf status module. This is a config map example in case you need to tweak it in your application. And then the installation of the exporter itself. So you can install the exporter right from our hunt charts. Okay, so let's try this. First, we are going to get the patch file from our home file, our hunt chart, sorry. And then we are going to patch our current NGINX installation. So it includes the new exporter. So let's go back to the terminal. Let's close this and then we are going to do this. Let's download this. Okay, so we just downloaded these parts. Let's take a look at its content. So it's basically adding a container here with some limits request. You can tweak this if you find any issue or if you need something different. It's using this container port and these annotations. This is really important. We'll see this later, but this is how Kubernetes is going to discover these metrics. Okay, so let's do the patch command. Okay, no error here. So let's go back to the NGINX namespace. Let's go back to NGINX and then there are the three pods. But now we can see now in each one of the pods we can find two containers, the NGINX itself and the NGINX exporter. Now that we have the NGINX exporter working as a sidecar of the NGINX server, we can do a quick check to assure that the exporter is working. It's really easy. We can do a port forward to the port to the 9113 port that is the port that the metrics are exposed in.  You can do this and then we are sure that the exporter is working. This is a nice way of taking this because sometimes we configure everything at the end of the process. It doesn't work. And before starting to tweak the Kubernetes jobs, the Prometheus jobs, other configurations, it's a nice idea to be sure that the exporter is working. So now that NGINX has its sidecar running the exporter for exposing all the NGINX metrics, how can Prometheus get these metrics from Kubernetes? Well, this is really easy. We can go to the Prometheus documentation and then we can take a look at the Prometheus service discovery config. The service discovery config allows Prometheus to get information from the Kubernetes API. How? By using these annotations. So basically we need to create a job in our Prometheus configuration. We need to create a job for using these metrics and using these labels for telling Prometheus where are these metrics. So how can we do this? This is an example job. This file is the HEM file that I used for installing this demo environment. I'm using the Kube Prometheus stack with this fantastic, but you can install Prometheus the way you want. This file will be available in the GitHub repository with all the files regarding this demo. So don't worry, you have this in our GitHub repository. So basically, if you can remember, we used two annotations, the port and the scrape. So basically the scrape is telling Prometheus, yes, scrape this port. And then the port is telling Prometheus, this is the port to get the metrics from. The rest is by default. So it's going to be a slash metrics, but you can change that also. So basically, in this job, we are using some reliable configurations. What we did is using the scrape annotation and the IO port. So with the scrape annotation, we configure how to use the IO scrape annotation and then the port with these regex replacements. Also, we could change the metrics path by using this annotation over here, the Prometheus IO path. If you want it, if your exporter doesn't expose the metrics in the default slash metrics path. So you could change the scheme. For example, if you wanted to be HTTPS instead of HTTP, you could use this IO scheme over here. And basically, that's everything you need to know. So let's try it, right? Let's see if this works. Okay, spoiler alert, it does. We have a lot of metrics here. Prometheus is auto-completing all the metrics we have. So we can do this and this. So that's it. We are monitoring our ngnex application using Prometheus with just copy pasting a couple of commands from Prometheus IO. Let's see what else has promcat to offer. You can go here to dashboards and download the example dashboard that is available here. So to have a nice starting point in your ngnex dashboard. Maybe you already have an ngnex dashboard, but in case you don't, you can start with this. So here it is. Here you have the number of instances of ngnex that is 3 and the active reading and writing connections, the waiting connections, not handle connections. This is okay. There are no connections unhandled. So this is it. This is how you can start monitoring your applications in Kubernetes using Prometheus and promcat.io. I hope you liked this video and see you in the next one. Bye.


Hello and welcome to this presentation on the display architectures and interfaces. After a quick review of the existing display architectures, we will focus on the various display interfaces available, and then on the display's interfaces within STM32. First display architectures. Displays are first characterized by their technology. It can be TN-based, TN is for twisted nematic, in this case for each pixel some liquid crystal will twist the light or not. For TFT LCD displays, the same principle is applied but adding a mandatory backlight source and some color filters for subpixels, red, green and blue. Another technology, AMOLED, does not need backlight, each pixel emits some light. CRT screens, based on an electro beam, is not even mentioned here since it's not relevant for embedded devices. As of today, TFT LCD is currently the most common technology in microcontrollers. Other characteristics of displays is the total number of pixels that can be displayed, which is called a definition. For example, VGA displays with a definition of 640 by 480. The number of colors that can be displayed called the color depths. For example, a 24-bit per pixel color depths can render 16 million colors. And the number of times per second an image must be sent for a proper display, which is called a refresh rate. A classical display shall be refreshed 60 times per second. The last characteristic is the interface that the display supports. The interface will determine both the actual connection, in terms of number of pins, and the protocol, the data format. Before focusing on the interfaces, let's see the basic TFT LCD components required to drive the display regardless of the interface to the MCU. First, a memory, or G-RAM, for graphical RAM, is needed to store the image to be displayed, which is also called the frame buffer. A display controller is then needed to fetch the data from the G-RAM. This controller then sends the data and the timing information to the timing controller that will convert them into synchronization pulses to refresh each pixel of the panel. The gate driver then addresses each line of the panel while the source driver addresses each pixel of each line. Each pixel is thus given a specific amount of red, green, and blue to create the final pixel color, depending on the display color depth. Between the display controller and the timing controller, some specific signals are required. First, the pixel clock, or P-clock, is the next channel signal indicating the display at which rate the pixel are sent to the screen. On each pixel colloquial tick, one pixel data is sent. Note that all these values are expressed in a number of pixel clock cycles, so there are timing information. The V-sync, or vertical sync, is the signal that indicates the start of a new frame. The H-sync, or horizontal sync, indicates the start of a new line. The horizontal front porch is the interval period between the end of a picture information and the start of a horizontal pulse, or H-sync. The horizontal back porch is the duration between the end of horizontal pulse and the start of a new next line of the visible area. The vertical back porch is the delay between the V-sync end and the start of a new frame and the vertical front porch is the delay between the end of a visible area frame and the next V-sync start. All these signals are inherited from the analog display domain. For example, the back porch is the duration of positioning the electron beam to the beginning of the panel and turn it on again. During the gray area, no pixel data is actually updated on the panel. It is called the blanking period. It is during this period that the geram can be updated since it is not sent to the panel. This slide is an illustration of the timing signals in a temporal way. At the top of the slides, at the frame level, based on vertical synchronization, there is one V-sync signal per image of frame. The bottom part shows the line level. There are as many H-sync signals as lines in the frame. This timing information is specific to each display model. They are always provided in the display data sheet as we will see in the next slide. This is typically the kind of table that can be found in every display data sheet. However, the unit may differ. For example, here, all the units are pixel clocks, but it could be nanoseconds. But each signal is present. Green values correspond to visible area, while pink ones include also the delays, vertical and horizontal front and back porches. Thus, if the pixel clock required to fill the visible area is 7.8 MHz, the actual required pixel clock to correctly display the frame at 60Hz is 9.1 MHz, as you can see in the computation. For a 24-bit per pixel color depth, the display bandwidth is then 27.3 Mbps. Usually, the G-RAM contains only the content of a single frame. As we mentioned, it is sent directly to the display 60 times per second, but must also be updated regularly depending on the content that has to be displayed. When the G-RAM contains only one frame, some tearing may appear on the display when reading and writing from and to this G-RAM. Screen tearing is a virtual artifact and video display where a display device shows information from two or more frames in a single screen draw. The artifact occurs when the video feed to the device isn't in sync with the display's refresh. In other words, if reading and writing from and to this G-RAM is not carefully handled, some tearing effect may appear. Let's see an illustration of this tearing effect. Let's consider this green L0 logo. The blue line corresponds to the reading pointer of the display controller that sends the pixel it reads to the display panel. It sends it consciously at 60Hz. The pink line corresponds to the writing pointer of the graphical application that fills the graphical buffer for future display. So the blue logo is the next frame to be displayed while the green one is currently displayed. The display controller is constantly reading the G-RAM at 16Hz. The graphical application on its side is not updating the G-RAM at this frequency but a much slower one depending on the available memory bandwidth but also depending on the application lifecycle. At this point, you can see that the writing pointer is beyond the reading pointer, which means that the display controller will read the next frame or at least or at least part of it. This will result in a wrong panel update in which we will have part of the green logo and part of the blue one. To avoid this kind of effect, using still a single buffer, the graphical application update of the G-RAM must be contained in the blanking period. Otherwise, if it's longer than the blanking period, a second buffer must be used to update the next frame. Let's now see the available display interfaces. There is basically two families of display. The display is with no display controller, only a low-level timing controller or T-con, source and gate drivers. And display with display controller, including a RAM, so a G-RAM, storing the frame buffer to be displayed. This implies several kinds of interfacing and different bandwidth requirements for the same definition and color depths. First, we can have the MCU power line interface for display with controller and frame buffer. This interface works in common mode. It means that the MCU sends data or control signal to the display controller. We have also a SPI or serial interface for display with display controller and frame buffer. Also working in common mode, the only difference between the two is the power line or serial interface, which means more or less pins to connect the display. And finally, we have the RGB interface for display without display controller and frame buffer. And in this case, the MCU sends the RGB data and the timing, such as visiting clock, to the display. So this RGB interface requires a specific IP to handle the display controller. Because if the MCU was in charge of it, it will be too much CPU consuming to render the display. Remember that the images must be sent 60 times per second. This is a diagram illustrating a display with a controller and G-RAM. As you can see, we have several interfaces that we already mentioned. The Moto 6800 and the Intel 8080 are the power line interface mentioned before. The Motorola and Intel protocol are power line interfaces, while the SPI is a serial one. So in this case, only data or control signals are sent and the display controller on the display module side is in charge of refreshing the screen with the current frame buffer it has. The MCU only updates the frame buffer when needed depending on the application lifecycle. So Motorola and Intel protocol are generally handled using the FSMC, while the SPI is of course handled by the dedicated protocol. A partial update of the G-RAM is also supported, which allows some optimization of the bandwidth on the display interface. The drawback is that commands should be synchronized properly to avoid the T-ring effect. For that, the TE pin for T-ring effect pin is configured to generate a signal on a specific line number. The number of the line is chosen to take into account the latency introduced by the sending of the command. For a display without controller nor graphical RAM, the mode is called Continuous RGB with H-Sync, V-Sync, D-E-M-P clock. The display controller generating all the signals H-Sync, V-Sync and the frame buffer is on the MCU side. In this case, the number of pins required for raw data are 12 pins for RGB 444 color depths and 24 pins in RGB 888. But also requires some specific pins like the D-E, it's the data enable and the P-Clock, which contains the pixel clock. So it means that we have between 15 and 28 pins used. In terms of comparison, displays with controller have a higher cost and frequency generally limited to 20 MHz. They are used for small definition displays, interfaced with P or FSMC and they need applicative layer for common generation. The display without controller have a lower cost and can reach very high definition. But the pin count is very high, 20, 22 or 28 pins or more and it doesn't need extra applicative layer. The MIP DSI interface overcomes these limitations as we will see. The MIP Alliance is for mobile industry processor interface. It's an organization specifying the interconnections between ICs within phones. It was founded in 2003 by Arm, Intel, Nokia, Samsung and ST Microelectronics and TI. The display working group of this organization is specifying the interconnection between an IC and a display. It has standardized already all existing display interfaces we see before and also added a new display interface which is called the display serial interface or DSI. The display bus interface or DBI works in command mode. It's using display command set. So it concerns Motorola, Intel and Spy interfaces that we mentioned before and name them type A, B and C. The display pixel interface, DPI the parallel RGB interface and works in video mode. And finally the display serial interface can encapsulate both modes either command mode over DSI or video mode over DSI. But the main advantage of the DSI interface is on the number of pins it requires since it's a serialized interface it only requires from 4 to 6 pins but is still able to handle both parallel and serial mode. In this configuration the display commands are sent by the MCU and received by the display controller using the DSI. It conciliates bandwidth optimization with low pins number. For display without controller it's the same configuration as the display without controller we saw before except that all the signals are multiplexed by the DSI host and sent on a serial link. They are then demultiplexed on the display side by the DSI device. The number of pins is between 4 and 6 depending on the number of lanes used. It's a big advantage compared to parallel interface. The DSI decreases the number of wires between the MCU and the display. It supports high bandwidths multi-lane differential link. It is scalable from 125 Mbps to 1 GBps per lane and it's scalable up to 4 data lanes. It also supports low power modes. The MCU can be in stop mode while the display is on. The DSI uses the Mipi DeFi for the physical link. As we saw the DSI encapsulates either DBI commands or DPI signals and transmits them to the display. This allows to get interfaced with a standard display below its VGA with 4 pins only with the same performance as in DPI mode. Another advantage of the DSI interface is that it allows over 15 cm long cable between the MCU and the display. Most of the STM32 MCUs already includes some FSMC device as well as SPI. So the DBI interface is already handled by most of the STM32 MCUs. Let's see now how the RGB interface is handled in the STM32 families. For display without internal controller a specific IP called the LTDC is provided in some of the STM32 MCUs. The HB master interface to communicate with the memory peripherals as well as an APB interface to generate the timing informations. LTDC stands for LCD TFT display controller and is generating all the signals for the LCD panel. The display clock, the h-sync, the v-sync, the data-enable signal and RGB raw data. It has programmable timings for all the TFT LCD displays up to XGR. The HB master interface with burst of 16 words acts like a DMA. Thanks to LTDC the CPU is not interrupted periodically to generate the DPI signals. The LTDC main features include the 24-bits RGB parallel pixel inputs which is a 8-bit per pixel color depth, two display layers with dedicated FIFO, a color lookup table up to 256 color per layer. It supports up to XGA definition which is 1024 by 768. It has programmable timings for different display panels, programmable background color, programmable polarity for h-sync, v-sync and data-enable and it supports up to 8 input color formats selectable per layer which are RGB8888, RGB888, RGB565, etc. Please refer to the user manual for the detailed information. So the LTDC IP is armed to deal with the DPI interface without loading the MCU which is still available for the application. So regarding STM32 display interfaces, all the STM32 with SPI peripherals are supporting the DPI type C interface. The STM32 with FSMC are also supporting the DPI type A and B interfaces. The STM32 with LTDC are supporting the DPI and latest generation of STM32 are supporting the DSI. And finally, all the STM32 are supporting the DCS interface in pure software, then loading a lot the MCU. Here is a quick view on the existing MCUs and the display interface is their support. As you can see, the most recent H7 is supporting all the mode because it contains an LTDC but also supports the DLC mode. And of course it contains FSMC and SPI peripherals. Note that in the marketing presentation, TFT control means DPI and display parallel interface means DPI type A or B. In the lab associated to this presentation, we will use F469 which supports all the display interface modes. Here is an overview of the STM32 flexibility. The first use case is the display module with an integrated display controller and graphical memory. Here the MCU communicates with the display through DPI or DSI interface. So with one chip, STM32 plus a display module. In this second case, another frame buffer is also accessible through the FSMC to avoid, for example, the Turing effect that we mentioned before. In this third example, the STM32 is directly communicating to the display through the LTDC interface. So the display contains no internal controller and no memory. And in this use case, we have only one frame buffer. And finally, this is the most frequent use case since the display without display controller are cheaper. In this case, we use an external frame buffer for one and or two frame buffers through the FSMC and communicate through the display, through the DPI or DSI interface using the LTDC. So as a conclusion, there are two kind of displays. We always are an integrated controller. A lot of interfaces are existing, DPI, DPI, DSI, and all the display interfaces are standardized by the MEP organization. DSI is the most advanced standard and can encapsulate all the old standards. The STM32 family supports all the display interfaces. Thank you for your attention and then you invite you to follow the next course.


The Buffalo Bandits are up six in game two of the finals and Josh Burns about to put them up seven cuts inside, goes up, goes under.  Just kind of chilling in sneakers and a helmet. Oh, it's the finals. You missed that, you never planned on watching it. This is everything you missed that you never planned on watching and it is brought to you by Bird Dogs. Boom, boom, boom, boom, boom, boom, boom. Tune into some college baseball. We got Georgia and Missouri, one runner on in a one run game. Here's out number one to center field.  The tying run was on first base. He's running all the way around and he's gonna score. Center fielder probably wishes he simply caught that clapping but don't want to wake the baby but clapping, clapping and he's excited. Boom, boom, his name is Hank. And now he represents the Goa head run and this kid's name is Dylan. He takes that two strike curve ball and says this game is over. Wow, barn burner between these two teams, Missouri went on to walk off the next day as well.  They're running around. Guys double water bottle in. It's good times. Way to go. Let's head across the pond for the United Rugby Championship. Munster is in red. Lensters in blue. Lensters won 14 of the last 16 matches. We're at the end here and they're up by two against Munster who's got the ball and they're just moving it. Now they can't find the ball. Where is it? I can't see it. Guy in blue gets frustrated. He says, bam, can you see it now?  Yes, that worked great. We got it. And they move it up just a little bit which sets them up for the drop kick. Jack Crowley says, guys, just pass me the ball. Let's beat these guys. Stun them, drop kick, boom. In at the end of the match, he says, yes, yes, yes, yes, yes. Ah! Ah! And that does it. 80th minute, they've won. This got suggested to me by Rory who said that these guys were so certain they were gonna win at the bottom of this. He says, Lenster, we're so confident. They didn't even put out their full team. Bad strategy. Let's go back to America where we got Florida State and Duke tied up at one in the bottom of the seventh inning and the ACC championship can't make that throw because Devin Flaherty is fast and now she's on first base. There's two outs. One more out, you push it to extras, you get to hit again, but Devin Flaherty stole the most bags in ACC this year. Is she gonna steal? Doesn't matter. This ball bloops in in front of the left fielder and she goes first to home. That was a crazy send from the third base coach in my brain, but I don't have a softball brain. Oh, what's going on with the catcher? Uh-oh, is she okay? She's hobbling. Did she get hurt? Oh no, she wants to celebrate, but she's scared to celebrate. She doesn't wanna, what is all this? Oh man, let's go back. Let's backtrack a little bit and see if we can diagnose this. Did she twist her ankle? What's going on? When she jumped, oh, her shoe just fell off. It just came right out. She's all good. She even tweeted, I'm perfectly fine. My shoe was just missing. Stop worrying about it, guys. I need to see the replay. First to home on a ball in front of the out fielder is just crazy, but obviously the bases are smaller in softball and your third base coach knows he's got speed, so he just says use it and they win. What an ending, that's awesome. Congrats on being so fast. Let's go back to Ireland, watch some Gaelic football. This is the province of Ulster, the championship, the Ulster title, all the counties in the province competing to see who's got the best group of lads when it comes to Gaelic football and the championship came down to PKs. Wouldn't you know it? So basically just soccer in your brain, but he saves that one. The dairy keeper, Oran Lynch. Oran Lynch, Oran Lynch, Oran. I don't know how you say it, but he's excited. He's young, he's handsome, he's wearing brown. Both teams are wearing the same color. People are upset by that. The next one, that's put in so dairy takes the lead, but oh no, at what cost? He's hurt. And then a goal, all right. Tied up, won a piece, but obviously dairy has not missed yet and now they have. So now, one save a piece, one goal a piece. Oh my God, another save by Lynch. They try to go up and to his right. He says, come on, do it again. Do it again. I dare you to kick it there again. And this guy's like, I gotta make another save. I'm not gonna do that. They go way up top. It's a nice shot. It's a ballsy shot. And that guy looks Irish. Of course he does. And here he is. Lynch says, I dare you to go up there again.   Come on. Saves three. Now if this guy puts the next one in, dairy wins the championship and that's just what he does. He also went way up top, like bar down. The dairy kicker's kind of lunatics. That's scary stuff, but they win best team in the whole county. Them, not you, not another team. Them, they're the best. And that's their second time winning in a row, I believe, on the back of three great saves by Lynch to his left. Got it. To his right. Got it. To his right. Got it. That's exciting. Last one, the XFL been talking a lot about this as the season has been going on Things You Missed and this is the championship. And Arlington beat DC. DC went 10-1 in the regular season, but Arlington made a pretty crucial trade down the stretch for a quarterback. Luis Perez, he only played in three games. One regular season game, semi-final championship, helps them win the whole thing. And his story is crazy. He didn't play football at the varsity level in high school. He walked on to a community college and was the ninth string quarterback, which I think translates to fan that hangs around. They're like, do you want to play another position? He's like, nah, ninth string it is for me. He earns a starting job. And then he goes to A&M Commerce, D2, wins the national title. He's player of the year. He dabbles around in the NFL a little bit and now he won the championship, the XFL. He actually says that he learned how to play quarterback by watching YouTube. So just an incredible story and always make the good trade for the good guy. And that's how you're gonna win. And that was the final segment for this video which only leaves us with one important thing to cover. Bird dogs, they sponsored the episode. I told you about them earlier. They make really comfortable clothing, especially for summertime. You look good. You feel good. You're like, man, why do I look and feel so good? Must be the bird dogs. That's what I said when I put them on.  All right, fan of the week last year. Last year, maybe you guys didn't vote but last week you guys voted phenomenally. I was proud of you. Who do you got this time? You got cowboy and glasses. You got guy behind coach. You got slow and sassy. You got bouncy bouncy. Subscribe to the channel if you want to. I appreciate you. Thank you. Goodbye.


That concludes topical questions. The next item of business is a statement by Angela Constance on implementation of the Hate Crime and Public Order Scotland Act 2021. The cabinet secretary will take questions at the end of her statement, so there should be no interventions or interruptions. I call on Angela Constance up to 10 minutes, cabinet secretary. Thank you, Presiding Officer. I'd like to provide Parliament with an update on the 2021 Hate Crime and Public Order Scotland Act. After the commentary that we have seen since the act's commencement on 1 April, much of it is misleading at best. I will take this opportunity to remind members of its purpose. Let me begin by emphasising that in Scotland we should be rightly proud of our history as a welcoming nation and one that celebrates and values diversity in our communities. However, we must be vigilant in protecting those values, challenge those who deny them and recognise that there are people who experience hatred and prejudice every day, and we cannot and must not be complacent. We should remember that when we talk about hate crime we are describing behaviour that is both criminal and rooted in prejudice, where the offenders' actions have been driven by hatred towards a particular group, hatred for people just on the basis of who they are. Police Scotland describes hate crimes as offences that include but are not limited to assault, verbal abuse, damage to property, threatening behaviour, robbery and harassment, and it can take place anywhere, including online.  Those are the same characteristics that are protected under hate crime legislation in England and Wales. The act also, for the first time, includes age as a new statutory aggravation, and last week I visited Age Scotland and met with the Scottish ethnic minority older peoples forum, who were generous in sharing their experiences and why the act is important to them. Catherine Crawford, Age Scotland's chief executive officer, stated, "...it is really important to see age included for the first time, as we will get a much better picture of how this features in criminal acts and how it cuts across other protected characteristics. We hope that the new laws will empower older people to report hate crimes." The Hate Crime Act introduces new offences for threatening and or abusive behaviour and the communication of threatening or abusive material, which is intended to stir up hatred against a group of people who possess or appear to possess the particular characteristics that I have outlined. That could take many forums, including pictures, videos or information posted on websites. Lord Bracadale, who led the independent review of hate crime legislation, which led to this act, was clear of the need for the legislation to include offences relating to stirring up of hatred, noting that, and a quote, stirring up of hatred may lead to violence or public disorder. Why would anyone in this chamber not take a stand against this behaviour in our communities? Again, those offences are similar to legislation in England and Wales, which has criminalised stirring up hatred on the grounds of religion since 2007 and sexual orientation since 2010. In some ways, members, we are a decade behind. It is also important to note that the new offences have a higher threshold for a crime to be committed than the long-standing offence of stirring up racial hatred, which has been in place for the best part of 40 years without controversy. People can still be offensive, critical and insulting under this act, and we have seen people be exactly that. The act includes rigorous safeguards on freedom of speech, and that behaviour or material is not to be taken to be threatening or abusive just because it involves discussion or criticism of matters relating to one of the characteristics included in legislation. The act is compatible with the European Convention on Human Rights and specifically provides that the courts should have regard to the general principle that article 10 writes apply to the expression of information or ideas that offend, shock or disturb. Those of us with a platform as a politician or indeed a public figure have a responsibility to have debate that is rooted in reality, respect and facts. Over the past month, there has unfortunately been deliberate misinformation and misrepresentation of the act. Losing sight and empathy towards the people in our communities it seeks to protect. Debate around the act has provided little light and too much hate. There is nothing in the Hate Crime Act that is divisive. It should not be anyone's intention to make it so, and we all know better than to believe everything that we read on social media. Although we do not claim that legislation in and of itself can eradicate hatred or prejudice, critics should not trivialise or exaggerate its impact with false fears. The act is an essential element of our wider approach, set out in the Hate Crime Strategy published last year, to build a Scotland where everyone can feel safe. We are not there yet, and the reality is that there are people who are frightened to leave their home, who avoid public places and who significantly alter their lives in order to avoid certain interactions. We must listen to those whose voices we have not heard in the last few weeks, who are the everyday victims of hate crime. If we truly believe in taking a zero-tolerance approach to hatred, then the law must adequately protect people from those who stir up hatred. As Professor James Chalmers recently wrote, and I quote, anyone stirring up hatred against such a group is almost certainly already committing crime, such as threatening or abusive or breach of the peace. The effect of the act here is not to make criminal what is currently lawful, but to ensure that the law properly recognises and describes the crime. Legislation to protect people from hatred and prejudice is not new nor is it unique to Scotland, but willful misinformation cause confusion and ignoring the fact that similar laws have been in place across the UK without problem for decades is deeply irresponsible and risks emboldening the small minority who genuinely pose a threat of abuse and violence. We should instead look to those who explain the law as it is and not as they perceive it to be. Adam Tomkins, former Conservative MSP and Professor of Public Law, stated in March that offensive speech is not criminalised by this legislation, the only speech relating to sexual orientation, transgender identity, age or disability outlawed here is speech which a reasonable person would consider to be threatening or abusive and which was intended to stir up hatred and was not reasonable in the circumstances. Presiding Officer, since 2014-15 recorded hate crimes annually have been between 6,307,000. In 2021-22 the police recorded 6,927 hate crimes and 62 per cent of those included a race aggravator. In 2020-21 almost a quarter of all victims were police officers. I am grateful to Police Scotland for their outstanding dedication and professionalism as the law came into force and for all that they do to keep our communities safe. In the first week of implementation Police Scotland received over 7,000 reports of hate crime, the vast majority of which were not considered to be criminal. Of the 445 hate crimes recorded over the first to the 14 April, only seven of those were stirring up offences. In the last week there has been a 74.4 per cent decrease in online reports to 1,832. Sadly the number of recorded hate crimes did not decrease so significantly, again reinforcing the importance of this legislation. Whilst volumes of recorded hate crime are up on average, this is expected given the high-profile nature of the acts implementation and hate crime continues to be under reported. Police Scotland has been clear that demand continues to be managed within its contact centres and impact on front-line policing has been minimal. I accept that the Scottish Government could have done more to inform people about this act as well as our wider approach to tackling hate crime and prejudice. We have therefore today published a fact sheet to go along with the already published general information note on the act. However, let's be clear, even if the Government had produced more information, bad faith actors who are intent on spreading disinformation would have done so regardless. I am clear that the purpose and intent of the hate crime act, which was passed by 82 members of this democratically elected Parliament, is to protect those in our country at risk of hatred and prejudice. Tackling hate crime is not the responsibility of those targeted, it is our responsibility, it is everyone's responsibility. We are absolutely committed to the ambitious programme of work in our hate crime strategy, with our range of action under way to 2026 to support victims, improve data and evidence and develop preventative approaches to hate crime. People and communities at the sharp end of hatred in their daily lives simply for being who they are should rightly look to this Parliament to stand with them. This Government, this Scottish Government, will continue to do so. Thank you. The cabinet secretary will now take questions on the issues raised in her statement. I intend to allow around 20 minutes for questions after which we'll move on to the next item of business. I'd be grateful if members wished to put a question where to press their request to speak buttons now. I call Russell Finlay. I thank the cabinet secretary for her advanced sight of her statement. Police Scotland has been bombarded with almost 9,000 reports because of Humza Yousaf's hate crime law, a law that threatens free speech and a law that is critically different to competent legislation elsewhere in the UK. Despite the SNP's spin that we've just heard, the vast majority of these 9,000 reports are not crimes. Despite the SNP's best efforts, Scotland is not suffering from a hate epidemic. It's suffering from bad SNP legislation. The cabinet secretary talks about misinformation, what an absolute brass neck. The misinformation has come from her Government, including Humza Yousaf and the community safety minister. They misquote their own legislation, confusing the public and fuelling even more complaints to police. Police officers are paying the price for this absolute shambles. As a new HMICS report confirms, they already feel unsafe and unable to do their jobs, yet the SNP is now ordering these exhausted police officers to police our speech. The Government was repeatedly warned that their law was unworkable and would be weaponised. They didn't listen to us, they didn't listen to anyone else. Neither did Labour nor the Lib Dems, so will they now listen, admit that they got it wrong and back our demand to scrap Humza Yousaf's hate crime law. Beirion in mind, we want to have a debate that's rooted in facts and respect. May I respectfully remind Mr Finlay that it is this Parliament's hate crime legislation that 82 Members voted to modernise and update our laws to protect those at the sharp end day in, day out of hate crime in this country. I, for one, will not term a blind eye to hate crime or to the victims that suffer at the hands of those who perpetuate hate. I am very clear about my own responsibilities and I wonder if all Members reflect strongly on their responsibilities, because in this Parliament we should be united on two things, irrespective of our views on any piece of legislation. Firstly, we should be united on the evils of hate crime and the corrosive effect that it has on individuals, families and communities, the length and breadth of Scotland. Secondly, we should be united on the same script, Mr Finlay, in strongly calling and in discouraging people from wasting police time. It is not acceptable for members of the Conservative Party to be democracy deniers. This legislation was subject to very careful scrutiny indeed and some excellent cross-party working, some of which his own members contributed to, to make an act that was strong, that was defensible, compliant with the European Convention on Human Rights, and most of all protects victims of hate crimes, while also protecting the rights of freedom of expression. Does the cabinet secretary accept that the first few days of the implementation of this act have been a shambles? That poor communication has led to confusion over what is a hate crime and a loss of public confidence. The police have been overwhelmed and the Scottish Police Federation has said that training has not been good enough. Many women are still concerned about the lack of sex as a category. Will the cabinet secretary commit to adding sex as a category and to an urgent review of the operation of the act? Let me first reiterate what I said in my statement that I consider it to be that the Scottish Government could have done more to communicate what this act is about and, crucially, what it is not about. I also have to accept that, even with better communication, none the less there would have been bad faith actors. We should be united on that fact to calling that out. This is legislation to protect vulnerable communities. It is not there to be weaponised by whatever side of the so-called hate crime wars are. I have also been very clear, Presiding Officer, that I will bring forward misogyny legislation. That was a matter that has been debated previously in Parliament and it was due to the representation of many women's groups that they did not want sex to be captured in the Hate Crime Act. There are many reasons for that. One, women are a minority, where 51 per cent of the population. Helena Kennedy led excellent work in this area, whose recommendations this Government has consulted on and on whose recommendations we will bring forward a bill this year on. However, as she said, the prevalence of misogyny in our country, in our society, is shocking. It is shameful. There is no doubt about it that misogyny in some shape or form will have been experienced by every woman the length and breadth of Scotland. Therefore, we need stand-alone legislation that attempts to encapsulate the full range of offences that are motivated by misogyny. I will very much look forward to working with Ms Clark and other members on this bill as we go forward. I am keen to get in as many members as possible and to protect time for the next item of business, so I call Audrey Nicholl to be followed by Sharon Dowie. Concise questions and responses, thank you. The Conservatives want to repeal the Scottish Hate Crime Act. Therefore, can I ask the Cabinet Secretary of Ships leaves that Douglas Ross as an MP should seek to also repeal similar acts in relation to religion and sexual orientation in England and Wales? Cabinet Secretary, if I could ask you to take a seat, it is quite clear that the questions should be on issues raised in this statement. Therefore, I will move on to Sharon Dowie's question. The Scottish Government has spent £400,000 on advertising the new hate crime legislation, the public and the police still lack clarity on the definition of a hate crime. That is why we have seen a 74-year-old woman in tune recently arrested for an incident with a hate crime element to then be released without charge. Does the Scottish Government believe that a two-hour training module, which some officers are still to complete, is enough to enforce this legislation without arresting innocent people? Cabinet Secretary. I really do wish that the Conservatives would make up their minds on what they want. On the one hand, they want more information, more communication and then they have to quote Mr Finlay the brassneck to trip up here and complain about £400,000 spent on a public information campaign. On the record, although I am not in charge of training of police officers for reasons that I am sure the chamber will understand, I would have hoped that members would have been reassured that, according to the Deputy Chief Constable, more than 80 per cent of police officers have been trained. That, of course, is in recognition that not all police officers will be in front-line roles or operating in the C3 command control centres. It is also recognised that training has indeed taken many forms. Some of that training has been face-to-face. I would also like to put in record that additional resource was indeed allocated to Police Scotland for the implementation of the act, and it was around £300,000. Given that there have been thresholds in place in legislation in relation to the stirring up of racial hatred for over 40 years in Scotland, what approach is enshrined in this act in relation to the other characteristics that are now in scope in this act in relation to the thresholds for whether an offence has been committed? Does the act take the same approach as was taken in relation to racial hatred, or has a tougher approach been taken in this legislation? What is it saying about members of Parliament who are not prepared to stand full square behind legislation that is designed to outlaw discrimination against people on the grounds of disability? The hate crime legislation passed by this Parliament does indeed take a tougher approach.  This is a lower threshold for criminality than the new stirring up offences in the Scottish Hate Crime Act. Our Hate Crime Act does not change the UK-wide offence in relation to racial hatred. The UK-wide offence is wider than that in the offences in the Hate Crime Act, as there is no requirement for intent to stir up hatred. It also covers behaviour or communication that is insulting as well as that which is threatening or abusive. Under the Hate Crime Act, as the member says, the behaviour has to be threatening and or abusive and intended to stir up hatred. That is a high threshold for criminality. As a member of the Justice Committee in the last parliamentary session, I had a detailed discussion with Lord Bracadale following the publication of his report. There was a clear need to provide consolidation, but moreover to provide consistency and clarity regarding hate crime legislation. The cabinet secretary seems to have conceded that that clarity has not been successfully achieved following the implementation of that. Is the Government going to reflect and indeed review how public information is carried out and in particular about the balance between Government responsibility and police responsibility for explaining new legislation, particularly in such a sensitive area? I very much recall that Daniel Johnson was very active in shaping the legislation and was among members on a cross-party basis that submitted a high number of amendments on this particular bill that is now the law of the land. He reflects well the motivation of Lord Bracadale in his review that a core purpose was to get consistency, better understanding and consolidation. If I can be a grown-up about this, I think that there is always scope to reflect and review how matters are communicated. However, I do hope that I am not the only person in this chamber that will take the time to reflect and review. During the last few weeks, the voices that have been drowned out due to Tory misinformation regarding the hate crime act are those who will benefit from the legislation. Can the cabinet secretary detail how the hate crime act will help to provide greater protection for victims and communities? The act provides greater protections as it extends the stirring up of hatred offences to all characteristics protected as outlined in the act, including new characteristics of age, and therefore is in line with the existing offence of stirring up racial hatred that has been part of criminal law across the UK for decades. It is well worth noting that approximately a third of hate crimes in Scotland involve a victim who experienced the incident at their place of work or as part of their occupation. Most of those victims were working in retail or other service industries, and a quarter of recorded hate crimes had a police officer victim. Everyone in this chamber should want to protect people in society from such crimes. I thank the cabinet secretary for early sight of her statement and welcome the acknowledgement that preparation for the implementation of this law has fallen short and has contributed to some extent in some of the confusion that we have seen about what the act does and, importantly, what it does not do. A gap in the protections, of course, is a stand-alone misogyny offence that the Scottish Government promised on the back of Baroness Kennedy's report two years ago, given the importance of that gap being filled. Will the cabinet secretary commit to publishing the legislation that she has referred to ahead of the summer recess? Let me reassure Mr MacArthur and other chambers that I am absolutely committed to bringing forward the misogyny bill as soon as possible. It was a very important commitment within our programme for government that I am sure members are well acquainted with. I am also extremely committed to working on a cross-party basis in the hope that moving forward in this substantial piece of legislation that will be coming forward that we can all at least attempt to move forward with some degree of unanimity, notwithstanding that we will, of course, want to vigorously debate and scrutinise to ensure that, at the end of the day, we have the very best possible legislation to give further protection to women in this country. For the most part, the act is consolidating hate crime legislation into one single place. Is the actual effect then of the act to properly recognise that crimes against public order, such as being threatened or abusive, which have long been in place, along with stirring up hatred against the community, is exactly that, a hate crime and should be recognised as such? That is absolutely the case. The Hate Crime Act outlines that the offences covered in the legislation are hate crimes and are not acceptable. There has been a lot of media coverage on the number of reports, understandably, that have been received by Police Scotland. The very fact that we have seen that 213 police-recorded hate crimes last week and 232 the week before reinforces the importance of the Hate Crime Act. The act is an essential element of our wider approach to tackling hate crime, as well as recognising the haram hate crime causes. Legislation sends an important message to victims, offenders and wider society that it should not and will not be tolerated. In the first week since the act's implementation, Police Scotland indicated that only 3.8 per cent of the allegations received were authentic. 240 were logged as hate crimes and 30 as non-hate crimes. Does the cabinet secretary believe that those numbers were due to the widespread misinformation spread about the act, including from members in this chamber? Does she agree that this misinformation serves to damage the victims and survivors that this Parliament should be supporting? I strongly believe that the information that has been published by Police Scotland with respect to the calls that they have received in the first few weeks of the implementation of the act is significantly important information. There is no doubt that Police Scotland received a high volume of online hate crime reports, but we should all be encouraged that we have seen a nearly 75 per cent decrease in the past week, with calls falling from an excess of 7,000 to an excess of 1,800. I believe that we are moving in the right direction where Police Scotland is receiving less calls, but I think that the member's point is that, despite a high volume of anonymous online reports, at the end of the day, the number of recorded crimes is comparatively small. That demonstrates the need for the act that there have been 445 recorded crimes in the past fortnight. It should increase confidence in policing in this country that they are acting proportionately and accordingly in the manner in which the law is intended. Can the cabinet secretary provide any clarity as to where Police Scotland's policy now sits in relation to the recording of non-crime hate incidents? I have been trying for weeks now to get answers out of the police as to why a different approach was taken in relation to the numerous complaints that were made against the First Minister, as opposed to the single complaint that was made against me, but all I get in response is confusion, evasion and obfuscation. So can the cabinet secretary tell me where this policy now stands, and if she can't, can she tell me how I get some straight answers from the police? The fact that Mr Fraser published the letter that he wrote to the chair of the Scottish Police Authority and he also helpedfully published the reply that he had received from the chair of the Scottish Police Authority, I think, does indeed give clarity in terms of non-crime hate incidents. Of course, when we are trying to get less heat and more light into the debate, all that happens is that Tory members decide to barrack from the back row. Let's hear the cabinet secretary. I understand and support the need for citizens to be clear about what information may or may not be held about them and how information may or may not be used, but it is also my view that Mr Fraser has a very clear answer from the Scottish Police Authority.  It has been an operation since 2004 and, of course, a similar procedure for recording non-crime incidents occurs for domestic abuse. That dates back to 1999, and I am sure that Mr Fraser will continue to engage no doubt with myself and, indeed, the Scottish Police Authority. Thank you, Presiding Officer. Can the cabinet secretary confirm what the characteristics apart from age used in hate crime legislation are the same as that in the rest of the UK and what protection does she believe our older people will be given with the inclusion of age? Yes, the act covers long-standing characteristics of disability, race, religion, sexual orientation, transgender identity, just as in England and Wales, and, of course, we have added age. Many crimes against the elderly may be driven by a desire to exploit a perceived vulnerability. During consultation, the Scottish Government heard that some offences may be motivated by prejudice based on the perceived age of the victim. Inclusion of age sends a clear message to society that those offences will not be tolerated. While the act covers persons of any age and practice, it may be more likely that offences are under the act, and particular offences where the aggravation applies are committed against elderly persons. I remind the chamber that my wife is a serving officer with Police Scotland. In her statement, the cabinet secretary said, and I quote her words, critics should not trivialise or exaggerate the impact of the hate crime act with false facts. Does the cabinet secretary for justice include Lord Hope, the Association of Scottish Police Superintendents, the Scottish Police Federation when she makes those comments because they have all raised their concerns about this bad SMP law? Cabinet Secretary, no, I do not. That concludes the ministerial statement on the implementation of the Hate Crime and Public Order Scotland act. We will now move on to the next item of business, and I will allow a moment or two for front-benches to organise themselves.