-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
165 additions
and
15 deletions.
There are no files selected for viewing
135 changes: 135 additions & 0 deletions
135
docs/en/observability/cloud-monitoring/azure/collect-azure-metrics.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
[[collect-azure-metrics]] | ||
= How to collect any metrics with Azure Monitoring | ||
|
||
++++ | ||
<titleabbrev>Collect metrics</titleabbrev> | ||
++++ | ||
|
||
**WIP** | ||
|
||
I want to collect Azure Application insights logs using the Elastic Agent. Unfortunately, at the time of this writing, there isn't a specialized integration to collect such logs. | ||
But we can leverage the generic Event Hub integration to collect Azure Application insights logs and any other log exported using a Diagnostic Settings. | ||
|
||
[discrete] | ||
== Prerequisites | ||
|
||
WIP | ||
|
||
[discrete] | ||
=== Application | ||
|
||
Search for a Diagnostic Settings that exports Azure Application insights logs. | ||
|
||
For this test, I will use an application insight app (or component) named return-of-the-jedi: | ||
|
||
<insert image> | ||
|
||
[discrete] | ||
=== Event Hub | ||
|
||
We need a new event hub to collect all the logs for this application. | ||
|
||
Create or use an existing Event Hub namespace | ||
Create a new event hub named "insightslogs" | ||
|
||
<insert image> | ||
|
||
[discrete] | ||
== Configuration | ||
|
||
[discrete] | ||
[[diagnostic-settings-step-one]] | ||
=== Step 1: Set up the Diagnostic Settings | ||
|
||
Using the application return-of-the-jedi: | ||
|
||
Visit Application > Monitoring > Diagnostic Settings and click on Add diagnostic setting. | ||
Set a name | ||
Select all the categories you're interested in | ||
On Destination details select Stream to an event hub | ||
Select the namespace and event hub name from the drop down lists | ||
Click Save | ||
|
||
<insert image> | ||
|
||
[discrete] | ||
[[generate-logs-step-two]] | ||
=== Step 2: Generate some logs | ||
|
||
Use the application connected to the application insights resource to get some test logs. In this example, return-of-the-jedi is connected to an App Function with an HTTP endpoint. | ||
|
||
I am sending a few requests to the HTTP endpoint, and here are a few logs: | ||
|
||
<insert image> | ||
|
||
[discrete] | ||
[[check-event-hub-step-three]] | ||
=== Step 3: Check the Event Hub for exported logs | ||
|
||
If I go back to the event hub "insightslogs", the charts start reporting some data: | ||
|
||
[discrete] | ||
== Collect the logs | ||
|
||
[discrete] | ||
[[steup-agent-step-one]] | ||
=== Step 1: Set up the agent | ||
|
||
Create a new "Application Insights logs" agent policy for this test | ||
Install the generic Azure Event Hub input integration | ||
|
||
<image> | ||
|
||
Set up the integration using the "insightslogs" event hub and the other options. See https://docs.elastic.co/integrations/azure#setup to learn more. | ||
|
||
<image> | ||
|
||
In this first iteration: | ||
|
||
Leave "Parse azure message" off | ||
Turn "Preserve original event: on | ||
|
||
[discrete] | ||
[[explore-logs-step-two]] | ||
=== Step 2: Explore the logs | ||
|
||
Assign the agent policy to an agent and start exploring the logs. | ||
|
||
Open Analytics > Discover and then filter documents using data_stream.dataset : "azure.eventhub": | ||
|
||
<image> | ||
|
||
[discrete] | ||
[[basic-parsing-step-three]] | ||
=== Step 3: Basic parsing | ||
|
||
With the current configuration, the integration collects the applications insights logs as string in the message field: | ||
|
||
<image> | ||
|
||
At this point, we have two options: | ||
|
||
- Enable the "Parse azure message" to turn the content of the message field into an object, levering the dynamic mapping. | ||
- Add a custom pipeline and mapping to fine-tune the documents. | ||
|
||
Enable the "Parse azure message" | ||
|
||
This is a quick option to start using the logs. Go back to the agent policy and flip the "Parse azure message" switch: | ||
|
||
<image> | ||
|
||
Here is an example document with parsing enabled: | ||
|
||
<image> | ||
|
||
Add a custom pipeline and mapping | ||
|
||
The document parsing is great, but there are downsides: | ||
|
||
The automatic parsing turns the JSON log into an object; field names can vary a lot, depending on the conventions used by the Azure team responsible for the service. | ||
Conflicts may occur; for example, log categories may have the same field name with different types | ||
|
||
[discrete] | ||
== Conclusions | ||
|
||
"Parse azure message" is a great option, but I recommend considering building custom pipelines and mappings to take complete control. |
File renamed without changes.
File renamed without changes.
28 changes: 28 additions & 0 deletions
28
docs/en/observability/cloud-monitoring/azure/monitor-azure-intro.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
[[monitor-azure-web-services]] | ||
= Azure monitoring | ||
|
||
++++ | ||
<titleabbrev>Azure monitoring</titleabbrev> | ||
++++ | ||
|
||
Elastic Observability offers powerful monitoring solutions to keep your Azure environments reliable and efficient, providing deep insights into the performance of your applications, services, and infrastructure components. | ||
|
||
Learn how to use the Elastic Observability solution to observe and monitor a broad range of Azure resources and applications. | ||
|
||
- <<monitor-azure-elastic-agent>> | ||
- <<monitor-azure>> | ||
- <<monitor-azure-native>> | ||
|
||
|
||
For a full list of supported Azure integrations, check the {integrations-docs}[Elastic | ||
Integrations docs]. | ||
|
||
include::monitor-azure-agent.asciidoc[] | ||
|
||
include::collect-azure-metrics.asciidoc[leveloffset=+2] | ||
|
||
include::monitor-azure-beats.asciidoc[] | ||
|
||
include::monitor-azure-native.asciidoc[] | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters