<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mateusz Janota</title>
    <description>The latest articles on DEV Community by Mateusz Janota (@z4nr34l).</description>
    <link>https://dev.to/z4nr34l</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F929930%2F98966e95-83b7-4acf-8ccb-c2bc3ecf0b50.jpeg</url>
      <title>DEV Community: Mateusz Janota</title>
      <link>https://dev.to/z4nr34l</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/z4nr34l"/>
    <language>en</language>
    <item>
      <title>Not Just AI Chat: How a Skill-Based Agent Supports Everyday Work</title>
      <dc:creator>Mateusz Janota</dc:creator>
      <pubDate>Fri, 17 Jul 2026 07:05:42 +0000</pubDate>
      <link>https://dev.to/zanreal/not-just-ai-chat-how-a-skill-based-agent-supports-everyday-work-2ci4</link>
      <guid>https://dev.to/zanreal/not-just-ai-chat-how-a-skill-based-agent-supports-everyday-work-2ci4</guid>
      <description>&lt;p&gt;&lt;strong&gt;AI is now present in many companies, but that does not automatically mean its capabilities are always being used well. It often helps only in isolated ways: writing text, summarizing meetings, organizing notes, or doing quick research. That can be useful, but there is a big difference between occasional AI use and integrating it into company processes in a sensible way. And that is exactly where AI agents and skills come in. See how these solutions work, explore their use cases, and find out how you can use them in your own work.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7yb6j918r287272qzgex.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7yb6j918r287272qzgex.jpg" alt="Digital brain made of circuits symbolizing artificial intelligence" width="800" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Many companies have already gone through the first stage of working with AI. First came the standard chat. Later, more tailored browser-based assistants appeared, such as custom GPTs in OpenAI tools or Gems in Gemini. That was a clear step forward, because it made it easier to define the context, tone, and types of tasks such a tool should support.&lt;/p&gt;

&lt;p&gt;It quickly becomes clear, however, that this still does not solve everything. When AI is meant to provide support not occasionally, but regularly, within a specific process and according to specific rules, a standalone assistant stops being enough. You still need different tools for different tasks, still have to watch quality, still need to add context, improve the output, and check whether the final result is actually usable. The user is also limited mainly to a single prompt and, at most, a knowledge base, which is not always enough to get the desired result.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This is exactly where AI agents and skills come in, making it possible to move from ad hoc AI use to a more structured way of working.&lt;/strong&gt; Instead of relying on limited browser-based assistants and hoping for the right answer, a company can gain more advanced, easier-to-use support that can also be developed and adapted to its own needs in a straightforward way.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is an AI agent?
&lt;/h2&gt;

&lt;p&gt;Put simply, &lt;strong&gt;an AI agent is a tool prepared for a specific role&lt;/strong&gt;. It does not work only like a chat interface answering one question after another, but like an assistant embedded in a specific type of work. That is why it often turns out to be much more specialized.&lt;/p&gt;

&lt;p&gt;Such an agent can be configured, for example, for content creation, sales support, organizing documentation, or technical tasks. &lt;strong&gt;What sets it apart from browser-based assistants is that it does not start every time from an empty field and a new prompt.&lt;/strong&gt; It works within a more structured context and according to specific rules. It also gives you much more control: you can provide it with a full set of requirements, information, and restrictions, while not being nearly as limited by the top-down guidelines imposed by browser-based tool providers.&lt;/p&gt;

&lt;p&gt;That matters for companies because day-to-day work rarely comes down to a single instruction. It usually involves several stages, different standards, revisions, and dependencies between people, documents, and tools. &lt;strong&gt;An agent becomes valuable when it can fit into that structure and improve the way company processes run.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;How does it work? &lt;strong&gt;From the user’s perspective, the workflow is very similar to talking to a standard AI chat.&lt;/strong&gt; You tell the agent what you need, and it carries it out. The difference is that it can draw on a broader base of guidelines and information, choose its own way of completing tasks, and &lt;strong&gt;use tools and software along the way&lt;/strong&gt;. If you give it access, it can help you edit an Excel spreadsheet, create a document, pull information from the internet, update a database, and more. It can also verify the results before delivering them to you.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb296ng1x5pgqcowrv85g.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb296ng1x5pgqcowrv85g.jpg" alt="Person working on laptop and using smartphone in a café workspace" width="800" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What are skills?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;A skill is a specialized set of instructions, rules, and best practices&lt;/strong&gt; that an agent uses for a specific task.&lt;/p&gt;

&lt;p&gt;For example, in a marketing department one skill may be responsible for brand tone of voice. Another may focus on writing blog articles. Another may handle social media posts. At the end, the agent can use a separate skill to verify whether the final output matches the guidelines.&lt;/p&gt;

&lt;p&gt;In another team, skills may relate to technical documentation, ticket descriptions, test case creation, or organizing project knowledge.&lt;/p&gt;

&lt;p&gt;This is exactly what skills do: they help the agent understand &lt;strong&gt;how to complete a specific task, which rules to use along the way, and how to check the result at the end&lt;/strong&gt;. Thanks to that, you do not have to open one assistant to write a blog post, another to create newsletter content, and a third to review it. You simply work with one agent in one window, and it selects the right skills on its own and uses them during the process.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why is a skill more than an expanded prompt?
&lt;/h2&gt;

&lt;p&gt;At first glance, it may seem that a skill is simply a longer prompt. In reality, the difference is bigger. In a regular chat, you can enter even a very detailed instruction, but with more complex tasks a problem appears quickly: &lt;strong&gt;you have to fit too many rules, too much context, and too many expectations into one place at once&lt;/strong&gt;. On top of that, there are length limitations and the risk that something gets skipped along the way or disappears deeper into the conversation. With the next task, you often have to set everything up again anyway. That still works for simpler things, but when the work has several stages and a specific standard, that model simply becomes inconvenient.&lt;/p&gt;

&lt;p&gt;A skill organizes things differently. &lt;strong&gt;Instead of packing everything into one instruction, you can separate roles and then combine them into one process.&lt;/strong&gt; When creating an article, one layer can guard brand tone, another the structure of the text, and another the final editing. In technical work, you can similarly separate documentation, requirement descriptions, review standards, and the preparation of supporting materials.&lt;/p&gt;

&lt;p&gt;As a result, the company gains &lt;strong&gt;more control, more consistency, and less dependence on whether someone happened to "write a good prompt."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fu6m9nnxq1zwb8u3kltiz.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fu6m9nnxq1zwb8u3kltiz.jpg" alt="AI text on circuit board background representing artificial intelligence" width="800" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Use cases: from content to IT
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The biggest value of agents and skills becomes visible when they take over the most repetitive and time-consuming parts of everyday work.&lt;/strong&gt; They can help gather information, shape it into something coherent, adjust the result to agreed rules, and check whether everything is correct before the material moves forward. That is exactly where it becomes clear that AI can effectively bring more order to the way a team works. Below are a few example use cases for agents and skills. Some of them may inspire you to implement a similar approach in your own company.&lt;/p&gt;

&lt;h3&gt;
  
  
  Content and marketing
&lt;/h3&gt;

&lt;p&gt;This is one of the most natural places to start, because here the difference between one-off AI use and a well-structured process becomes visible very quickly. In a standard chat, you can ask for a draft of an article, a post, or an email. The real challenge starts later, when that material has to be adjusted to the brand tone, campaign goal, channel requirements, text structure, and final quality standards.&lt;/p&gt;

&lt;p&gt;That is why, in practice, a &lt;strong&gt;content agent&lt;/strong&gt; often works much better. It can handle different types of content and choose the right skills for each one. In one task, it may use a skill for blog articles; in another, a skill for product descriptions; and in yet another, skills for newsletters or SEO content. On top of that, there may be a separate skill that guards brand voice, another for final review, and yet another for the requirements of a specific channel or audience.&lt;/p&gt;

&lt;p&gt;This kind of solution becomes especially useful when one company creates many different types of content, each governed by slightly different rules. A blog article requires a different structure than a newsletter. A product description for a company’s own store will look different from one prepared for a marketplace or for a specific retail chain that imposes its own limits on length, information layout, or the way product parameters are presented.&lt;/p&gt;

&lt;p&gt;In a well-configured model, it looks very simple from the user’s perspective: &lt;strong&gt;you write to one agent and describe what you need, and it selects the right skills to complete the task&lt;/strong&gt;. Thanks to that, there is no need to manually switch between different assistants or explain every time how the article, product description, newsletter, or campaign copy should look.&lt;/p&gt;

&lt;p&gt;Such an agent can create, among other things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;blog and how-to articles,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;product descriptions, including versions tailored to different guidelines and sales channels,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SEO copy, for example category descriptions,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;newsletters and marketing emails,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;landing page copy,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;social media posts,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;service and offer descriptions.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This does not mean that the agent "replaces a copywriter." It simply helps you get to a workable draft faster, one that is &lt;strong&gt;closer to the company’s standard&lt;/strong&gt; and much better suited to the specific goal than a random draft from a chat.&lt;/p&gt;

&lt;h3&gt;
  
  
  Sales and client communication
&lt;/h3&gt;

&lt;p&gt;In sales, a lot of time is taken up by tasks that come back almost every day: preparing an offer, responding to an inquiry, sending a follow-up after a meeting, summarizing arrangements, or refining sales materials. All of this usually happens under time pressure, so it is easy to end up with communication that is too general, inconsistent, or simply written in a rush.&lt;/p&gt;

&lt;p&gt;An agent can help bring order to this area. Instead of building every message from scratch, a salesperson gets support that understands the logic of the process, can turn notes into a sensible structure, and helps keep the communication both clear and natural. If a company has different client types or different offer variants, skills help organize that &lt;strong&gt;without having to revisit the same arrangements over and over again&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The biggest benefit here is not speed alone. It is more about the fact that &lt;strong&gt;fewer things have to be stitched together manually&lt;/strong&gt;, and the quality of communication becomes more predictable.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fss06vizdeeyir6cggaox.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fss06vizdeeyir6cggaox.jpg" alt="People collaborating at laptop, pointing at screen during discussion" width="800" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Operations, procedures, and internal knowledge
&lt;/h3&gt;

&lt;p&gt;This is a less flashy area than content or sales, but in many companies this is where a noticeable improvement can be felt. Knowledge tends to be scattered across documents, emails, notes, and messaging apps, and in some cases it remains only in the heads of certain employees. As the team grows, that starts to cost more and more time.&lt;/p&gt;

&lt;p&gt;An agent with skills can support the organization of procedures, checklists, work standards, and internal materials. It is worth using it, for example, to collect scattered arrangements into a more usable form, standardize documents, or organize information in a way that makes it easy to access at any time.&lt;/p&gt;

&lt;p&gt;This may not be the most spectacular use of AI, but it is often one of the most sensible. &lt;strong&gt;Less chaos in internal knowledge usually means fewer mistakes, fewer recurring questions, and smoother onboarding for new team members.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  IT and software development
&lt;/h3&gt;

&lt;p&gt;In technical teams, the challenge is usually not a lack of competence, but how much time is lost by constantly switching between different types of tasks. A developer, tech lead, or technical project manager does not only build the solution, but also describes requirements, clarifies tasks, translates technical issues into language the business can understand, creates documentation, and checks the quality of what moves forward.&lt;/p&gt;

&lt;p&gt;An agent becomes extremely valuable support in each of these areas. It relieves the team where working material needs to be organized quickly, but it can also support programming itself: prepare a solution outline, help with refactoring, suggest tests, catch potential issues, or organize a piece of code before further work begins. &lt;strong&gt;The point is not to replace the developer, but to shorten the path to a sensible starting point and take some of the most repetitive work off the team’s shoulders.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A properly configured agent can improve, for example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;preparing solution outlines and implementation variants,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;refactoring and code cleanup,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;writing and expanding tests,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;support with debugging and error analysis,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;creating and organizing technical documentation,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;describing tickets and requirements,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;preparing test cases,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;maintaining review standards,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;translating technical issues into language the business can understand,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;collecting and organizing project knowledge.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A well-configured agent therefore helps not only to "generate something," but above all to &lt;strong&gt;shorten the distance between technical context and a usable result&lt;/strong&gt; that the rest of the team can actually work with.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8389lxpvi7yj84a9a2jf.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8389lxpvi7yj84a9a2jf.jpg" alt="Computer screen with programming code in dark developer workspace" width="800" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What does a company gain from agents and skills?
&lt;/h2&gt;

&lt;p&gt;The most important benefit is not simply that something can be done faster. &lt;strong&gt;Speed alone means very little&lt;/strong&gt; if the result still needs a lot of fixing or if someone has to explain the rules from scratch every time.&lt;/p&gt;

&lt;p&gt;Much more important are the effects you can see in everyday work: &lt;strong&gt;less manual reconstruction of context, more consistent quality, a shorter path from a brief or notes to usable material, and less chaos&lt;/strong&gt; between people, documents, and tools. On top of that come easier scaling of repetitive tasks and more control over how AI is used within the company.&lt;/p&gt;

&lt;p&gt;Most often, this translates into very concrete benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;time savings in tasks that return regularly,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;fewer revisions and less work done twice,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;greater consistency in communication, content, and documents,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;faster onboarding of new team members,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;easier organization of knowledge and work standards,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;more predictable outcomes, even when tasks are handled by different people.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  An agent with skills vs. a browser-based assistant
&lt;/h2&gt;

&lt;p&gt;Browser-based assistants are still very useful, especially for simpler, one-off tasks. Most often, however, they rely primarily on what you type into the prompt and possibly on an attached knowledge base. That is enough as long as the task is simple. With more complex work, however, it quickly turns out that you have to keep adding more rules manually, click through settings, or switch between different assistants. That is exactly where an agent with skills gives you more freedom, control, and convenience.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Area&lt;/th&gt;
&lt;th&gt;Browser-based assistant&lt;/th&gt;
&lt;th&gt;AI agent with skills&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Starting point&lt;/td&gt;
&lt;td&gt;Reacts mainly to the current prompt and possibly a knowledge base&lt;/td&gt;
&lt;td&gt;Works according to a defined role and a set of rules&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Context&lt;/td&gt;
&lt;td&gt;Often has to be rebuilt&lt;/td&gt;
&lt;td&gt;Is better embedded in the process&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Quality&lt;/td&gt;
&lt;td&gt;Depends heavily on the prompt&lt;/td&gt;
&lt;td&gt;It is easier to maintain a consistent standard&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Style and tone&lt;/td&gt;
&lt;td&gt;You have to keep reminding it&lt;/td&gt;
&lt;td&gt;They can be handled by separate skills&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Multi-step tasks&lt;/td&gt;
&lt;td&gt;More likely to lose conditions and priorities&lt;/td&gt;
&lt;td&gt;Can combine several layers of work at once&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ease of use&lt;/td&gt;
&lt;td&gt;With more complex tasks, it is easy to get stuck adding details and clicking through options&lt;/td&gt;
&lt;td&gt;One window, one agent, while the skill selection happens on its side&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Teamwork&lt;/td&gt;
&lt;td&gt;Harder to build a shared way of working&lt;/td&gt;
&lt;td&gt;Easier to base work on one common standard&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Uses tools and software on the computer&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Put briefly: &lt;strong&gt;a browser-based assistant works well when you need quick help. An agent with skills is better suited to tasks where AI is meant to operate not occasionally, but in a more structured, convenient, and controlled way.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn8kwnyj7q6bgb2f2nj6i.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn8kwnyj7q6bgb2f2nj6i.jpg" alt="Team meeting in modern office with large windows and city view" width="800" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Does implementing an AI agent have to be complicated?
&lt;/h2&gt;

&lt;p&gt;It does not. There is no need to build a large system covering every department and every process right away. &lt;strong&gt;It makes much more sense to start with one area&lt;/strong&gt; where you can already see a lot of manual work, repetition, or chaos today. For one company, that may be content. For another, documentation. For another, preparing offers or organizing the work of a technical team.&lt;/p&gt;

&lt;p&gt;This approach brings two benefits. First, you see results faster. Second, it is easier to build a solution that really fits the way the company works, instead of adding technology "just in case."&lt;/p&gt;

&lt;h2&gt;
  
  
  Why will agents and skills become increasingly important?
&lt;/h2&gt;

&lt;p&gt;In many companies, AI is no longer a novelty, and the first stage of fascination with this technology has already passed. More and more often, a more practical question appears: how do you use artificial intelligence in a way that actually saves time, reduces disorder, and maintains a sensible work standard?&lt;/p&gt;

&lt;p&gt;This is exactly the point at which agents and skills become more important. They help turn one-off AI use into a solution that can be embedded in a specific process, developed together with the team, and adapted to the company’s real needs. Thanks to that, artificial intelligence stops being just a helper for quick tasks and starts working like &lt;strong&gt;a tool that brings order to the way people work and genuinely improves company processes.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Want to see whether an agent with skills would make sense in your company? &lt;strong&gt;Get in touch with us.&lt;/strong&gt; During a consultation, we will help you assess which process is worth starting with and how to approach it so that the solution genuinely makes work easier.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>AI and ML in cybersecurity: how does technology help detect threats? The case of Bitdefender</title>
      <dc:creator>Mateusz Janota</dc:creator>
      <pubDate>Fri, 17 Jul 2026 07:05:25 +0000</pubDate>
      <link>https://dev.to/zanreal/ai-and-ml-in-cybersecurity-how-does-technology-help-detect-threats-the-case-of-bitdefender-1phk</link>
      <guid>https://dev.to/zanreal/ai-and-ml-in-cybersecurity-how-does-technology-help-detect-threats-the-case-of-bitdefender-1phk</guid>
      <description>&lt;p&gt;&lt;strong&gt;AI and machine learning are increasingly shaping how cyber threats are detected and analyzed today. Instead of relying solely on known signatures, modern protection systems can recognize patterns, anomalies, and behaviors that may indicate an attack. See how this works in practice based on the technologies used by Bitdefender.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdamwteihzq8czdvk5mo1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdamwteihzq8czdvk5mo1.jpg" alt="Keyboard with a blue-backlit AI key" width="800" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Bitdefender is a cybersecurity solutions provider used by individual users, businesses, and OEM partners. At that scale, protection cannot rely solely on manual analysis or simple file comparisons against a database of known threats. It requires mechanisms that can spot suspicious relationships faster and cope better with new, previously unknown attacks as well.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This is exactly where AI and machine learning play an important role.&lt;/strong&gt; In Bitdefender technologies, they help analyze large volumes of data, identify relationships that are hard for humans to notice, and detect signals of a potential attack earlier. This is not a single feature or one model, but a whole set of methods that collectively strengthen protection effectiveness.&lt;/p&gt;

&lt;p&gt;Although AI and ML often appear side by side, they do not mean exactly the same thing. &lt;strong&gt;Machine learning is part of the broader field of artificial intelligence&lt;/strong&gt; and is used to make decisions or predictions based on data. In cybersecurity, this primarily means better threat detection before threats can cause real damage.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Isn't One Model Enough in Cybersecurity?
&lt;/h2&gt;

&lt;p&gt;There is no single universal machine learning model in threat protection that works in every situation. Files are analyzed differently than process behavior, and anomalies at the level of a specific system require yet another approach. &lt;strong&gt;That is why Bitdefender uses different types of ML, matching them to specific tasks.&lt;/strong&gt; This approach includes, among other things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;deep learning models,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;large language models (LLMs),&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;supervised learning,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;unsupervised learning,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;self-supervised learning.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If ready-made approaches do not solve a specific problem, Bitdefender Labs creates its own models tailored to that particular challenge.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvlxmew4ncgugtrhb5b0e.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvlxmew4ncgugtrhb5b0e.jpg" alt="The word ‘CYBERSEC’ spelled out using Scrabble tiles" width="800" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How Does Bitdefender Use ML in Practice?
&lt;/h2&gt;

&lt;p&gt;One example of deep learning in Bitdefender GravityZone is &lt;strong&gt;feature extraction&lt;/strong&gt;. This means automatically pulling out important information from input data so the system can recognize characteristic patterns associated with malicious activity.&lt;/p&gt;

&lt;p&gt;In on-demand scanning, &lt;strong&gt;this type of analysis helps detect malware based on many signals at the same time&lt;/strong&gt;. These include, for example, API calls, patterns present in the code, file headers, or network behavior. As a result, detection does not rely solely on simple matching against known signatures, but above all on recognizing features typical of malicious software.&lt;/p&gt;

&lt;p&gt;This approach clearly shows the advantage of models that learn from data. &lt;strong&gt;Instead of looking only for what has already been described, the system can identify behaviors and relationships that look suspicious even when there is not yet a ready-made definition of the threat.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  HyperDetect and Process Behavior Analysis
&lt;/h2&gt;

&lt;p&gt;Another example is the &lt;strong&gt;patented HyperDetect technology&lt;/strong&gt;. In this case, Bitdefender combines supervised and unsupervised learning algorithms to analyze the behavior of running processes and catch activity that may indicate an attack.&lt;/p&gt;

&lt;p&gt;This matters because &lt;strong&gt;some threats do not look like classic malware that can be recognized by a known code pattern&lt;/strong&gt;. Instead, they reveal themselves only through the way they operate: unusual actions, suspicious relationships between processes, or sequences of behavior that deviate from the norm. HyperDetect was designed precisely to spot these kinds of signals.&lt;/p&gt;

&lt;p&gt;This technology also uses large language models, which support the identification of potential threats by adjusting the model's decision boundary margin. As a result, &lt;strong&gt;HyperDetect can be more sensitive to new, previously unknown variants of malware&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Protection Against Fileless Attacks
&lt;/h2&gt;

&lt;p&gt;One area where Bitdefender's proprietary models are particularly important is &lt;strong&gt;protection against fileless attacks&lt;/strong&gt;. This type of cyberattack does not rely on launching a traditional malware file. Instead, it uses legitimate system tools such as PowerShell or the command line to carry out an infection or perform malicious actions.&lt;/p&gt;

&lt;p&gt;That is exactly why such threats can be difficult for traditional antivirus solutions to detect. They do not always leave behind the typical trace of a suspicious file, and some of their activity may look like normal system operation.&lt;/p&gt;

&lt;p&gt;How can you defend against this? &lt;strong&gt;The Bitdefender Labs team developed custom ML models capable of extracting features from command lines and PowerShell scripts.&lt;/strong&gt; This makes it possible to detect patterns typical of attacks operating in memory and attacks built around tools that are legitimate in themselves. For this achievement, the company received the "Key Innovators" title awarded by the European Commission.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4d0z7dknampova7kp26f.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4d0z7dknampova7kp26f.jpg" alt="An open laptop displaying a malware warning" width="800" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Detecting Anomalies at the Level of a Specific System
&lt;/h2&gt;

&lt;p&gt;Another interesting part of Bitdefender's approach is custom solutions used to detect anomalies within a specific customer system. &lt;strong&gt;In this case, each such system receives its own individually trained ML model&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This type of solution monitors the behavior of a given system and compares it against various warning signals: MITRE® attack indicators, Bitdefender Labs' own indicators, and events specific to the given user. &lt;strong&gt;Over time, the model adapts to what is normal in that environment and what may indicate risk.&lt;/strong&gt; The detected deviations are then reported to security teams.&lt;/p&gt;

&lt;p&gt;This approach has strong practical value. Every organization operates a little differently, uses a different set of tools, and has its own activity patterns. That is why effective anomaly detection often requires not only knowledge of global attack techniques, but also an understanding of the local context of a specific system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scalability Is Also Part of Effectiveness
&lt;/h2&gt;

&lt;p&gt;Bitdefender technologies operate across consumer, business, and OEM segments. On the one hand, this gives them very broad threat visibility. On the other, it places high demands on machine learning models.&lt;/p&gt;

&lt;p&gt;It is not enough to build a model that works well in a lab or on one type of infrastructure. &lt;strong&gt;You also need to ensure that it maintains performance across very different hardware, from servers in data centers to home routers.&lt;/strong&gt; That is why scalability here is not an extra, but a requirement for using AI and ML effectively across different environments.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Do the Results Say?
&lt;/h2&gt;

&lt;p&gt;The effectiveness of such solutions is best assessed by their results. Bitdefender points out that, thanks to the use of ML models and proprietary AI solutions, &lt;strong&gt;as early as 2014 it was able to identify the behavioral characteristics of WannaCry ransomware&lt;/strong&gt;, one of the most high-profile encryption attacks of recent years. &lt;strong&gt;That was as much as three years before the threat appeared in the wild!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The company also regularly achieves very strong results in independent tests.&lt;/strong&gt; In AV-Comparatives Advanced Threat Protection tests, Bitdefender consistently blocks threats before they are executed, with higher effectiveness than many competitors.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk0zr5ne1el1w75rjbrce.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk0zr5ne1el1w75rjbrce.jpg" alt="An open padlock lying on a keyboard with keys scattered about" width="800" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  This Is a Good Time to Act: Use AI-Supported Protection in Your Company
&lt;/h2&gt;

&lt;p&gt;The Bitdefender example clearly shows the direction effective protection is taking today. It is no longer just about detecting known threats, but about identifying signals that may indicate a problem more quickly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use this approach in your company&lt;/strong&gt; - instead of reacting in panic only once an attack has already happened, it is better to act in advance and calmly choose protection suited to your environment. We can help you with that. &lt;strong&gt;Tell us what you need, and we will suggest which Bitdefender solutions will work best for you and handle the implementation.&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>When a company suddenly loses access to its data. What does a ransomware attack look like, and how can you protect yourself aga…</title>
      <dc:creator>Mateusz Janota</dc:creator>
      <pubDate>Fri, 17 Jul 2026 07:02:38 +0000</pubDate>
      <link>https://dev.to/zanreal/when-a-company-suddenly-loses-access-to-its-data-what-does-a-ransomware-attack-look-like-and-how-2nk0</link>
      <guid>https://dev.to/zanreal/when-a-company-suddenly-loses-access-to-its-data-what-does-a-ransomware-attack-look-like-and-how-2nk0</guid>
      <description>&lt;p&gt;&lt;strong&gt;Monday morning. A typical start to the week at a company. Someone is checking email, someone else is logging into the sales system, and in accounting they are just opening the document database from the previous month. Everything is working as usual.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvjropy8lc4zmel3xeg1r.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvjropy8lc4zmel3xeg1r.jpg" width="800" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And then suddenly something stops adding up. Files will not open, folders look strange, and systems start to slow down. A few minutes later, a message appears that no one wants to see: &lt;strong&gt;&lt;em&gt;Your data has been encrypted. To recover it, pay a ransom in cryptocurrency.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And it is at that exact moment that many companies realize one thing - &lt;strong&gt;they are not prepared for a situation like this&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A ransomware attack can bring a company's operations to a halt in a matter of minutes. &lt;strong&gt;That is why it is important not only to know how to prepare for it, but above all to implement that preparation effectively.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What exactly is ransomware?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Ransomware is a type of malicious software designed for one very specific purpose: &lt;strong&gt;to block access to data and extort a ransom for its recovery&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Once it gets into a system, the program begins encrypting files - documents, databases, projects, archives, or photos. In theory, the data is still there, but &lt;strong&gt;it cannot be opened&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Users then receive a message from the attackers saying that access to the data will be restored after a specified amount is paid, usually in cryptocurrency.&lt;/p&gt;

&lt;p&gt;The problem is that payment offers no guarantee that the files will be recovered, and the data may already have been copied by criminals.&lt;/p&gt;

&lt;p&gt;Moreover, even if the company regains access to its data after paying the ransom, that does not necessarily mean the problems are over. If the vulnerability in the system or the "backdoor" left by the attackers is not thoroughly removed after the attack, the same organization is often attacked again. &lt;strong&gt;Cybercriminals know very well that if someone has paid once, there is a good chance they will do so again.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;That is why ransomware is now one of the most damaging cyber threats to businesses.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;How do cybercriminals get into company systems?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Contrary to popular belief, most attacks do not begin with a spectacular break-in. More often, it looks much more... ordinary.&lt;/p&gt;

&lt;p&gt;One of the most common scenarios is an &lt;strong&gt;email message&lt;/strong&gt; that looks completely harmless. It may be an invoice, an order confirmation, or a document from a supposed contractor. Clicking the attachment is enough to launch malicious software.&lt;/p&gt;

&lt;p&gt;Another popular attack vector is &lt;strong&gt;vulnerabilities in outdated software&lt;/strong&gt;. Cybercriminals actively look for systems that have not been updated and exploit known vulnerabilities.&lt;/p&gt;

&lt;p&gt;Also frequent targets are &lt;strong&gt;remote access services for computers and servers&lt;/strong&gt;, such as RDP (Remote Desktop Protocol). If they are exposed to the internet and protected only by a password (or not at all...), they can become an easy entry point for attackers. In the security industry, people even joke that RDP sometimes stands for "Ransomware Deployment Protocol" today, because &lt;strong&gt;systems compromised this way are sometimes used directly to launch ransomware across a company's network&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Sometimes the problem is also:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;weak passwords for company systems,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;no additional authentication at login,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;overly broad user permissions,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;no infrastructure monitoring.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In practice, this means that &lt;strong&gt;an attack is not always the result of a single mistake&lt;/strong&gt;. It is usually a combination of several small oversights that together create the perfect opportunity for criminals.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Why is ransomware so severe for companies?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The biggest problem is not the attack itself, but its consequences.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When data is encrypted, a company may lose access to customer databases, project documentation, sales systems, accounting tools, archives, or working copies.&lt;/p&gt;

&lt;p&gt;In many cases, this means a &lt;strong&gt;complete halt to work&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In addition, other problems arise:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;operational downtime,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;loss of customer trust,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;risk of data leakage,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;system recovery costs.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is why cybersecurity is increasingly seen as an extremely important part of &lt;strong&gt;business continuity&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg3dhh4ggxp8y70g11oof.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg3dhh4ggxp8y70g11oof.jpg" width="800" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What really determines whether a company can cope with an attack?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;There is no single tool that guarantees one hundred percent security. Effective protection is based rather on a combination of several elements.&lt;/p&gt;

&lt;p&gt;One of the most important, and unfortunately often overlooked, steps is &lt;strong&gt;creating regular backups&lt;/strong&gt;. Backups make it possible to restore data even when a system has been infected. It is important, however, to ensure that they are stored outside the main network. The need to test them regularly should not be underestimated either.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Software updates&lt;/strong&gt; are just as important. Many attacks exploit vulnerabilities that system vendors fixed long ago. If you do not update the programs used in your company, you are consciously giving up security and exposing yourself to losses.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Employee awareness&lt;/strong&gt; also matters greatly. Even the best technical safeguards can be bypassed if someone unknowingly runs a malicious file. That is why it is worth conducting &lt;strong&gt;cybersecurity training&lt;/strong&gt; on a regular basis.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In addition, it is worth taking care of:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Strong passwords and multi-factor authentication&lt;/strong&gt; - a password alone is often not enough. Multi-factor authentication adds a second login step - for example, a code from an app or confirmation on a phone. Thanks to this, even if someone learns the password, they still will not be able to log in to the system.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Limiting user permissions&lt;/strong&gt; - not every employee needs access to all data and systems. Granting permissions only where they are truly needed reduces the risk that a potential attack will spread across the company's entire infrastructure.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Network segmentation&lt;/strong&gt; - in a well-designed infrastructure, the network is divided into smaller parts. As a result, even if one device becomes infected, the threat will not automatically spread to every system in the company.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Monitoring the IT infrastructure&lt;/strong&gt; - modern security systems can detect unusual behavior on the network, such as the sudden encryption of a large number of files or suspicious traffic between servers. Detecting such signals early makes it possible to respond before the problem gets out of control.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each of these elements reduces the risk that a single incident will paralyze the entire company.&lt;/p&gt;

&lt;p&gt;We must remember, however, that &lt;strong&gt;in the world of cybersecurity, there is no one hundred percent guarantee of protection&lt;/strong&gt;. Even well-secured organizations can become the target of an attack. That is why, in addition to prevention, it is equally important to prepare for a crisis situation - which means creating an action plan that allows you to respond quickly, limit the scale of the problem, and restore the company's normal operations as soon as possible.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;How do modern protection systems help?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Traditional antivirus tools worked mainly by detecting known threats. The problem is that modern attacks often look completely different from how they used to. Criminals have more and more options and use them in increasingly creative ways.&lt;/p&gt;

&lt;p&gt;That is why modern security systems analyze the &lt;strong&gt;behavior of programs and processes in real time&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;One example of such a solution is the &lt;strong&gt;Bitdefender GravityZone&lt;/strong&gt; platform, which uses, among other things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;behavioral analysis,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;machine learning,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;system activity monitoring.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes it possible to detect and stop suspicious actions, such as the sudden encryption of a large number of files, before they cause serious damage. This means protection is not based solely on responding after the fact, but on &lt;strong&gt;detecting threats at a very early stage&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In addition, Bitdefender GravityZone enables &lt;strong&gt;the restoration of modified files&lt;/strong&gt;, &lt;strong&gt;centralized management of security policies across the company&lt;/strong&gt;, and much more - all in an accessible, easy-to-use panel.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flur7edlfpjwxc4hi9fy3.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flur7edlfpjwxc4hi9fy3.jpg" width="800" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Why are more and more companies working with security partners?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Cybersecurity is an area that changes extremely rapidly. New attack methods appear practically every day, and &lt;strong&gt;maintaining an adequate level of protection requires specialized knowledge&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That is why many companies choose to work with &lt;strong&gt;technology partners&lt;/strong&gt; who help them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;select the right security solutions,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;implement protection systems,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;monitor IT infrastructure,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;respond to security incidents.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;At ZanReal, we help companies build secure digital environments&lt;/strong&gt; - from infrastructure audits and security configuration to the implementation of professional protection tools.&lt;/p&gt;

&lt;p&gt;As an official &lt;strong&gt;Bitdefender&lt;/strong&gt; partner, we implement solutions such as &lt;strong&gt;Bitdefender GravityZone&lt;/strong&gt;, which make it possible to effectively protect computers, servers, and company networks against modern threats.&lt;/p&gt;

&lt;p&gt;We have one goal: to ensure that cybersecurity is not a source of stress for a company, but a &lt;strong&gt;stable foundation for its operations&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And if you want to carry out a security audit or implement Bitdefender solutions in your company, &lt;strong&gt;get in touch with us&lt;/strong&gt;. We will help you choose and implement protection tailored to your needs.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>AI Without a Revolution: 8 Small Implementations That Take the Pressure Off Your Team</title>
      <dc:creator>Mateusz Janota</dc:creator>
      <pubDate>Fri, 17 Jul 2026 06:59:09 +0000</pubDate>
      <link>https://dev.to/zanreal/ai-without-a-revolution-8-small-implementations-that-take-the-pressure-off-your-team-knk</link>
      <guid>https://dev.to/zanreal/ai-without-a-revolution-8-small-implementations-that-take-the-pressure-off-your-team-knk</guid>
      <description>&lt;p&gt;&lt;strong&gt;Not every company needs to start its AI journey with a big project, complex automation, and a technical revolution. Very often, calmly organizing a single process brings more value than an ambitious plan that later proves hard to get moving. Here are 8 examples of simple implementations that help save time without making work more complicated.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5wpz5daxfz47k5gipv1o.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5wpz5daxfz47k5gipv1o.jpg" alt="Computer keyboard with AI letters revealed through torn paper concept" width="800" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Today, many companies hear about AI mainly in the context of agents, automation, and large-scale transformations. The problem is that this often sounds more like a complex technology project than real support for everyday work. If you do not deal with it on a daily basis, it is easy to feel discouraged: you do not know where to start, what to tackle, or what actually makes sense.&lt;/p&gt;

&lt;p&gt;On top of that, large implementations are often associated with something expensive, time-consuming, and highly technical. And that is enough to block action right at the start, even when there really are areas in the company where AI could help quickly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;That is why, in day-to-day practice, a better first step may be a small AI implementation that organizes a specific part of the work and immediately takes some repetitive tasks off the team's plate.&lt;/strong&gt; It is a good approach when you want to calmly test where artificial intelligence actually makes sense, without turning the whole organization upside down.&lt;/p&gt;

&lt;h2&gt;
  
  
  Small AI Implementations Are Often the Best Place to Start
&lt;/h2&gt;

&lt;p&gt;With AI, it is easy to fall into the trap of thinking you need to change the whole company right away. &lt;strong&gt;Meanwhile, in many organizations, a step-by-step approach is simply more sensible.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A small AI implementation usually has a few things in common:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;it addresses one specific problem,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;it is based on a repeatable process,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;it can be tested quickly,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;it does not require rebuilding the whole company,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;it allows people to stay in control and verify the results.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;At the start, AI works especially well wherever a team repeats similar activities&lt;/strong&gt;: writing, analyzing, organizing information, answering similar questions, or preparing working drafts of content.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now let us look at some specific examples of small implementations.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7hsccp55b9rols47mm6w.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7hsccp55b9rols47mm6w.jpg" alt="Modern coworking office with team working by window overlooking city skyline" width="800" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Does AI Deliver Quick Results Without a Major Revolution?
&lt;/h2&gt;

&lt;p&gt;Not every company needs advanced scenarios right away. Sometimes it is enough to choose one area where employees lose the most time on predictable, repetitive tasks.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. An Assistant for Creating Product Descriptions
&lt;/h3&gt;

&lt;p&gt;If you sell many similar products, writing descriptions by hand quickly turns into tedious, repetitive work. &lt;strong&gt;AI can prepare a first draft based on an agreed format, tone, and the most important product information.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You do not need to introduce full automation right away. Very often, simply shortening the work from "writing from scratch" to "reviewing and refining" already brings the team significant relief.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. A Generator for Replies to Repetitive Emails
&lt;/h3&gt;

&lt;p&gt;In many companies, the inbox looks very similar: the same questions about the offer, timelines, availability, quotes, implementation, or rules of cooperation. &lt;strong&gt;AI can help prepare working replies faster&lt;/strong&gt;, while keeping a consistent tone and the basic information intact.&lt;/p&gt;

&lt;p&gt;This is especially useful in sales, customer service, recruitment, administration, and support teams. A person still approves the message, but no longer wastes time writing the same thing from scratch for the hundredth time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Over time, it is of course worth considering introducing automation&lt;/strong&gt; - but at the beginning, even support with drafting email responses can noticeably ease the load on employees.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. An Analytical Assistant for Data and Reports
&lt;/h3&gt;

&lt;p&gt;Not everyone needs an advanced BI system with an AI layer right away. Sometimes a solution that helps review data faster, find trends, identify deviations, and prepare a clear summary is enough.&lt;/p&gt;

&lt;p&gt;Artificial intelligence can help with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;sales analysis,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;interpreting campaign results,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;comparing time periods,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;spotting anomalies,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;preparing short conclusions for management or the team.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;AI does not replace business thinking here. It helps you get to the point where you know what is worth paying attention to faster.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4. An Internal Knowledge Base for the Team
&lt;/h3&gt;

&lt;p&gt;In many companies, knowledge is scattered: some is in documents, some on Slack, some in emails, and some only in the heads of the longest-serving employees. Then the same questions keep coming back: how did we do this, where is that file, what was agreed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In situations like these, AI-based tools work well as an internal knowledge base.&lt;/strong&gt; They help the team reach information faster, instead of searching for it from scratch every time or asking the same people again and again. Solutions like this also speed up the onboarding of new employees.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9ngqz08h56m16yipy6q6.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9ngqz08h56m16yipy6q6.jpg" alt="Woman working remotely on laptop at wooden table during breakfast" width="800" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Support for Creating Social Media Content
&lt;/h3&gt;

&lt;p&gt;AI can help when you have the knowledge and the topics, but you lack the time, rhythm, or creative spark to prepare posts. &lt;strong&gt;The point is not to mindlessly publish AI-generated posts&lt;/strong&gt;, but to build drafts, variations, and a communication plan faster.&lt;/p&gt;

&lt;p&gt;What is more, &lt;strong&gt;AI can be a real goldmine of content ideas&lt;/strong&gt;. With artificial intelligence, you can also generate hooks and opening lines for posts, turn longer materials into shorter publications, adapt the tone to specific channels, and much more. A simple assistant packed with knowledge about you and your brand is enough to make social media communication much easier.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Summaries of Meetings and Notes
&lt;/h3&gt;

&lt;p&gt;This is one of the most underestimated small AI implementations. After a meeting, there are often a lot of loose notes left and not many concrete takeaways. &lt;strong&gt;AI can help turn a conversation record or rough notes into a clear summary&lt;/strong&gt;: decisions, tasks, responsibilities, and next steps.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Working Drafts of Offers and Documents
&lt;/h3&gt;

&lt;p&gt;In companies, a lot of time is often consumed not so much by delivering the service itself as by preparing materials about it. &lt;strong&gt;AI can help, among other things, with creating first versions of:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;offers,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;summaries of the scope of work,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;internal briefs,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;checklists,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;project kickoff documents.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  8. Categorizing and Organizing Information
&lt;/h3&gt;

&lt;p&gt;Many companies process a lot of content every day: tickets, forms, inquiries, leads, notes, customer feedback. &lt;strong&gt;AI can support the initial organizing, tagging, and grouping of this information.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Thanks to that, it becomes possible, among other things, to route cases to the right people faster, identify customers' most common problems, organize feedback, and &lt;strong&gt;reduce manual administrative work&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuoegpag9kzvjseb4pflr.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuoegpag9kzvjseb4pflr.jpg" alt="Laptop screen displaying artificial intelligence interface with prompt input" width="800" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How Do You Choose the First Area for an AI Implementation?
&lt;/h2&gt;

&lt;p&gt;So how do you find a good area for an AI implementation without losing your mind? Most of the time, mistakes do not come from the company knowing too little about artificial intelligence. The problem is usually the wrong starting point. &lt;strong&gt;Instead of starting with the question, "what can we do with AI?", it is better to ask:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;where employees lose time on &lt;strong&gt;repetitive tasks&lt;/strong&gt;,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;which tasks are &lt;strong&gt;predictable&lt;/strong&gt; and easy to describe,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;where even a small reduction in working time would bring relief,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;which processes are simple and can be automated without major changes to how the company operates.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A good first use case is usually:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;simple,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;repeatable,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;frequent,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;measurable,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;low-risk,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;easy to evaluate after a few weeks.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What Is Not Worth Doing at the Start?
&lt;/h2&gt;

&lt;p&gt;The tool itself does not solve the problem. &lt;strong&gt;If the process is chaotic and the data is scattered, AI will only make that mess bigger.&lt;/strong&gt; That is why it is better to avoid a few traps at the beginning.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Do Not Start with the Most Complex Process
&lt;/h3&gt;

&lt;p&gt;If your first AI project concerns an area full of exceptions, dependencies, and risks, it is easy to conclude that it makes no sense. The problem is often simply that the entry point was too difficult. Artificial intelligence-based solutions can work, but &lt;strong&gt;at the beginning, it is better to start with a simple project and develop it gradually&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Do Not Hand Over Full Control Without Verification
&lt;/h3&gt;

&lt;p&gt;In small AI implementations, the following model works very well: &lt;strong&gt;artificial intelligence prepares, a human checks&lt;/strong&gt;. It is safer and usually more practical than trying full automation from day one.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Do Not Implement AI Just Because "Everyone Else Is Doing It"
&lt;/h3&gt;

&lt;p&gt;The best results come from an approach based on a specific goal: less manual work, faster execution, better access to knowledge, shorter time needed to prepare materials. &lt;strong&gt;It is not worth rushing into AI implementation just because it is fashionable right now and everyone is chasing it.&lt;/strong&gt; It is better to first look for repetitive, time-consuming processes in the company and only then match specific solutions to them.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Do Not Assume AI Will Work Well Without Sensible Data
&lt;/h3&gt;

&lt;p&gt;For AI to really help, it needs something to work with. &lt;strong&gt;The problem is not only poor, chaotic, or inconsistent data, but also the lack of data.&lt;/strong&gt; If a company has no documented processes, source materials, or organized information to rely on, it is hard to expect satisfactory and useful results.&lt;/p&gt;

&lt;p&gt;In short: &lt;strong&gt;AI will not guess what nobody in the company has previously collected, described, or organized&lt;/strong&gt;. That is why, before the implementation itself, you first need to take care of the basics. Only then will the tool genuinely speed up work and help people make better decisions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F21kmweyderb6dbsm3tra.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F21kmweyderb6dbsm3tra.jpg" alt="Human hand touching robotic hand symbolizing artificial intelligence interaction" width="800" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  When Is It Worth Talking About an AI Implementation in Your Company?
&lt;/h2&gt;

&lt;p&gt;If you can see repetitive tasks on your side that take time away from the team, but you do not want to start with a complicated project, this is usually exactly where a good first step begins.&lt;/p&gt;

&lt;p&gt;And you do not have to handle everything on your own. &lt;strong&gt;Let us know what you need - we will suggest where to start, take the implementation off your hands, and make sure everything works as it should.&lt;/strong&gt; At ZanReal, we help match AI solutions to the way a company really operates - without adding tools for the sake of it and without pushing a revolution when it is enough to improve one process wisely.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you want to check which small AI implementation is worth starting with in your company, let us talk.&lt;/strong&gt; We will help you choose a solution that takes work off your employees' plates and helps you save time.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Simplify your Next.js Middleware</title>
      <dc:creator>Mateusz Janota</dc:creator>
      <pubDate>Sat, 13 Jan 2024 14:14:19 +0000</pubDate>
      <link>https://dev.to/z4nr34l/simplify-your-nextjs-middleware-3hmn</link>
      <guid>https://dev.to/z4nr34l/simplify-your-nextjs-middleware-3hmn</guid>
      <description>&lt;h2&gt;
  
  
  Motivation
&lt;/h2&gt;

&lt;p&gt;I’m working with Next.js project for a few years now, after Vercel moved multiple /**/_middleware.ts files to a single /middleware.ts file, there was a unfilled gap - but just for now. After a 2023 retro I had found that there is no good solution for that problem, so I took matters into my own hands. I wanted to share that motivation with everyone here, as I think that we all need to remember how it all started.&lt;/p&gt;

&lt;p&gt;Hope it will save you some time and would make your project DX better!&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;By default Next.js supports only one middleware.ts file, in which you need match routes with logic by your own which can be pretty problematic and chaotic. Also it’s endlessly making middleware boilerplate bigger.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// example code source: https://github.com/vercel/next.js/blob/canary/examples/middleware/middleware.ts&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;NextRequest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;NextResponse&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;next/server&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;middleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;NextRequest&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;nextUrl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pathname&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/about&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;NextResponse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;redirect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;URL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/redirected&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;nextUrl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pathname&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/another&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;NextResponse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;rewrite&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;URL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/rewrite&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;NextResponse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;matcher&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/about/:path*&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/another/:path*&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This exmaple is not that scary, but imagine adding more complex logic for few more routes… (ugh)&lt;/p&gt;

&lt;h2&gt;
  
  
  The solution
&lt;/h2&gt;

&lt;p&gt;Let me introduce to you my latest package called next-easy-middleware.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installation:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pnpm add next-easy-middleware
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;next-easy-middleware
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yarn add next-easy-middleware
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bun add next-easy-middleware
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Usage:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createMiddleware&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;next-easy-middlewares&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;NextRequest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;NextResponse&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;next/server&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;analyticsMiddleware&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@shared/analytics/middleware&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;authMiddleware&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;loginMiddleware&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@/app/(auth)/_middleware&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;docsMiddleware&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@/app/(docs)/_middleware&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;blogMiddleware&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;blogViewsMiddleware&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@/app/(blog)/_middleware&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;postsMiddleware&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@/app/(posts)/_middleware&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;middlewares&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/login&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;loginMiddleware&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/docs/:path*: docsMiddleware,
  &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;blog&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;: blogMiddleware,
  &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;blog&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;view&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;: blogViewsMiddleware,
  &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="na"&gt;regex&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="sr"&gt;/posts/&lt;/span&gt;&lt;span class="err"&gt;\\&lt;/span&gt;&lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;: postsMiddleware,
};

const globalMiddlewares = {
  before: authMiddleware,
  after: analyticsMiddleware
}

export const middleware = createMiddleware(middlewares, globalMiddlewares);

export const config = {
  matcher: [&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;((?&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;api&lt;/span&gt;&lt;span class="o"&gt;/|&lt;/span&gt;&lt;span class="nx"&gt;_next&lt;/span&gt;&lt;span class="o"&gt;/|&lt;/span&gt;&lt;span class="nx"&gt;_static&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nx"&gt;_vercel&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="err"&gt;\\&lt;/span&gt;&lt;span class="nx"&gt;w&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="err"&gt;\\&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="err"&gt;\\&lt;/span&gt;&lt;span class="nx"&gt;w&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;],
};
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Feedback
&lt;/h2&gt;

&lt;p&gt;I’m awaiting your feedback about that solution, also feelfree to contribute to that package in below repository.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/z4nr34l/next-easy-middlewares" rel="noopener noreferrer"&gt;https://github.com/z4nr34l/next-easy-middlewares&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>nextjs</category>
    </item>
    <item>
      <title>Optimizing Next.js with OpenTelemetry</title>
      <dc:creator>Mateusz Janota</dc:creator>
      <pubDate>Sat, 13 Jan 2024 13:37:28 +0000</pubDate>
      <link>https://dev.to/z4nr34l/optimizing-nextjs-with-opentelemetry-2c8c</link>
      <guid>https://dev.to/z4nr34l/optimizing-nextjs-with-opentelemetry-2c8c</guid>
      <description>&lt;p&gt;Unlock the full potential of your Next.js application with my comprehensive guide on performance optimization using OpenTelemetry and Docker.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting the Stage
&lt;/h2&gt;

&lt;p&gt;Performance is the lifeblood of any successful web application. Users expect seamless experiences, and slow-loading pages can lead to frustration and abandonment.&lt;/p&gt;

&lt;p&gt;Let's lay the groundwork by understanding the critical role of instrumentation in achieving optimal performance for your Next.js application.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why does Instrumentation Matter?
&lt;/h3&gt;

&lt;p&gt;Instrumentation involves adding code to your application to collect data on various aspects of its behavior. This data is invaluable for identifying bottlenecks, understanding resource consumption, and making informed decisions for optimization. In the context of web development, effective instrumentation provides insights into how your application interacts with its environment, enabling you to pinpoint areas for improvement.&lt;/p&gt;

&lt;h3&gt;
  
  
  Introduction to OpenTelemetry
&lt;/h3&gt;

&lt;p&gt;Enter OpenTelemetry, a powerful and flexible observability framework. OpenTelemetry allows you to collect traces, metrics, and logs from your application, providing a comprehensive view of its performance. Traces represent the journey of a request through your application, while metrics offer quantitative measurements of various aspects, and logs provide detailed information for debugging.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Concepts: Tracks and Spans
&lt;/h3&gt;

&lt;p&gt;As we dive into instrumentation, it's crucial to understand two fundamental concepts: tracks and spans. Tracks represent the broader paths that a request takes through your application, while spans break down these tracks into smaller, more manageable units. Think of tracks as chapters in a book and spans as individual sentences within each chapter. Together, they form a narrative that helps you comprehend your application's performance story.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Your Docker Toolbox Ready
&lt;/h2&gt;

&lt;p&gt;Now, we need to prepare our local envoironment. We will use Jaeger with Prometheus and Zipkin to visualize our traces and metrics.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing Docker
&lt;/h3&gt;

&lt;p&gt;You can learn more about docker in my &lt;a href="https://www.zanreal.net/blog/beginners-guide-to-docker" rel="noopener noreferrer"&gt;Docker Guide&lt;/a&gt; and &lt;a href="https://www.zanreal.net/blog/beginners-guide-to-docker-compose" rel="noopener noreferrer"&gt;Docker Compose Guide&lt;/a&gt; to go further without any problems.&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting local environment
&lt;/h3&gt;

&lt;p&gt;Now we need to clone a ready-to-use repository made by Vercel.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/vercel/opentelemetry-collector-dev-setup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;so, just go into that repository&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;opentelemetry-collector-dev-setup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and run the following command to start the docker containers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker-compose up &lt;span class="nt"&gt;-d&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it! Now we can access Jaeger UI using &lt;a href="http://0.0.0.0:16686" rel="noopener noreferrer"&gt;0.0.0.0:16686&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Next.js Instrumentation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Creating a new project
&lt;/h3&gt;

&lt;p&gt;If you want to instrument your project at the beggining starting from stratch, you can use the following command to create a new Next.js project using the OpenTelemetry example:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/vercel/next.js/tree/canary/examples/with-opentelemetry" rel="noopener noreferrer"&gt;Repository URL&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;or just create a new project using the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pnpm create next-app &lt;span class="nt"&gt;--example&lt;/span&gt; with-opentelemetry your-app-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx create-next-app &lt;span class="nt"&gt;--example&lt;/span&gt; with-opentelemetry your-app-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yarn create next-app &lt;span class="nt"&gt;--example&lt;/span&gt; with-opentelemetry your-app-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bun create next-app &lt;span class="nt"&gt;--example&lt;/span&gt; with-opentelemetry your-app-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Instrumenting existing projects
&lt;/h3&gt;

&lt;p&gt;First of all, we need to tell Next.js that we will be using an &lt;strong&gt;EXPERIMENTAL&lt;/strong&gt; feature. To do that, we need to add the following lines to our &lt;code&gt;next.config.js&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;next.config.js&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;nextConfig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// ...&lt;/span&gt;
  &lt;span class="na"&gt;experimental&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;instrumentationHook&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, we need to install the following packages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pnpm add @opentelemetry/api @vercel/otel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @opentelemetry/api @vercel/otel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yarn &lt;span class="nb"&gt;install&lt;/span&gt; @opentelemetry/api @vercel/otel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bun add @opentelemetry/api @vercel/otel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And at the final stage of basic instrumentation we need to create an &lt;code&gt;instrumentation.ts&lt;/code&gt; file in same level as our &lt;code&gt;pages&lt;/code&gt; of &lt;code&gt;app&lt;/code&gt; folder.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;instrumentation.ts&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;registerOTel&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@vercel/otel&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;register&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;registerOTel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;your-service-name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remember that if you have as &lt;code&gt;src&lt;/code&gt; folder, you need to create this file in it.&lt;/p&gt;

&lt;p&gt;Aaaaaaand, we're done with that part!&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing instrumentation
&lt;/h2&gt;

&lt;p&gt;We currently want to get as many spans as possible, so we will use the following command to run our project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;NEXT_OTEL_VERBOSE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1 next dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to have an easier access to it, just add new script to your &lt;code&gt;package.json&lt;/code&gt; as I've done:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"dev:otel"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"NEXT_OTEL_VERBOSE=1 next dev"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To make an test of our instrumentation, we just need... to open our browser and go to &lt;a href="http://localhost:3000" rel="noopener noreferrer"&gt;localhost:3000&lt;/a&gt; and we shall see new traces incoming in our Jaeger UI.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding custom spans
&lt;/h2&gt;

&lt;h3&gt;
  
  
  OTel Wrapper for Next.js
&lt;/h3&gt;

&lt;p&gt;I've made a small wrapper for Next.js to make it easier to use OpenTelemetry in your Next.js project. I'm placing it in a &lt;code&gt;lib&lt;/code&gt; folder on my project's root.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;@/lib/otel.ts&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;use server&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;Span&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;trace&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@opentelemetry/api&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;otel&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;fnName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(...&lt;/span&gt;&lt;span class="nx"&gt;args&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;[])&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;
&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;tracer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;trace&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getTracer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fnName&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;tracer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startActiveSpan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fnName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="na"&gt;span&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Span&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;(...&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;finally&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But how to use it? It's simple! Just import it and use it as a wrapper for your functions, server actions, db calls or just anything.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;actions.ts&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;use server&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Redis&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@upstash/redis&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;otel&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@/lib/otel&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fromEnv&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;increment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;prefix&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;otel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;your-component&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;incr&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pageviews&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;prefix&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or pass function with it's props to it ;)&lt;/p&gt;

&lt;p&gt;&lt;code&gt;actions.ts&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;use server&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Redis&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@upstash/redis&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;otel&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@/lib/otel&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fromEnv&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;increment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;prefix&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;incr&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pageviews&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;prefix&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;incrementWithOtel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;prefix&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;otel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;your-component&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;increment&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;prefix&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Just like that! Now you can use it in your project and see how it works.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding custom spans via &lt;code&gt;@opentelemetry/api&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;If you don't want to use my wrapper, you can use the following code to add custom spans to your project.&lt;/p&gt;

&lt;h4&gt;
  
  
  Active Span
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;actions.ts&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;use server&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Redis&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@upstash/redis&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;trace&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@opentelemetry/api&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fromEnv&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;increment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;prefix&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;trace&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getTracer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;your-component&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startActiveSpan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;your-operation&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;span&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;incr&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pageviews&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;prefix&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;finally&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Manual Span
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;actions.ts&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;use server&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Redis&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@upstash/redis&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;trace&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@opentelemetry/api&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fromEnv&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;increment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;prefix&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;span&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;trace&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getTracer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;your-component&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;startSpan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;your-operation&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;incr&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pageviews&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;prefix&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="nx"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;As you wrap up the initial steps in this practical guide, your Dockerized environment is ready to capture and export crucial data through OpenTelemetry. The foundation is set for a deep dive into optimizing Next.js performance, armed with the insights needed to make informed decisions on where and how to enhance your application's speed and efficiency.&lt;/p&gt;

&lt;p&gt;Get ready to transform your Next.js application into a high-performance masterpiece. The journey continues as you explore advanced instrumentation techniques and delve into the art of performance optimization with OpenTelemetry.&lt;/p&gt;

&lt;p&gt;Now you know how to instrument your Next.js project using OpenTelemetry and Docker. I hope you enjoyed this article and learned something new. If you have any questions, feel free to reach out to me via &lt;a href="https://www.zanreal.net/contact" rel="noopener noreferrer"&gt;contact&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>nextjs</category>
    </item>
  </channel>
</rss>
