Giter Site home page Giter Site logo

azure-monitor-client's Introduction

Azure Monitor Client

A simple async client for the Azure Monitor Data Collector API.

Minimal Usage Example

from datetime import datetime
from uuid import uuid4
import asyncio
import json

from azure_monitor_client import AzureMonitorClient

client = AzureMonitorClient(
    workspace_id=WORKSPACE_ID,
    shared_key=SHARED_KEY
)

async def send_event() -> None:
    # This is just an example of the kind of data you can send.
    # None of these fields are required.
    # For more information on data types, see:
    # https://www.stefanroth.net/2018/05/08/azure-log-analytics-get-data-types/
    payload = {
        "timestamp": datetime.utcnow().isoformat(),
        "record_uid": str(uuid()),
        "active": True,
        "fields": json.dumps({
            "name": "Jackie Welles",
            "age": 30,
        })
    }

    await client.send("AuditLog", payload)

asyncio.run(send_event())

azure-monitor-client's People

Contributors

backwardspy avatar

Watchers

Chris Pressland avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.