<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
  <channel>
    <title><![CDATA[Lalit Satapathy - Elastic Observability Labs]]></title>
    <description><![CDATA[Trusted security news & research from the team at Elastic.]]></description>
    <copyright><![CDATA[© 2026. Elasticsearch B.V. All Rights Reserved]]></copyright>
    <image>
      <title><![CDATA[Lalit Satapathy - Elastic Observability Labs]]></title>
      <url>https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltad972c1c27dbefc6/6a88d9782904ea5e8511d473/observability-labs-thumbnail.png</url>
      <link>https://www.elastic.co/observability-labs/author/lalit-satapathy</link>
    </image>
    <link>https://www.elastic.co/observability-labs/author/lalit-satapathy</link>
    <atom:link href="https://www.elastic.co/observability-labs/rss/author/lalit-satapathy.xml" rel="self" type="application/rss+xml"/>
    <language><![CDATA[en]]></language>
    <lastBuildDate>Sun, 13 Sep 2026 09:18:12 GMT</lastBuildDate>
  <item>
    <title><![CDATA[Supercharge Your vSphere Monitoring with Enhanced vSphere Integration]]></title>
    <description><![CDATA[Supercharge Your vSphere Monitoring with Enhanced vSphere Integration]]></description>
    <content:encoded><![CDATA[<p><a href="https://www.vmware.com/products/cloud-infrastructure/vsphere">vSphere</a> is VMware's cloud computing virtualization platform that provides a powerful suite for managing virtualized resources. It allows organizations to create, manage, and optimize virtual environments, providing advanced capabilities such as high availability, load balancing, and simplified resource allocation. vSphere enables efficient utilization of hardware resources, reducing costs while increasing the flexibility and scalability of IT infrastructure.</p>
<p>With the release of an upgraded <a href="https://www.elastic.co/docs/current/integrations/vsphere">vSphere integration</a> we now support an enhanced set of metrics and datastreams. Package version 1.15.0 onwards introduces new datastreams that significantly improve the collection of performance metrics, providing deeper insights into your vSphere environment.</p>
<p>This enhanced version includes a total of seven datastreams, featuring critical new metrics such as disk performance, memory utilization, and network status. Additionally, these datastreams now offer detailed visibility into associated resources like hosts, clusters, and resource pools. To make the most of these insights, we’ve also introduced prebuilt dashboards, helping teams monitor and troubleshoot their vSphere environments with ease and precision.</p>
<p>We have expanded the performance metrics to encompass a broader range of insights across all datastreams, while also introducing new datastreams for clusters, resource pools, and networks. This enhanced integration version now includes a total of seven datastreams, featuring critical new metrics such as disk performance, memory utilization, and network status. Additionally, these datastreams now offer detailed visibility into associated resources like hosts, clusters, and resource pools. </p>
<p>Each datastream also includes detailed alarm information, such as the alarm name, description, status (e.g. critical or warning), and the affected entity's name. To make the most of these insights, we’ve also introduced prebuilt dashboards, helping teams monitor and troubleshoot their vSphere environments with ease and precision.</p>
<h2 id="overviewofthedatastreams">Overview of the Datastreams</h2>
<ul>
<li><strong>Host Datastream:</strong> This datastream monitors the disk performance of the host, including metrics such as disk latency, average read/write bytes, uptime, and status. It also captures network metrics, such as packet information, network bandwidth, and utilization, as well as CPU and memory usage of the host. Additionally, it lists associated datastores, virtual machines, and networks within vSphere.</li>
</ul>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blta168f441354fc97e/6a7f1b6642a117cc8c95c333/hosts.png" alt="Host Datastream" /></p>
<ul>
<li><strong>Virtual Machine Datastream:</strong> This datastream tracks the used and available CPU and memory resources of virtual machines, along with the uptime and status of each VM. It includes information about the host on which the VM is running, as well as detailed snapshot metrics like the number of snapshots, creation dates, and descriptions. Additionally, it provides insights into associated hosts and datastores.</li>
</ul>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt77c54f960b7de840/6a7f1b699090b0e39084ee31/virtualmachine.png" alt="Virtual Machine Datastream" /></p>
<ul>
<li><p><strong>Datastore Datastream:</strong> This datastream provides information on the total, used, and available capacity of datastores, along with their overall status. It also captures metrics such as the average read/write rate and lists the hosts and virtual machines connected to each datastore.</p></li>
<li><p><strong>Datastore Cluster:</strong> A datastore cluster in vSphere is a collection of datastores grouped together for efficient storage management. This datastream provides details on the total capacity and free space in the storage pod, along with the list of datastores within the cluster.</p></li>
</ul>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt065c647cb8e5d02f/6a7f1b6dc2e914310301700a/datastore.png" alt="Datastore Datastream" /></p>
<ul>
<li><p><strong>Resource Pool:</strong> Resource pools in vSphere serve as logical abstractions that allow flexible allocation of CPU and memory resources. This datastream captures memory metrics, including swapped, ballooned, and shared memory, as well as CPU metrics like distributed and static CPU entitlement. It also lists the virtual machines associated with each resource pool.</p></li>
<li><p><strong>Network Datastream:</strong> This datastream captures the overall configuration and status of the network, including network types (e.g., vSS, vDS). It also lists the hosts and virtual machines connected to each network.</p></li>
<li><p><strong>Cluster Datastream:</strong> A Cluster in vSphere is a collection of ESXi hosts and their associated virtual machines that function as a unified resource pool. Clustering in vSphere allows administrators to manage multiple hosts and resources centrally, providing high availability, load balancing, and scalability to the virtual environment. This datastream includes metrics indicating whether HA or admission control is enabled and lists the hosts, networks, and datastores associated with the cluster.</p></li>
</ul>
<h2 id="alarmssupportinvsphereintegration">Alarms support in vSphere Integration</h2>
<p>Alarms are a vital part of the vSphere integration, providing real-time insights into critical events across your virtual environment. In the updated Elastic’s vSphere integration, alarms are now reported for all the entities. They include detailed information such as the alarm name, description, severity (e.g., critical or warning), affected entity, and triggered time. These alarms are seamlessly integrated into datastreams, helping administrators and SREs quickly identify and resolve issues like resource shortages or performance bottlenecks.</p>
<h4 id="examplealarm">Example Alarm</h4>
<pre><code>"triggered_alarms": [
  {
    "description": "Default alarm to monitor host memory usage",
    "entity_name": "host_us",
    "id": "alarm-4.host-12",
    "name": "Host memory usage",
    "status": "red",
    "triggered_time": "2024-08-28T10:31:26.621Z"
  }
]
</code></pre>
<p>This example highlights a triggered alarm for monitoring host memory usage, indicating a critical status (red) for the host "host_us." Such alarms empower teams to act swiftly and maintain the stability of their vSphere environment. </p>
<h2 id="letstryitout">Lets Try It Out!</h2>
<p>The new <a href="https://www.elastic.co/docs/current/integrations/vsphere">vSphere integration</a> in Elastic Cloud is more than just a monitoring tool; it’s a comprehensive solution that empowers you to manage and optimize your virtual environments effectively. With deeper insights and enhanced data granularity, you can ensure high availability, improved load balancing, and smarter resource allocation. Spin up an Elastic Cloud, and start monitoring your vSphere infrastructure.</p>]]></content:encoded>
    <link>https://www.elastic.co/observability-labs/blog/supercharge-your-vsphere-monitoring-with-enhanced-vsphere-integration</link>
    <guid isPermaLink="false">supercharge-your-vsphere-monitoring-with-enhanced-vsphere-integration</guid>
    <category><![CDATA[Metrics]]></category>
    <dc:creator><![CDATA[Ishleen Kaur,Lalit Satapathy]]></dc:creator>
    <enclosure url="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltdc78bdc85ffd6827/6a7f1b6fe02fac3fe55d69cf/title.jpeg" length="0" type="image/jpeg"/>
    <pubDate>Wed, 11 Dec 2024 00:00:00 GMT</pubDate>
  </item>
  <item>
    <title><![CDATA[Elastic SQL inputs: A generic solution for database metrics observability]]></title>
    <description><![CDATA[This blog dives into the functionality of generic SQL and provides various use cases for advanced users to ingest custom metrics to Elastic for database observability. We also introduce the fetch from all database new capability released in 8.10.]]></description>
    <content:encoded><![CDATA[<p>Elastic<sup>®</sup> SQL inputs (<a href="https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-sql.html">metricbeat</a> module and <a href="https://docs.elastic.co/integrations/sql">input package</a>) allows the user to execute <a href="https://en.wikipedia.org/wiki/SQL">SQL</a> queries against many supported databases in a flexible way and ingest the resulting metrics to Elasticsearch<sup>®</sup>. This blog dives into the functionality of generic SQL and provides various use cases for <em>advanced users</em> to ingest custom metrics to Elastic<sup>®</sup>, for database observability. The blog also introduces the fetch from all database new capability, released in 8.10.</p>
<h2 id="whygenericsql">Why “Generic SQL”?</h2>
<p>Elastic already has metricbeat and integration packages targeted for specific databases. One example is <a href="https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-mysql.html">metricbeat</a> for MySQL — and the corresponding integration <a href="https://docs.elastic.co/en/integrations/mysql">package</a>. These beats modules and integrations are customized for a specific database, and the metrics are extracted using pre-defined queries from the specific database. The queries used in these integrations and the corresponding metrics are <em>not</em> available for modification.</p>
<p>Whereas the <em>Generic SQL inputs</em> (<a href="https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-sql.html">metricbeat</a> or <a href="https://docs.elastic.co/integrations/sql">input package</a>) can be used to scrape metrics from any supported database using the user's SQL queries. The queries are provided by the user depending on specific metrics to be extracted. This enables a much more powerful mechanism for metrics ingestion, where users can choose a specific driver and provide the relevant SQL queries and the results get mapped to one or more Elasticsearch documents, using a structured mapping process (table/variable format explained later).</p>
<p>Generic SQL inputs can be used in conjunction with the existing integration packages, which already extract specific database metrics, to extract additional custom metrics dynamically, making this input very powerful. In this blog, <em>Generic SQL input</em> and <em>Generic SQL</em> are used interchangeably.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt86cd15e65734414c/6a85cad543c0b77eb12f0612/elastic-blog-1-genericSQL.png" alt="Generic SQL database metrics collection" /></p>
<h2 id="functionalitiesdetails">Functionalities details</h2>
<p>This section covers some of the features that would help with the metrics extraction. We provide a brief description of the response format configuration. Then we dive into the merge_results functionality, which is used to combine results from multiple SQL queries into a single document.</p>
<p>The next key functionality users may be interested in is to collect metrics from all the custom databases, which is now possible with the fetch_from_all_databases feature.</p>
<p>Now let's dive into the specific functionalities:</p>
<h3 id="differentdriverssupported">Different drivers supported</h3>
<p>The generic SQL can fetch metrics from the different databases. The current version has the capability to fetch metrics from the following drivers: MySQL, PostgreSQL, Oracle, and Microsoft SQL Server(MSSQL).</p>
<h3 id="responseformat">Response format</h3>
<p>The response format in generic SQL is used to manipulate the data in either table or in variable format. Here’s an overview of the formats and syntax for creating and using the table and variables.</p>
<p>Syntax: <code>response_format: table {{or}} variables</code></p>
<p><strong>Response format table</strong><br />
This mode generates a single event for each row. The table format has no restrictions on the number of columns in the response. This format can have any number of columns.</p>
<p>Example:</p>
<pre><code>driver: "mssql"
sql_queries:
 - query: "SELECT counter_name, cntr_value FROM sys.dm_os_performance_counters WHERE counter_name= 'User Connections'"
   response_format: table
</code></pre>
<p>This query returns a response similar to this:</p>
<pre><code>"sql":{
      "metrics":{
         "counter_name":"User Connections ",
         "cntr_value":7
      },
      "driver":"mssql"
}
</code></pre>
<p>The response generated above adds the counter_name as a key in the document.</p>
<p><strong>Response format variables</strong><br />
The variable format supports key:value pairs. This format expects only two columns to fetch in a query.</p>
<p>Example:</p>
<pre><code>driver: "mssql"
sql_queries:
 - query: "SELECT counter_name, cntr_value FROM sys.dm_os_performance_counters WHERE counter_name= 'User Connections'"
   response_format: variables
</code></pre>
<p>The variable format takes the first variable in the query above as the key:</p>
<pre><code>"sql":{
      "metrics":{
         "user connections ":7
      },
      "driver":"mssql"
}
</code></pre>
<p>In the above response, you can see the value of counter_name is used to generate the key in variable format.</p>
<h3 id="responseoptimizationmerge_results">Response optimization: merge_results</h3>
<p>We are now supporting merging multiple query responses into a single event. By enabling <strong>merge_results</strong> , users can significantly optimize the storage space of the metrics ingested to Elasticsearch. This mode enables an efficient compaction of the document generated, where instead of generating multiple documents, a single merged document is generated wherever applicable. The metrics of a similar kind, generated from multiple queries, are combined into a single event.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt658fd39fac11b6c5/6a85cada18249ce22818f7bf/elastic-blog-2-output-merge-results.png" alt="Output of Merge results" /></p>
<p>Syntax: <code>merge_results: true {{or}} false</code></p>
<p>In the below example, you can see how the data is loaded into Elasticsearch for the below query when the merge_results is disabled.</p>
<p>Example:</p>
<p>In this example, we are using two different queries to fetch metrics from the performance counter.</p>
<pre><code>merge_results: false
driver: "mssql"
sql_queries:
  - query: "SELECT cntr_value As 'user_connections' FROM sys.dm_os_performance_counters WHERE counter_name= 'User Connections'"
    response_format: table
  - query: "SELECT cntr_value As 'buffer_cache_hit_ratio' FROM sys.dm_os_performance_counters WHERE counter_name = 'Buffer cache hit ratio' AND object_name like '%Buffer Manager%'"
    response_format: table
</code></pre>
<p>As you can see, the response for the above example generates a single document for each query.</p>
<p>The resulting document from the first query:</p>
<pre><code>"sql":{
      "metrics":{
         "user_connections":7
      },
      "driver":"mssql"
}
</code></pre>
<p>And resulting document from the second query:</p>
<pre><code>"sql":{
      "metrics":{
         "buffer_cache_hit_ratio":87
      },
      "driver":"mssql"
}
</code></pre>
<p>When we enable the merge_results flag in the query, both the above metrics are combined together and the data gets loaded in a single document.</p>
<p>You can see the merged document in the below example:</p>
<pre><code>"sql":{
      "metrics":{
         "user connections ":7,
         “buffer_cache_hit_ratio”:87
      },
      "driver":"mssql"
}
</code></pre>
<p><em>However, such a merge is possible only if the table queries are merged, and each produces a single row. There is no restriction on variable queries being merged.</em></p>
<h3 id="introducinganewcapabilityfetch_from_all_databases">Introducing a new capability: fetch_from_all_databases</h3>
<p>This is a <a href="https://github.com/elastic/beats/pull/35688">new functionality</a> to fetch all the database metrics automatically from the system and user databases of the Microsoft SQL Server, by enabling the fetch_from_all_databases flag.</p>
<p>Keep an eye out for the <a href="https://www.elastic.co/guide/en/beats/metricbeat/8.10/metricbeat-module-sql.html#_example_execute_given_queries_for_all_databases_present_in_a_server">8.10 release version</a> where you can start using the fetch all database feature. Prior to the 8.10 version, users had to provide the database names manually to fetch metrics from custom/user databases.</p>
<p>Syntax: <code>fetch_from_all_databases: true {{or}} false</code></p>
<p>Below is the sample query with fetch all databases flag as disabled:</p>
<pre><code>fetch_from_all_databases: false
driver: "mssql"
sql_queries:
  - query: "SELECT @@servername AS server_name, @@servicename AS instance_name, name As 'database_name', database_id FROM sys.databases WHERE name='master';"
</code></pre>
<p>The above query fetches metrics only for the provided database name. Here the input database is master, so the metrics are fetched only for the master.</p>
<p>Below is the sample query with the fetch all databases flag as enabled:</p>
<pre><code>fetch_from_all_databases: true
driver: "mssql"
sql_queries:
  - query: SELECT @@servername AS server_name, @@servicename AS instance_name, DB_NAME() AS 'database_name', DB_ID() AS database_id;
    response_format: table
</code></pre>
<p>The above query fetches metrics from all available databases. This is useful when the user wants to get data from all the databases.</p>
<p>Please note: currently this feature is supported only for Microsoft SQL Server and will be used by MS SQL integration internally, to support extracting metrics for <a href="https://github.com/elastic/integrations/issues/4108">all user DBs</a> by default.</p>
<h2 id="usinggenericsqlmetricbeat">Using generic SQL: Metricbeat</h2>
<p>The generic <a href="https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-sql.html">SQL metricbeat module</a> provides flexibility to execute queries against different database drivers. The metricbeat input is available as GA for any production usage. <a href="https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-sql.html">Here</a>, you can find more information on configuring <a href="https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-sql.html">the generic SQL</a> for different drivers with various examples.</p>
<h2 id="usinggenericsqlinputpackage">Using generic SQL: Input package</h2>
<p>The input package provides a flexible solution to advanced users for customizing their ingestion experience in Elastic. Generic SQL is now also available as an SQL<a href="https://docs.elastic.co/integrations/sql">input package</a>. The input package is currently available for early users as a <strong>beta release</strong>. Let's take a walk through how users can use generic SQL via the input package.</p>
<h3 id="configurationsofgenericsqlinputpackage">Configurations of generic SQL input package:</h3>
<p>The configuration options for the generic SQL input package are as below:</p>
<ul>
<li><strong>Driver**</strong> :** This is the SQL database for which you want to use the package. In this case, we will take mysql as an example.</li>
<li><strong>Hosts:</strong> Here the user enters the connection string to connect to the database. It would vary depending on which database/driver is being used. Refer <a href="https://docs.elastic.co/integrations/sql#hosts">here</a> for examples.</li>
<li><strong>SQL Queries:</strong> Here the user writes the SQL queries they want to fire and the response_format is specified.</li>
<li><strong>Data set:</strong> The user specifies a <a href="https://www.elastic.co/guide/en/ecs/master/ecs-data_stream.html#_data_stream_field_details">data set</a> name to which the response fields get mapped.</li>
<li><strong>Merge results**</strong> :** This is an advanced setting, used to merge queries into a single event.</li>
</ul>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltc36880b217c1a2b7/6a85cadd9829266c605838e4/elastic-blog-3-SQL-metrics-inputpackage.png" alt="Configuration parameters for SQL input package" /></p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt9f349d24b55e602e/6a85cae333f244f11649f506/elastic-blog-4-expanded-document.png" alt="Metrics getting mapped to the index created by the ‘sql_first_dataset’" /></p>
<h3 id="metricsextensibilitywithcustomizedsqlqueries">Metrics extensibility with customized SQL queries</h3>
<p>Let's say a user is using <a href="https://docs.elastic.co/integrations/mysql">MYSQL Integration</a>, which provides a fixed set of metrics. Their requirement now extends to retrieving more metrics from the MYSQL database by firing new customized SQL queries.</p>
<p>This can be achieved by adding an instance of SQL input package, writing the customized queries and specifying a new <a href="https://www.elastic.co/guide/en/ecs/master/ecs-data_stream.html#field-data-stream-dataset">data set</a> name as shown in the screenshot below.</p>
<p>This way users can get any metrics by executing corresponding queries. The resultant metrics of the query will be indexed to the new data set, sql_second_dataset.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltea0ae6966bbfd68b/6a85cae7ba7acc2b13992146/elastic-blog-5-driver.png" alt="Customization of Ingest Pipelines and Mappings" /></p>
<p>When there are multiple queries, users can club them into a single event by enabling the Merge Results toggle.</p>
<h3 id="customizinguserexperience">Customizing user experience</h3>
<p>Users can customize their data by writing their own <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest.html">ingest pipelines</a> and providing their customized <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html">mappings</a>. Users can also build their own bespoke dashboards.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt89913365b437dcf0/6a85caebf61d6e02d29c2b15/elastic-blog-6-ingest-pipeline.png" alt="Customization of Ingest Pipelines and Mappings" /></p>
<p>As we can see above, the SQL input package provides the flexibility to get new metrics by running new queries, which are not supported in the default MYSQL integration (the user gets metrics from a predetermined set of queries).</p>
<p>The SQL input package also supports multiple drivers: mssql, postgresql and oracle. So a single input package can be used to cater to all these databases.</p>
<p>Note: The fetch_from_all_databases feature is not supported in the SQL input package yet.</p>
<h2 id="tryitout">Try it out!</h2>
<p>Now that you know about various use cases and features of generic SQL, get started with <a href="https://cloud.elastic.co/registration?fromURI=/home">Elastic Cloud</a> and try using the <a href="https://docs.elastic.co/integrations/sql">SQL input package</a> for your SQL database and get customized experience and metrics. If you are looking for newer metrics for some of our existing SQL based integrations — like <a href="https://docs.elastic.co/en/integrations/microsoft_sqlserver">Microsoft SQL Server</a>, <a href="https://docs.elastic.co/integrations/oracle">Oracle</a>, and more — go ahead and give the SQL input package a swirl.</p>
<p><em>The release and timing of any features or functionality described in this post remain at Elastic's sole discretion. Any features or functionality not currently available may not be delivered on time or at all.</em></p>]]></content:encoded>
    <link>https://www.elastic.co/observability-labs/blog/sql-inputs-database-metrics-observability</link>
    <guid isPermaLink="false">sql-inputs-database-metrics-observability</guid>
    <category><![CDATA[Metrics]]></category>
    <category><![CDATA[Logs Analytics]]></category>
    <dc:creator><![CDATA[Lalit Satapathy,Ishleen Kaur,Muthukumar Paramasivam]]></dc:creator>
    <enclosure url="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt83f89ae1d32f8838/6a85caeeabdc295c6b1224f8/patterns-midnight-background-no-logo-observability.png" length="0" type="image/png"/>
    <pubDate>Mon, 11 Sep 2023 00:00:00 GMT</pubDate>
  </item>
  <item>
    <title><![CDATA[Exploring Nginx metrics with Elastic time series data streams]]></title>
    <description><![CDATA[Elasticsearch recently released time series metrics as GA. In this blog, we dive into details of what a time series metric document is and the mapping used for enabling time series by using an existing OOTB Nginx integration.]]></description>
    <content:encoded><![CDATA[<p>Elasticsearch<sup>®</sup> recently released time series data streams for metrics. This not only provides better metrics support in Elastic Observability, but it also helps reduce <a href="https://www.elastic.co/blog/whats-new-elasticsearch-8-7-0">storage costs</a>. We discussed this in a <a href="https://www.elastic.co/blog/elasticsearch-time-series-data-streams-observability-metrics">previous blog</a>.</p>
<p>In this blog, we dive into how to enable and use time series data streams by reviewing what a time series metrics <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/documents-indices.html">document</a> is and the <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html">mapping</a> used for enabling time series. In particular, we will showcase this by using Elastic Observability’s Nginx integration. As Elastic<sup>®</sup> <a href="https://www.elastic.co/guide/en/elasticsearch/reference/8.8/tsds.html">time series data stream (TSDS)</a> metrics capabilities evolve, some of the scenarios below will change.</p>
<p>Elastic TSDS stores metrics in indices optimized for a time series database (<a href="https://en.wikipedia.org/wiki/Time_series_database">TSDB</a>), which is used to store time series metrics. <a href="https://www.elastic.co/blog/whats-new-elasticsearch-8-7-0">Elastic’s TSDB also got a significant optimization in 8.7</a> by reducing storage costs by upward of 70%.</p>
<h2 id="whatisanelastictimeseriesdatastream">What is an Elastic time series data stream?</h2>
<p>A time series data stream (TSDS) models timestamped metrics data as one or more time series. In a TSDS, each Elasticsearch document represents an observation or data point in a specific time series. Although a TSDS can contain multiple time series, a document can only belong to one time series. A time series can’t span multiple data streams.</p>
<p>A regular <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/data-streams.html">data stream</a> can have different usages including logs. For metrics usage, however, a time series data stream is recommended. A time series data stream is different from a regular data stream in <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/tsds.html#differences-from-regular-data-stream">multiple ways</a>. A TSDS contains more than one predefined dimension and multiple metrics.</p>
<h2 id="nginxmetricsasanexample">Nginx metrics as an example</h2>
<p><a href="https://www.elastic.co/integrations/data-integrations?solution=observability">Integrations</a> provide an easy way to ingest observability metrics for a large number of services and systems. We use the <a href="https://docs.elastic.co/en/integrations/nginx">Nginx</a> integration <a href="https://docs.elastic.co/en/integrations/nginx#metrics-reference">metrics</a> data set as an example here. This is one of the integrations, on which time series has been recently enabled.</p>
<h2 id="processofenablingtsdsonapackage">Process of enabling TSDS on a package</h2>
<p>Time series is <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/tsds.html#time-series-mode">enabled</a> on a metrics data stream of an <a href="https://www.elastic.co/integrations/">integration</a> package, after adding the relevant time series <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/tsds.html#time-series-metric">metrics</a> and <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/tsds.html#time-series-dimension">dimension</a> mappings. Existing integrations with metrics data streams will come with time series metrics enabled, so that users can use them as-is without any additional configuration.</p>
<p>The image below captures a high-level summary of a time series data stream, the corresponding index template, the time series indices and a single document. We will shortly dive into the details of each of the fields in the document.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt1941b44b80b21a70/6a7f0e97c2cc0991d524963a/elastic-blog-1-time-series-data-stream-2.png" alt="time series data stream" /></p>
<h2 id="tsdsmetricdocument">TSDS metric document</h2>
<p>Below we provide a snippet of an ingested Elastic document with time series metrics and dimension together.</p>
<pre><code>{
  "@timestamp": "2023-06-29T03:58:12.772Z",

  "nginx": {
    "stubstatus": {
      "accepts": 202,
      "active": 2,
      "current": 3,
      "dropped": 0,
      "handled": 202,
      "hostname": "host.docker.internal:80",
      "reading": 0,
      "requests": 10217,
      "waiting": 1,
      "writing": 1
    }
  }
}
</code></pre>
<p><strong>Multiple metrics per document:</strong><br />
An ingested <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/documents-indices.html">document</a> has a collection of fields, including metrics fields. Multiple related metrics fields can be part of a single document. A document is part of a single <a href="https://www.elastic.co/guide/en/fleet/current/data-streams.html">data stream</a>, and typically all the metrics it contains are related. All the metrics in a document are part of the same time series.</p>
<p><strong>Metric type and dimensions as mapping:</strong><br />
While the document contains the metrics details, the metric types and dimension details are defined as part of the field <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html">mapping</a>. All the time series relevant field mappings are defined collectively for a given datastream, as part of the package development. All the integrations released with time series data stream, contain all the relevant time series field mappings, as part of the package release. There are two additional mappings needed in particular: <strong>time_series_metric</strong> mapping and <strong>time_series_dimension</strong> mapping.</p>
<h2 id="metricstypesfields">Metrics types fields</h2>
<p>A document contains the metric type fields (as shown above). The mappings for the metric type fields is done using <strong>time_series_metric</strong> mapping in the <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/index-templates.html">index templates</a> as given below:</p>
<pre><code>"nginx": {
    "properties": {
       "stubstatus": {
           "properties": {
                "accepts": {
                  "type": "long",
                  "time_series_metric": "counter"
                },
                "active": {
                  "type": "long",
                  "time_series_metric": "gauge"
                },
                "current": {
                  "type": "long",
                  "time_series_metric": "gauge"
                },
                "dropped": {
                  "type": "long",
                  "time_series_metric": "counter"
                },
                "handled": {
                  "type": "long",
                  "time_series_metric": "counter"
                },
                "reading": {
                  "type": "long",
                  "time_series_metric": "gauge"
                },
                "requests": {
                  "type": "long",
                  "time_series_metric": "counter"
                },
                "waiting": {
                  "type": "long",
                  "time_series_metric": "gauge"
                },
                "writing": {
                  "type": "long",
                  "time_series_metric": "gauge"
                }
           }
       }
    }
}
</code></pre>
<h2 id="dimensionfields">Dimension fields</h2>
<p><a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/tsds.html#time-series-dimension">Dimensions</a> are field names and values that, in combination, identify a document’s time series.</p>
<p>In Elastic time series, there are some additional considerations for dimensions:</p>
<ul>
<li>Dimension fields need to be defined for each time series. There will be no time series with zero dimension fields.</li>
<li>Keyword (or similar) type fields can be defined as dimensions.</li>
<li>There is a current limit on the number of dimensions that can be defined in a data stream. The limit restrictions will likely be lifted going forward.</li>
</ul>
<p>Dimension is common for all the metrics in a single document, as part of a data stream. Each time series data stream of a package (example: Nginx) already comes with a predefined set of dimension fields as below.</p>
<p>The document would contain more than one dimension field. In the case of Nginx, <em>agend.id</em> and <em>nginx.stubstatus.hostname</em> are some of the dimension fields. The mappings for the dimension fields is done using <strong>time_series_dimension</strong> mapping as below:</p>
<pre><code>"agent": {
   "properties": {
      "id": {
         "type": "keyword",
         "time_series_dimension": true
       }
    }
 },

"nginx": {
   "properties": {
       "stubstatus": {
            "properties": {
                "hostname": {
                  "type": "keyword",
                  "time_series_dimension": true
                },
            }
       }
    }
}
</code></pre>
<h2 id="metafields">Meta fields</h2>
<p>Documents ingested also have additional meta fields apart from the <em>metric</em> and <em>dimension</em> fields explained above. These additional fields provide richer query capabilities for the metrics.</p>
<p><strong>Example Elastic meta fields</strong></p>
<pre><code>"data_stream": {
      "dataset": "nginx.stubstatus",
      "namespace": "default",
      "type": "metrics"
 }
</code></pre>
<h2 id="discoverandvisualizationinkibana">Discover and visualization in Kibana</h2>
<p>Elastic provides comprehensive search and visualization for the time series metrics. Time series metrics can be searched as-is in <a href="https://www.elastic.co/guide/en/kibana/current/discover.html">Discover</a>. In the search below, the counter and gauges metrics are captured as <em>different icons</em>. Below we also provide examples of visualization for the time series metrics using <a href="https://www.elastic.co/kibana/kibana-lens">Lens</a> and OOTB dashboard included as part of the Nginx integration package.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltc0e8b439bf3f9f92/6a7f0e9abdcff037b5c42ef1/elastic-blog-2-discover-search-tsds.png" alt="Discover search for TSDS metrics" /></p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt5242a1da45d3f167/6a7f0e9db4377009764d6d43/elastic-blog-3-lens.png" alt="Maximum of counter field nginx.stubstatus.accepts visualized using Lens" /></p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt71c4c54d6de8bf51/6a7f0ea02f00b2ff3fefec08/elastic-blog-4-median-gauge.png" alt="Median of gauge field nginx.stubstatus.active visualized using Lens" /></p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt7172bc5ca118f3e3/6a7f0ea33cab1c43a20e490e/elastic-blog-5-multiple-line-graphs.png" alt="OOTB Nginx dashboard with the TSDS metrics visualizations " /></p>
<h2 id="tryitout">Try it out!</h2>
<p>We have provided a detailed example of a time series document ingested by the Elastic Nginx integration. We have walked through how time series metrics are modeled in Elastic and the additional time series mappings with examples. We provided details of dimension requirements for Elastic time series, as well as brief examples of search/visualization/dashboard of TSDS metrics in Kibana<sup>®</sup>.</p>
<p>Don’t have an Elastic Cloud account yet? <a href="https://cloud.elastic.co/registration">Sign up for Elastic Cloud</a> and try out the auto-instrumentation capabilities that I discussed above. I would be interested in getting your feedback about your experience in gaining visibility into your application stack with Elastic.</p>
<blockquote>
  <ul>
  <li><a href="https://www.elastic.co/blog/elasticsearch-time-series-data-streams-observability-metrics">How to use Elasticsearch and Time Series Data Streams for observability metrics</a></li>
  <li><a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/tsds.html">Time Series Data Stream in Elastic documentation</a> </li>
  <li><a href="https://www.elastic.co/blog/whats-new-elasticsearch-8-7-0">Efficient storage with Elastic Time Series Database</a><a href="https://www.elastic.co/integrations/">Elastic integrations catalog</a></li>
  <li><a href="https://www.elastic.co/integrations/">Elastic integrations catalog</a></li>
  </ul>
</blockquote>]]></content:encoded>
    <link>https://www.elastic.co/observability-labs/blog/nginx-metrics-elastic-time-series-data-streams</link>
    <guid isPermaLink="false">nginx-metrics-elastic-time-series-data-streams</guid>
    <category><![CDATA[Metrics]]></category>
    <category><![CDATA[Infrastructure Monitoring]]></category>
    <dc:creator><![CDATA[Lalit Satapathy]]></dc:creator>
    <enclosure url="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt320155e641e1dfc9/6a7f0ea6eab5be716e20a793/time-series-data-streams-blog-720x420-1.jpg" length="0" type="image/jpeg"/>
    <pubDate>Mon, 10 Jul 2023 00:00:00 GMT</pubDate>
  </item>
  </channel>
</rss>