Hello everyone, it's great to get together.
Today, I'm going to give you a little...
So, as I was saying, I hope you've brought some Doliprane.
I'm going to give you a slightly technical presentation.
on a subject that obviously speaks to everyone,
is observability in WordPress.
And I'm going to start.
Does anyone have any idea what observability is?
Before even asking the question of how it's done in WordPress,
does anyone know what observability is?
Does anyone? No, really?
Yes, no, it's true, you're not allowed.
Anyone else? Yes ?
Okay. That's adapted to WordPress.
But yes, okay. That's a good answer.
To be able to characterize a system ,
for the operation of a system?
Yes, yes, it adds up with the previous answer.
Monitor activities on the web application.
Yes, also, yes. Monitor too.
It's all part of observability.
Okay. Was there another answer?
No, okay. So, observability, in fact, already has a definition.
Before being in WordPress, before talking about sites or applications,
because observability doesn't just apply to computer systems.
You could even say there's observability in a car.
It's a system.
Observability is the ability of a system to report on its state.
and to be inspected non-intrusively.
So, reporting on your condition, everyone knows what that means.
When you're inspected, you feel a little better.
In a non-intrusive way, it means that the fact of inspecting ,
. produce processes to inspect,
does not in itself modify the system's behavior.
Really, it's much less interesting.
So, observability is based on several things.
Several things and several pillars.
The first thing is that there are already states.
It's a system that must have states.
Preferably several.
Without that, it doesn't make much sense.
And that these states are both qualified,
i.e. that a state isn't just something
that's different from before, but how it's different from before.
And that it's quantifiable.
That is, how many times different from before.
Then you'll see.
I can see your faces.
We're going to do a little theory.
This is the theoretical part.
Don't worry, after that, we'll do some really fun stuff.
But you can't really understand the rest,
if you don't do the theoretical part.
So that's one of the pillars.
The fact that it's a state-controlled system.
Which is not always the case.
Then, whether these states are measured.
And that we measure both the states and the transitions between each state.
How do I go from one state to another?
And of course, so that we can say it's measured,
it's not enough to have measurable things.
It has to be actually measured.
So there's some mechanism for capturing both these states .
and both the transitions between these states .
I love this.
You still don't see what this has to do with WordPress.
It's awesome.
And the third pillar of observability,
it's not just about measuring them.
It has to be one way or another,
. exposed.
And when we say exposed, what does that mean?
It means that these states and transitions of state .
are exploitable, are perceptible
and therefore exploitable outside the system.
Normally, a system that is observable
. does not internally account for its own state.
It must therefore be published in some way.
. and there must be a mechanism,
at least a publication mechanism.
There are usually several.
Is this okay for everyone?
Super!
So, in a computer system ,
because there, what I described ,
can be applied to any system.
What I was saying is a car, a rocket ,
a what, eh?
Yeah, absolutely.
Absolutely.
A dam can even...
Yeah, yeah, absolutely.
So, now, this time ,
applied to the computer system.
We're getting closer and closer to WordPress.
We're still a long way off,
but we're getting closer.
Rest assured.
So, an observable computer system ,
is a system that is capable of providing observations
concerning its operation.
And when we speak of a computer system
and how a computer system works ,
there are three types of observations
which are standards, typologies of observation.
And a fourth category which is a bit of a catch-all
of everything we couldn't fit into the other three categories.
That's how it works, I love it.
The first type of observation is events.
So, events are contextualized descriptions,
transitions.
What does that mean?
It means that an event, in fact ,
describes something that is a transition in the system.
The system has gone from such-and-such a state to such-and-such another state.
that's it.
That's all it describes.
And with no preconceptions abouthow it's all going to be published.
So, really, it's an event.
Because right now, you're thinkingerror log or something like that.
It's just a small part of what it can be.
In fact, the activity is intlogging.
The second type of observation is metrics.
So, this time, what are we measuring?
We're not measuring state transitions.
We measure numerical valuescorresponding to these states.
Activity is monitoring.
Third observation typology, beforemoving on to the catch-all class.
Third observation typology.
Any ideas?
Okay.
These are the traces.
What are traces?
It's capacity.
Well, it's capacity.
It's the state of the various processes andsub-processes that are timed and nested hierarchically.
The incredible activityof tracing is tracing.
And then there's the famous catch-allcategory, where everything else is included.
Here we have the auxiliaries.
So, what are they?
It's, I put aggregated orspecific observation of the system.
So, what does it do?
It can be used for inspection, and in particular in IT, it's called theintrospection of a language, for example, or the introspection of a platform.
In other words, the ability to describehow it is constituted at a given moment.
Does introspection of a languagemean anything to anyone?
PHP, for example? No, it doesn't.
Okay.
Well, we'll see if we have time, because it'sactually a presentation I've never timed before.
So we'll see if we havetime to talk about it.
Because it's not really thesubstance of the project.
What is profiling? It means being able to play a certainnumber of test games on an application or in a computer system.
And being able to measure acertain amount of consumption.
For example, memory consumption, CPU consumption,things like that, of the application.
Everyone knows about Crash Analytics.
Even Google Analytics hasan entry for Crash Analytics.
I'm sure you all useit in your applications.
No, just kidding. No one, I'm sure.
Still, it's a great thing. It lets you send Crashesfrom your applications directly to Google Analytics.
And then, all the alerting.
So, what is alerting based on?
It can be based on events,on traces, on monitoring.
But it can also be based on the correlation ofall this and generate alerts with alert channels.
Let's talk a little about events.
Did you see my nice screenshot with lots of log lines?
That's nice.
So, an event, well, events.
So that's the first pillar.
We're going to talk about the threestandard typologies of observability.
We won't talk about the auxiliaryclass, unless we really have the time.
So, what is an event log?
It's something that presents achronology of what happened.
It's always state transitions.
What happened?
And each event has a certain number of characteristics thatmake it really usable afterwards to do something with it.
That's because that's not the point of thegame, it's not just to watch it go by, in fact.
It's that if we try to read it, tocapture it, it's to do something with it.
It has to be stamped.
So, depending on the system, it can be more or less precise.
When we say stamped, we mean at least to the second.
Well, at most to the second.
It could be to the millisecond or the microsecond, but that's the minimum.
It has to be categorized and contextualized.
So, categorized means that events have event classes.
There are seven classic event classes, used throughout the IT world.
They range from debug to alert, I think, warning, error, notice, info, critical and so on.
That's the category.
And the context is all the additional elements, let's say, the event's metadata,
that enable us to understand the conditions under which this state transition took place.
OK, for everyone?
I love it, I really love it.
So, there you have it, an example of an event.
What a user, so now it's back to WordPress.
What type of event can you have in WordPress?
Which user has created content?
This will answer that question.
And that's it.
Which extension generates errors?
That's what you're used to, after all, because that's what you see in the error logs.
Was an e-mail sent following a sale with WooCommerce?
or did something go wrong somewhere?
Who modified a menu inthe interface, etc., etc., etc.
? So, you can see that in the questions it answers, in the who, theevent doesn't say, in what I've shown you, there is no default who.
The who is part of the metadata.
So, who modified a menu?
The event would be, I don't know, forexample, a notice, of the notice class.
The event itself wouldbe a menu modification.
And in the metadata, you can find out who did it, which menu ID, etc., etc., etc.
And that's it.
That's for events.
Traces.
You see up there, a little zigoui-goui, that's the chain of tracks.
That's what I was saying.
We'll look at the tracks in more detail later, when we do some examples.
So, what are traces?
It's a chronogram.
In other words, if you look at what a trace is ,
I'm going to try to get ahead without getting in everyone's way.
Roughly speaking, you have the beginning of the request,
well, the start of the process, in other words, the start of a process.
And you can see that you have a number of things leading up to the end of the process.
With sub-processes, which are phases,
and that's what we call tracing.
A phase is called a span.
And it's timed.
You see, it has a duration.
It's categorized.
You can't see it, but there is a category.
And contextualized, because here too, it has metadata.
And you can repeat the same query 20 times.
Maybe this phase will always take the same amount of time,
but will have different metadata,
which therefore have different meanings.
And what does this answer?
How is a query broken down?
When I talk about a request, I'm talking about someone clicking on an internal link on the site,
and everything it's going to do behind it,
until the new page is generated and displayed to visitors.
It's a way of saying, obviously, something that's a bit useful for everyone,
. and in the end, all you'll remember is this: how long does it take to generate my page?
And where, in the end, am I perhaps wasting time on my page?
Is the time it takes to send an e-mail admissible?
Is it not admissible?
There's never a right or wrong answer.
Well, 50 seconds to send an e-mail is not good.
Why does a scheduled task take time?
And when we say "why", we mean it because, quite simply, when you look at the spanwise breakdown of these traces, you see ,
you can tell where it took time,
and therefore potentially where there are things to modify.
Here's a little bit about the traces, again, do they suit everyone?
Nickel? Nickel.
We'll move on to metrics.
Metrics, that's what I was saying earlier,
what is a metric?
It's a numerical value, which is measured on a regular basis,
and allows us to see how this value evolves.
In terms of representation, it can be extremely varied,
because you can have a simple counter,
which is just more or less, that's a metric.
It can also be the distribution in query percentiles, for example.
Here again, percentiles speak to everyone?
Yeah, great.
Here too, it's a different way of looking at things, it can be a gauge too.
There are many, many ways to type metrics.
The ones we're going to see most often when we're interested in WordPress,
pretty much.
These are metrics that are measured on a regular basis,
which are counters.
And meters can be represented in the form of curves.
These are points that are curves,
curves that are more or less steep, straight, etc., or rounded.
But overall, that's how it works.
So, what does it mean?
What is the evolution of page generation time?
Let me give you an example that will appeal to everyone.
I have a site with Elementor.
I take an hour to find out how long it takes me to generate a page.
And then I decided to update to Elementor 3.35.0 for February.
And I look at how long it takes to generate a page.
And I realize that I've gained 30% in the view.
That's an example.
How much does the database cost?
Maybe because you're with a hosting company.
or they won't warn you when you've reached your database occupancy limit.
and maybe it's nice to have a counter somewhere that tells you that.
What is the PHP error rate?
For example, if you've suddenly decided to use PHP 8.5
even though you've got some old plugins.
You take a look at the results.
And metrics can tell you that.
How many e-mails are sent per hour, etc. .
Finally, you'll see in the examples,
you have the attitude to imagine all the metrics.
and all the analysis of business metrics, including business metrics,
that you could possibly want.
This is it.
So, let's go back to the stories of our three pillars of observability
and see if WordPress is observable.
So, the first pillar, from memory, was states.
Is WordPress a system that can have several states?
And are these states qualified and quantifiable?
In your opinion?
Yes.
I do.
Are they measured, these states?
And are the transitions actually measured?
And is there indeed a capture mechanism?
Well...
No.
And then, are these unmeasured values still exposed?
No, they aren't.
So, WordPress is not natively observable.
Natively, that is, if you take the distributed core version and do nothing else.
Now, we're going to see that there are a few ways of solving this problem.
Because you really want to make your WordPress observable
and you can't live without it.
So the first thing is to accept the fact.
WordPress is not observable in its current state.
I'm not going to add 50 plugins or 50 things that are going to weigh it down.
I'll leave it as it is.
Well, okay.
That's one way of looking at it.
Use only integrated tools.
So, typically, integrated tools are things that are going to be at the PHP level,
that may even be server-side.
I'm thinking of things like PHP X-Ray or things like that.
Honestly, if you have a host that offers it, all the better.
But it's very rare.
Tools are very heterogeneous.
Not necessarily the best solution.
Now, if you're used to a particular tool and you're working in a very heterogeneous environment, it's not necessarily the best solution.
environments where you still have that tool, use it, that's fine.
You can also tool specific subsystems.
For example, in WordPress, you can check that...
This is an example that came out yesterday on contribution day.
You can check it out and make an event log of the email sent.
and check each time what the WP Mail function responds to.
Is it OK? Is it bad?
You won't know much more than that, but at least you'll know that you have a measurable error rate.
You can use the tools of a service provider.
There are a number of SaaS solutions that offer direct tooling at a more or less low level.
in relation to the OS and in relation to your WordPress.
For example, Sentry, and many others.
They offer tools.
Most of the time, it's not directly visible in your WordPress.
And then afterwards, you can use an open tool designed for WordPress.
So when I say that, I mean, you can use plugins to do that.
We're going to talk about three...
Is everyone okay? All good?
Feel free to interrupt.
If at any point something goes completely wrong, don't hesitate.
So, a few examples of tools.
I'll list them for you.
I have three tools to show you, all three of which can be found on the WordPress.org directory.
and which allow you to produce a more or less strong, more or less targeted form of observability.
The first is...
So, I took this one.
There are plenty of tools in this category.
They're the ones that make it possibleto report on activity on a website.
When we talk about activity, we mean...
So this one is WPActivityLog, whichexists in a free version, then on the repo.
This logs what's going on with extensionsand themes for the WordPress core.
Basically, you'll have...
Such-and-such a person has logged in, such-and-sucha person has deleted a menu item, and so on.
There was a WooCommerce order, that's it.
In terms of scalability, this one, this type of application, is very, very weak.
Because it wasn't designed to be totally extensible.
There are very few APIs, very few hooks.
And so, you'll find it hard to go beyond what the tool provides.
It provides you with the tool, you take it as is, or it's not the tool you need, overall.
And in terms of exposure, these tools do two things.
Either internal WordPress viewers, as we'll see later in the back-office.
Or in push mode, notably with WP Activity Log.
In the paid version, this time, you can pusher to...
I think there are two examples, there are two services to which it pushes.
When I talk about a service, I'm talking about an external SaaS service,
and which allows you to store, and which manages its own storage size concerns,
ingestion of events, etc.
In other words, you're relieving WordPress of all these tasks.
Which are subjects.
Don't kid yourself, there are times when you need to be observable.
If it's badly done, it can add overhead to what you're doing in WordPress.
Then, you have a second...
So, the first tool is one that works all the time,
when you have activity on your site, of course.
Otherwise, nothing much happens.
The second is Query Monitor.
I guess everyone knows it by now.
Magnificent.
So this one is both a little observability tool,
but it's also a very, very good tool for introspection.
That's what I was saying earlier.
Introspection means being able, for a language or a framework ,
to say what it's made of,
and where it's going, and what it's done to get there.
So here again, it's WordPress.
This adds PHP and database to the previous one,
which is pretty good.
And it's also an extension and a theme.
Now, in terms of extensibility, it's very nice,
because Query Monitor not only has APIs ,
but it also has a library of add-ons,
and any plugin or solution editor
solution vendor can develop a specific Query Monitor add-on for their own tool.
For example, we could imagine, I think,
Automatique to create a specific Query Monitor add-on for WooCommerce
for WooCommerce subjects only.
And on the other hand, you'll see,
the exhibition is only internal viewers.
In fact, it goes even further than that,
because Query Monitor is only linked to the user's session.
and to those who have the capabilities to see Query Monitor.
In other words, it'll never tell you what's going on.
in other people's sessions,
someone who hasn't even created an account
and is in the process of making a purchase, for example, on a site .
You won't get it.
And in that sense, Query Monitor is more of a debugging or dev tool,
you name it,
but it's something that lets you say to yourself ,
I'm the site admin, I can see what's happening when I go to this page, and so on.
But it doesn't say anything about what would happen on this page.
if I wasn't the administrator.
And that's something to keep in mind anyway.
So after that, you're big, big and big ,
and you can tell just about anything that can go wrong,
about cookies, about the fact that you don't necessarily have the same rights .
as a user, etc.
And then, the third tool, which I find the best in all modesty.
I say this because it's a tool I'm developing,
so obviously the joke's easy.
This is Decalog, which is a logging tool,
monitoring and tracing tool,
for all WordPress, PHP and database.
You're going to say, but that's great, it replaces all the others.
Yes, but it's much more complex and cumbersome to implement.
So it may not be suitable for every situation.
It's extensible, too, since it has APIs.
What's more, it has a transparent SDK.
So, a little detail about a transparent SDK.
An SDK means you can embed it in your software.
into your developments to account for specific
within your own developments.
You develop a plugin, you embed the SDK.
Transparent, meaning that once you've embedded it
to your developments, you can publish it like this
and it will work transparently,
whether or not there's a Decalog on the site where it will run as a target.
It won't generate errors because there's no Decalog.
That's what it means.
And in terms of exposure, it's POOL, PUSH and internal viewer.
Even if, as always, the principle of the internal viewer is that always ,
is to take the risk that viewing it internally is a form of intrusion,
into the processes we're measuring.
So much for that part.
that's it.
So, here it is.
And now, let's take a look at a few tools.
So, first tool.
I'm going to explain a little how Idid it, so that everyone understands.
Three weeks ago, I created a demo site.
And I scripted, in fact,the activity of this site.
So, it's a WooCommerce site, with a template, I don't knowwhat, a theme, I don't know exactly what it is anymore,
with a number of products, and I've scripted it so that there will be new comments on a regular basis,
there are new users, sales are made, etc., etc. .
So, it's a site, you might almost think it's a site with real activity, in fact.
Just a few things.
Here you have an example of what Activity, WP Activity, I don't remember the name, WP Activity Log, looks like.
You have an internal viewer that lets you see, so let's refresh a little,
which lets you see what's happening on your site in antechronological order.
So, don't be surprised, the IP address here will always be 127.001, since it's my scripts that are running to make it look like things are happening.
These aren't real visitors.
And so here you have the list of events that have taken place, in reverse chronological order.
You can see that here, for example, you know that on the 6th at 3:45am, you had an order that was marked as Fade,
and you have the order ID.
Here it is.
And you can see that you have, as I was saying, this is part of the metadata.
It allows you to specify what this event is.
This event is a transition change, as you can see.
He went from a state that was before I don't know which, I don't know what the...
Maybe in class, for example, failing.
And you'll have, just like that,the whole list of what's going on.
And you'll finally havethe answer, voilà, which...
Who's the customer who's a bit of a site admin, who'sgone to delete a menu and says he's never done anything?
And that's it.
It's a great way toanswer questions like that.
It's great fun.
That's what we can say about WP Activity Log, because inthe end, it's a tool that is, as I was saying, in free mode.
And it lets you do just that.
It won't let you do much more.
But already, it's a real... a realsuccess in terms of observability.
The second tool we've talkedabout is the famous Query Monitor.
Now, I'm an admin, so I have access to it.
And how do I access it?
Here.
And what's this?
It's all the information aboutthe query I've just made.
In other words, if Ireload my page, that's it.
You can see that I've taken care to create a sitethat runs slowly, so that you can see things clearly.
It tells me that, well, it took a second to generate thepage, that it consumed 24 megabytes of memory, and so on.
But above all, all the elements you're going to findthere, for example, the queries in the database, and so on.
It's unique.
It only concerns the query I've just made.
It doesn't say anything elseabout what's going on outside.
On the other hand, you sayto yourself, okay, it's still...
Okay, it's still relatively uninteresting.
Actually, that's not true.
Interest is not relatively low.
The interest is extremewhen you're doing dev.
Honestly, because you have...
You can go and see the stack of hooks that have been called,the filters that have been applied, that haven't been applied.
I mean, it really is a magicaltool for WordPress-specific dev.
But it only stays in theadministrator's session.
And then, in order to register something or touchthings, there are quite a few things to set up.
So that's the second tool.
So, you see, you can have a look.
You can see the pile of documents that have beencalled up, or that have been queued up, and so on.
It's a great tool for development.
I really recommend you try it out sometime.
You'll see, you won't be able to live without it.
But, oh yes, one thing.
It's not meant to be used as a prod.
Because just think, you're not potentially the only site admin.
And that the customer or customers, or I don't know, may have several administrators.
And it's going to piss everyone off to have this thing.
And on top of that, it's going to generate support for you.
Because customers who aren't necessarily techies and who see this inside ,
they'll go digging in there.
What's more, sometimes it generates errors.
Because they show all the errors that occur .
So you'll see lists of errors appearing.
Don't leave it in prod.
That's my advice to you.
And finally, the third tool,
is a little more complex to implement.
First, on Query Monitor, do you have any questions, perhaps?
Yes.
It's a bit like bugs, isn't it?
A little bit, yes.
Yes.
Yes, exactly.
Yes.
Ah, sorry.
Yes.
I was wondering about WP Activity Log.
Doesn't it generate toomuch data in the database?
I'd like to ask you.
What's too much?
It generates data in the database.
Yes.
Is it too much?
That depends on whatyou're prepared to receive.
It depends on how much you're willing topurge, how regularly or irregularly you do it.
Yes, it generates data in the database because WP Activity Log, by default,when you don't have the paid version, it stores in the database completely.
And there's a way topurge it from time to time?
Yes, yes, yes.
You can purge it, yes, yes.
Okay.
Right, yes.
In any case, this kind of informationdepends on what you want to use it for.
But generally, this kind of thing, more than aweek's history, I don't really see the point.
Okay.
But it can be useful nonetheless.
I think in this thing, in this tool, there's even a way of filtering toallow you to delete certain classes of events and keep only certain others.
If you want to have a history, then you don't have a complete history, but youdo have a hole-in-the-wall history of the most important events, for example.
Okay.
Ok, thank you.
And Eddy had a question.
It's just to say that QueryMonitor works in the background.
Because that's what's interesting.
Now, obviously, I didn'tspecify Query Monitor.
But as long as you're an admin, in fact, itworks everywhere on the site you're visiting.
In other words, it worksin the front and back office.
On the other hand, obviously, it won't really work, Ithink, in crone, not on other ways of accessing the site.
Yes, another questionabout WP Activity Log.
It's not technical, it's justa question of confidentiality.
Do we have to ask for the customer's consent, or thatof the users who will then be identifiable via the tool?
Well, look, I don't know because I don't thinkthere's any option for anonymizing IP addresses.
And so, I leave you with this thoughtand I know you already have the answer.
The answer, in theory, is yes.
So, yes and no, because you're going to invoke the sacrosanct technicallog that the RGPD says we have the right to keep for a year, etc.
Those aren't technical logs.
No, no, no, no. You can see, thereare the names, there's everything.
No, no, they're not technical logs.
It's really, it's...
But you're right, it wouldonly be technical logs, normally.
You don't have to notifythem and you don't need to...
As long as you don't keep more than 364 days, you don't havethings to fill out in your processing log or anything like that.
A lot of it is when you'relogged into the application.
A lot of...
The logs that are recorded are whenyou're connected to the application.
Yes, absolutely, yes.
So, similarly, there's gbd, it's different, since in the conditions of theapplication, in general, there's this part that it's essential logs for use.
And so, there's a way to...
It's easier to...
If the person isn't logged in.
If it's just a visitor, then clearly youneed to have the application's log.
Or, very well, if they're logged in...
Okay.
Anyway, we'll ask a fewquestions afterwards, if you like.
Then, I'll tell you aboutthe last tool, quickly.
It's Decalogue.
Where is it?
Hop.
There it is.
Decalog.
Now...
No, I'm sorry.
Decalogue is certainly a more complextool, but it's much more complete.
Quite simply because, to sum up what it does, in terms of events andmetrics, it's capable of doing what Query Monitor does, but for all users.
And not just for front and back ends.
It's also going to do it onChrome, on APIs and so on.
I'm not going to go into Ecalog's theory.
There's a lot in Decalogue.
Just know that the principle is that youhave what we call loggers and journalizers.
What are loggers?
It's something thatcaptures its logging class.
It can be metrics, events or traces.
And it does something with it.
Most of the time, what does it do?
It sends it to an external service, which maybe hosted by you, hosted elsewhere, and so on.
We'll look at a few examples.
So, broadly speaking, there arethree main classes of journalizers.
There are loggers for traces, loggersfor metrics and loggers for events.
In this case, I've included a few sothat you can see what they look like.
For example, you can see traces.
Here, I've taken them directly.
You can see the WordPress logo.
The WordPress logo doesn't mean that it takes after WordPress.
These are journalizers.
So, it means that it takes the traces of everything you do and puts them in a WordPress database or in APCU,
since, in this case, you can also choose APCU.
As you can see, you have here a list of traces that have been...
With beautiful data.
It's a site that takes no more than six seconds to load from the front.
And it lets you see what's going on with your WordPress loading.
Well, yeah, it's possible, but then you lose...
And that's it.
And so, of course, as we were saying earlier, you also have the metadata that corresponds to this.
So that was the...
We'll put this back in the meantime.
You have another type of element, category, observability that is stored.
And here, we're going to call on something else.
In the Decalogue setting, I told it to send all theevents from this site, so World Company, that debo there.
I asked it to send it to anexternal tool called Locky.
Locky, in fact, is a tool that goes withGrafana, for those of you who've heard of it.
It's a stack of Grafana, Locky and so on.
I asked it to send the metricsto an InfluxDB database.
And for those who love Prometheus, Decalogue alsolets you publish metrics in Prometheus format.
So, what does all this add up to?
Well, let's take a look, let's take a look, ah sorry,wait, let's take a look at this, hop, where is it?
It's there, we'll go and look at the logs.
That's what I am.
So, we'll go and have alook, we'll search right away.
What did I call it? Demo.
How can I find all these logs?
On the other hand, we'llgo and have a look, that's it.
That's it, that's it.
It's not the labels.
We'll look, I know how to do it.
By service, maybe.
Here we go.
And we must have somewhere.
So that's service categorization.
It's bad luck, we don't have it either.
We don't have it either.
Hop.
That's that.
And now we know that...
No, sorry.
Well, to tell you the truth, I hadprepared a screen just for you.
And here it is.
Yeah, well, we're not gonna get it.
Yeah, yes, we will.
We'll have it like that, I think.
There we go.
We'll have it in the form of...
So there you have it...
If I do that, sorry.
You've got calogues tellingyou that it's generated events.
So these are events.
And if you want to access the eventlist, you'll have it both in Grafana.
But I'm not going to give you the Grafana demo, sinceI can't remember where the screen I programmed went.
But here it is.
But you also have it here.
In the same way.
So you can see it in WordPress.
You've got it like that.
It's...
So on the other hand...
Yeah, excuse me.
I'll just...
Hop.
Is this okay?
Can everybody see?
Yes, we can.
So these are calogues thatpick up events as they happen.
And you can see, for example, that here, Maria DB said thatthere was an insert that had exceeded the maximum time.
Here you have pagesthat have not been found.
Each time, you have thechannel on which it's happening.
And you'll be interested to see that you can actuallysee what's going on in your crônes with events.
This is not normally thecase with Query Monitor.
And finally, the last example I wantedto show you this time is a dashboard.
This time with metrics.
So here, for example...
Here it is.
These are metrics retrieved from the site.
So here, I've made four quick categories.
This one has been recorded.
That's nice.
Thanks, Grafana.
Here's an example.
This is the number of eventsand comments created per hour.
You've got attachments, products,the number of active users, and so on.
You also have more techy subjects.
For example, you can seehere, this one is really interesting.
This is the kind of thing that'sreally interesting to produce.
It's the time it takes fora cone to be executed.
And you can see the peaks right away.
These are the peaks.
It's pretty typical, these spikes.
These, these, these.
These are the oneslinked to Action Scheduler.
Action Scheduler is the icon engineintegrated into WooCommerce.
Well, it's not just integratedinto WooCommerce.
But it does allow you to do WooCommerce.
Well, to manage tasks in stock.
Then you've got some pretty cool stuff.
After that, it's up to you to imagine whatyou can do with the metrics, of course.
You could, for example, find out how manytables you have in your WordPress installation.
How data volume evolves over time.
The evolution of index volume.
Finally, you've got...
How many SQL queries you generate per hour.
This is a really interesting indicator.
In fact, when you activate object caching, it'ssupposed to drastically reduce the number of queries.
And you can see right away whetherthe object cache is working or not.
And if it's correctly configured.
Now you've got more indicators.
Yes, it's hidden there.
Here it is.
We'll bring it up.
You see, for example, here.
You see here, for example, theactivity of the WordPress REST API.
You can see the latency times.
So, the latency times areone API execution at a time.
That's how long it takes.
For example, thepost, get, etc. re-port.
In and out.
The volumes of data that are exchanged.
I mean, it's a whole lot of...
That's all.
It's up to you to make yourown dashboards with this data.
And of course, making dashboards for the sake of makingdashboards is great because it allows you to keep track.
Above all, the advantage of using, for example, Grafana, but also other toolslike Datadog or things like that, is that you can create alerts on these dashboards.
As a result, you no longerneed to look at your dashboards.
You simply wait to receive alerts when something goes wrong or when it has detected that something is about to go wrong.
Was that clear to everyone?
Or was it not?
Because it wasn't too long.
Yeah, there are questions.
Great.
Thanks, guys.
So, there's an API we can reuse to build our own system.
de board where we don't have to connect to Datadog or to an external service that would have to be paid for.
It's not just Datadog or Grafana.
Decalog lets you send to...
Does your question concern the type of service it can send to?
Yeah, or even develop neutral.
Ah, you can develop your own.
You can do that.
On the other hand, you should know that most people who develop their own are in boxes.
They're people who have...
I'm not saying this for you, but they've got great technical skills,
who make tools that are monstrous.
And in the end, it's their own business to sellthat service, because that's all they do anymore.
So, I'd advise you to useexisting stuff that may be free.
What's available as a free solution?
Grafana, for example, is a free solution.
That's the first thing, but we can take a look atDecalog, which lets you send logs to all these services.
Some are included in the browser.
Some of them launch themselves.
There's a really nice one called Ray, by Spati.
It's a Belgian company that makes absolutely fantastic tools for dev,
. which allows you to have a small window in macOS or Windows,
on the side of your dev stuff.
And in fact, the site constantly sends event logs
. and you see the logs scrolling as you screw up your source code.
I love that.
That's great.
Does that answer your question?
Perfect.
Ok, great.
Thank you for the conference.
It was very, very interesting.
You're welcome.
My little question is about performance.
Does making a site observable require more server resources?
and therefore harm application performance?
Well, that's a very good question.
It all depends on how it's done.
Query Monitor, clearly, as it's displayed in your query.
You've got overhead.
And yes, it does consume stuff.
WP Activity Log consumes resources.
It consumes the database if you're mad about purging, etc. .
Decalogue consumes CPU resources.
Now, most of these tools, especially the well-made ones like Query Monitor or Decalogue,
will actually do most of the work in the WordPress shutdown hook.
And so, in fact, when you're on the front end or when you're in regular use,
page generation time for the user will not change,
since everything will be done afterwards, once the page has already been sent.
Finally, that what WordPress needs to generate has already been sent to the user.
That's the point of putting it in the shutdown.
My question is similar to the previous one,
but it's, wouldn't it be better, instead of having a plugin ,
to have a tool glued directly to the server?
I'm thinking of Blackfire, for example,which I believe does similar things.
And would that meaneven better performance?
Honestly, Decalogue and Query Monitorhave an impact on performance that's...
It's less than a millisecond.
So, let's say in time.
Then, in terms of CPU cycles, it undoubtedlymakes a difference, but it's very, very small.
After that, you have to seethat a tool external to WordPress,
he's not going to give you WordPress observability,
it's going to make your PHP stack observable.
And if WordPress isn't capable, or PHP isn't capable of capturing things
happening in WordPress or vice versa, which is the case,
because, ultimately, WordPress is a framework that sits on top of PHP,
it won't do you any good.
. unfortunately.
And so, that's why, in the end, either you do it at the core level ,
or you do it in plugins that just grab the right hooks from the core .
to do the same thing.
But it'll never be as rich as it is if you actually do it,
. with a plugin at core level.
That's where you get the richness of metadata, in particular.
Is there Elasticsearch? OpenSearch coming soon?
Maybe, yes.
We're out of money.
We've run out of money for Elasticsearch.
I'll have to ask the tool's volunteer developers.
What's more, it's a fork, which normally means there's Elasticsearch.
I don't know about soon, but yes, it's in the pipeline.
Thanks for the conf.
What do you think of Sentry's integration into WordPress?
I'm not a big fan.
Or anywhere else.
For elsewhere, I don't have much of an opinion.
I'm not a big fan, because I find it extremely intrusive.
They defend themselves.
But it's very intrusive.
And what's more, you don't really control the flow of data to where it's going.
I've seen a server with Sentry all over the place.
It's a little scary.
You get the impression that there are flows going everywhere and that it's not going very well.
So, I'm going to say not well mastered, but that's not true.
But I don't really trust it.
On the other hand, it produces nice results.
It's typically the kind of tool that's not up to the level of the OS,
. but not at the level of WordPress, which are a little in between.
And so, there are some things it's going to miss in WordPress, obviously.
On the other hand, there are some things in the OS that it will pick up,
. that wouldn't be picked up by a WordPress plugin.
And that's it.
Anyway, a plugin...
I mean, when you're trying to figure out .
what your Linux logs are in your WordPress ,
you've got a design problem.
So, anyway, you see, it's .
Unlikely.
Already, these tools make it possible,
whether Query Minitor or Klogs,
it still allows you to capture, for example,
changes in the activation or deactivation of PHP modules.
It captures everything that goes into the database.
I mean, it captures what's really useful for WordPress, you know.
Even a PHP version change, it'll see it through.
After that, if it's behind the file system ,
. there are a few peculiarities,
. on the Linux side, it won't see it.
That's it.
Thank you, Pierre.
Thank you all.
A round of applause.