skip to Main Content

We have a set of Grafana dashboards which are connected to our Azure system and we have some useful data showing on these dashboards.

However there is 1 selection of data that is eluding me at present, this is Deployment Center logs. In Azure these are visible thus:

enter image description here
enter image description here

So my question is how do I display this on a Grafana dashboard, any ideas please?
Thanks in advance for any help on this.

2

Answers


  1. There is a REST Api to access the logs

    https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments?api-version=2023-12-01
    

    See the docs.

    Then, use the Infinity data source plugin for Grafana to visualize the data. There is a tutorial on how to do this based on the azure management api, which is the one you need.

    Login or Signup to reply.
  2. Step 1: Set Up Logging in Azure

    Enable Diagnostics Logs: Ensure that the Azure service (like Azure App Service) has diagnostics logging enabled. You can do this from the Azure Portal:

    Navigate to the resource (e.g., App Service).
    Go to "Monitoring" > "Diagnostics settings."
    Configure a diagnostics setting to send logs to a suitable location (e.g., Azure Monitor Logs / Log Analytics, Event Hubs, or Blob Storage).

    Choose the Right Log Category: If you are specifically interested in Deployment Center logs, make sure you include the relevant log categories when configuring diagnostics.

    Step 2: Send Logs to Log Analytics

    If you’re using Azure Monitor (Log Analytics):

    Create a Log Analytics Workspace: If you don’t already have one, create a Log Analytics workspace in the Azure Portal.

    Link the Azure Service to the Workspace: Connect your Azure resource to the Log Analytics workspace for log collection.

    Verify Log Collection: Check if the logs are being collected in the Log Analytics workspace using Kusto Query Language (KQL).

    Step 3: Set Up Grafana

    Install Grafana: If you haven’t done so already, install Grafana on a server or use Grafana Cloud.

    Add the Data Source:

    In Grafana, go to Configuration > Data Sources.
    Click on Add data source.
    Choose Azure Monitor (or Loki if you sent logs there, etc.).
    Enter the necessary configuration details:
    For Azure Monitor, you will need your Azure credentials and the Log Analytics workspace ID.

    Configure Queries:

    After configuring the data source, create a dashboard.
    Use the query editor to build KQL queries that fetch the desired log data from your Log Analytics workspace.
    Example KQL query to fetch Azure Logs:

    AzureActivity
    | where ResourceType == "YOUR_RESOURCE_TYPE"
    | project TimeGenerated, Resource, OperationName, Status
    | order by TimeGenerated desc
    

    Step 4: Create Visualizations

    Build Your Dashboard:

    Once you have your data source configured and queries set up, start adding panels to your Grafana dashboard.
    Choose different visualization types (graphs, tables, etc.) to display the log data effectively.

    Customize Panel Settings:

    Adjust panel settings and options to suit your needs for displaying the Azure Deployment Center logs chronologically or based on different metrics.

    Save the Dashboard: After configuring, save your dashboard for future use.

    Step 5: Monitor & Rotate Logs

    Set Retention Policies: Ensure that your Log Analytics workspace has appropriate data retention policies for your use case.
    Monitor for Updates: Regularly check the connection and logs to ensure that everything is functioning as expected.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search