‫So this is a very short hands-on
‫but I'm going to show you the sampling rules in X-Ray.
‫So on the left-hand side of X-ray you get sampling,
‫and then you have access to all the sampling rules.
‫As we can see we can define many sampling rules
‫with different priorities.
‫And so if we look at the default sampling rule here
‫the priority is high
‫and what we get is a reservoir size
‫of one request per second and a fixed rate of five percent.
‫In any case you forget, there is a description here
‫as well as an information button
‫that tells you how to fix these limits.
‫And in the matching criteria it's a bit more advanced
‫for your sampling rules.
‫But this matches everything.
‫So every service, every service type, every method for HTTP.
‫Any URL, any resource ARN and any host.
‫And you can cancel this
‫and you can create your own sampling rule.
‫So I can call it DemoSampling
‫and give it priority five thousand.
‫And if you go here it says that the lower priority
‫takes precedence in the order.
‫So this will be a better rule
‫that would be applied first.
‫And we can say a reservoir size is ten requests per second
‫so more requests.
‫And there'd be a fixed rate of one percent
‫because we want less requests afterwards.
‫It's up to you do your reservoir and your fixed rate
‫as you want based on your application requirements.
‫The cool thing here is that we can drill down
‫for service or service type.
‫So if you're just interested not all the services
‫but one service in particular and want to debug it.
‫Maybe you want to have a reservoir size as one
‫and a fixed rate of one hundred percent.
‫And what this will do is that if you specify my service
‫and create this rule, what this will do
‫is that this service, my service, will send all it's traces
‫into X-Ray.
‫So it can really debug what's happening for my service
‫in details.
‫But you could also filter by HTTP method, so for example
‫just for post and the path of the URL, the host, the ARN.
‫So you're really free to create sampling rules
‫and then go ahead.
‫And as I said once you create a sampling rule
‫it will be applied automatically to all your X-Ray daemons
‫and so you don't need to worry about restarting your code.
‫And that makes X-Ray a very very flexible service
‫and one that you should be using
‫if you're running distributed services.
‫So I hope that was helpful,
‫and I will see you in the next lecture.